From 8566ce6bf368756909339cb7b756b244fece877f Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 3 Nov 2021 08:35:23 -0700 Subject: [PATCH] feat: Updating the grafeas protos to include compliance and intoto attestation protos (#352) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Updating the grafeas protos to include compliance and intoto attestation protos PiperOrigin-RevId: 407119231 Source-Link: https://github.com/googleapis/googleapis/commit/381ab78414f71d6f9476c3044c212e13d762e822 Source-Link: https://github.com/googleapis/googleapis-gen/commit/e90da8dd8310537b53133efb1867a8990adb149a Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZTkwZGE4ZGQ4MzEwNTM3YjUzMTMzZWZiMTg2N2E4OTkwYWRiMTQ5YSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../protos/grafeas/v1/attestation.proto | 17 + .../protos/grafeas/v1/build.proto | 14 +- .../protos/grafeas/v1/common.proto | 22 +- .../protos/grafeas/v1/compliance.proto | 79 + .../protos/grafeas/v1/dsse_attestation.proto | 52 + .../protos/grafeas/v1/grafeas.proto | 13 + .../protos/grafeas/v1/intoto_provenance.proto | 112 + .../protos/grafeas/v1/intoto_statement.proto | 49 + .../protos/grafeas/v1/package.proto | 10 +- .../protos/grafeas/v1/slsa_provenance.proto | 114 + .../protos/grafeas/v1/vulnerability.proto | 35 + .../protos/protos.d.ts | 3930 +++- .../protos/protos.js | 15971 +++++++++++----- .../protos/protos.json | 505 +- .../src/v1/container_analysis_proto_list.json | 5 + .../src/v1/grafeas_proto_list.json | 5 + 16 files changed, 15668 insertions(+), 5265 deletions(-) create mode 100644 packages/google-devtools-containeranalysis/protos/grafeas/v1/compliance.proto create mode 100644 packages/google-devtools-containeranalysis/protos/grafeas/v1/dsse_attestation.proto create mode 100644 packages/google-devtools-containeranalysis/protos/grafeas/v1/intoto_provenance.proto create mode 100644 packages/google-devtools-containeranalysis/protos/grafeas/v1/intoto_statement.proto create mode 100644 packages/google-devtools-containeranalysis/protos/grafeas/v1/slsa_provenance.proto diff --git a/packages/google-devtools-containeranalysis/protos/grafeas/v1/attestation.proto b/packages/google-devtools-containeranalysis/protos/grafeas/v1/attestation.proto index 61423d3eb29..f2854fe686b 100644 --- a/packages/google-devtools-containeranalysis/protos/grafeas/v1/attestation.proto +++ b/packages/google-devtools-containeranalysis/protos/grafeas/v1/attestation.proto @@ -53,6 +53,13 @@ message AttestationNote { Hint hint = 1; } +message Jwt { + // The compact encoding of a JWS, which is always three base64 encoded strings + // joined by periods. For details, see: + // https://tools.ietf.org/html/rfc7515.html#section-3.1 + string compact_jwt = 1; +} + // Occurrence that represents a single "attestation". The authenticity of an // attestation can be verified using the attached signature. If the verifier // trusts the public key of the signer, then verifying the signature is @@ -70,4 +77,14 @@ message AttestationOccurrence { // `signature` verifies `serialized_payload`. See `Signature` in common.proto // for more details on signature structure and verification. repeated Signature signatures = 2; + // One or more JWTs encoding a self-contained attestation. + // Each JWT encodes the payload that it verifies within the JWT itself. + // Verifier implementation SHOULD ignore the `serialized_payload` field + // when verifying these JWTs. + // If only JWTs are present on this AttestationOccurrence, then the + // `serialized_payload` SHOULD be left empty. + // Each JWT SHOULD encode a claim specific to the `resource_uri` of this + // Occurrence, but this is not validated by Grafeas metadata API + // implementations. The JWT itself is opaque to Grafeas. + repeated Jwt jwts = 3; } diff --git a/packages/google-devtools-containeranalysis/protos/grafeas/v1/build.proto b/packages/google-devtools-containeranalysis/protos/grafeas/v1/build.proto index c0e9c756654..172637fd459 100644 --- a/packages/google-devtools-containeranalysis/protos/grafeas/v1/build.proto +++ b/packages/google-devtools-containeranalysis/protos/grafeas/v1/build.proto @@ -16,6 +16,8 @@ syntax = "proto3"; package grafeas.v1; +import "grafeas/v1/intoto_provenance.proto"; +import "grafeas/v1/intoto_statement.proto"; import "grafeas/v1/provenance.proto"; option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas"; @@ -32,7 +34,7 @@ message BuildNote { // Details of a build occurrence. message BuildOccurrence { - // Required. The actual provenance for the build. + // The actual provenance for the build. grafeas.v1.BuildProvenance provenance = 1; // Serialized JSON representation of the provenance, used in generating the @@ -47,4 +49,14 @@ message BuildOccurrence { // provenance is marshalled to json as well to prevent incompatibilities with // future changes. string provenance_bytes = 2; + + // Deprecated. See InTotoStatement for the replacement. + // In-toto Provenance representation as defined in spec. + InTotoProvenance intoto_provenance = 3; + + // In-toto Statement representation as defined in spec. + // The intoto_statement can contain any type of provenance. The serialized + // payload of the statement can be stored and signed in the Occurrence's + // envelope. + InTotoStatement intoto_statement = 4; } diff --git a/packages/google-devtools-containeranalysis/protos/grafeas/v1/common.proto b/packages/google-devtools-containeranalysis/protos/grafeas/v1/common.proto index db780bb629c..29a666320be 100644 --- a/packages/google-devtools-containeranalysis/protos/grafeas/v1/common.proto +++ b/packages/google-devtools-containeranalysis/protos/grafeas/v1/common.proto @@ -23,7 +23,7 @@ option objc_class_prefix = "GRA"; // Kind represents the kinds of notes supported. enum NoteKind { - // Unknown. + // Default value. This value is unused. NOTE_KIND_UNSPECIFIED = 0; // The note and occurrence represent a package vulnerability. VULNERABILITY = 1; @@ -41,6 +41,10 @@ enum NoteKind { ATTESTATION = 7; // This represents an available package upgrade. UPGRADE = 8; + // This represents a Compliance Note + COMPLIANCE = 9; + // This represents a DSSE attestation Note + DSSE_ATTESTATION = 10; } // Metadata for any related URL information. @@ -84,7 +88,7 @@ message Signature { // The identifier for the public key that verifies this signature. // * The `public_key_id` is required. - // * The `public_key_id` MUST be an RFC3986 conformant URI. + // * The `public_key_id` SHOULD be an RFC3986 conformant URI. // * When possible, the `public_key_id` SHOULD be an immutable reference, // such as a cryptographic digest. // @@ -101,3 +105,17 @@ message Signature { // * "nih:///sha-256;703f68f42aba2c6de30f488a5ea122fef76324679c9bf89791ba95a1271589a5" string public_key_id = 2; } + +// MUST match +// https://github.com/secure-systems-lab/dsse/blob/master/envelope.proto. An +// authenticated message of arbitrary type. +message Envelope { + bytes payload = 1; + string payload_type = 2; + repeated EnvelopeSignature signatures = 3; +} + +message EnvelopeSignature { + bytes sig = 1; + string keyid = 2; +} diff --git a/packages/google-devtools-containeranalysis/protos/grafeas/v1/compliance.proto b/packages/google-devtools-containeranalysis/protos/grafeas/v1/compliance.proto new file mode 100644 index 00000000000..1d41db2c476 --- /dev/null +++ b/packages/google-devtools-containeranalysis/protos/grafeas/v1/compliance.proto @@ -0,0 +1,79 @@ +// Copyright 2021 The Grafeas Authors. All rights reserved. +// +// 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. + +syntax = "proto3"; + +package grafeas.v1; + +import "grafeas/v1/vulnerability.proto"; + +option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas"; +option java_multiple_files = true; +option java_package = "io.grafeas.v1"; +option objc_class_prefix = "GRA"; + +message ComplianceNote { + // The title that identifies this compliance check. + string title = 1; + // A description about this compliance check. + string description = 2; + // The OS and config versions the benchmark applies to. + repeated grafeas.v1.ComplianceVersion version = 3; + // A rationale for the existence of this compliance check. + string rationale = 4; + // A description of remediation steps if the compliance check fails. + string remediation = 5; + // A compliance check that is a CIS benchmark. + message CisBenchmark { + int32 profile_level = 1; + grafeas.v1.Severity severity = 2; + } + oneof compliance_type { + CisBenchmark cis_benchmark = 6; + } + // Serialized scan instructions with a predefined format. + bytes scan_instructions = 7; +} + +// Describes the CIS benchmark version that is applicable to a given OS and +// os version. +message ComplianceVersion { + // The CPE URI (https://cpe.mitre.org/specification/) this benchmark is + // applicable to. + string cpe_uri = 1; + // The version of the benchmark. This is set to the version of the OS-specific + // CIS document the benchmark is defined in. + string version = 2; +} + +// An indication that the compliance checks in the associated ComplianceNote +// were not satisfied for particular resources or a specified reason. +message ComplianceOccurrence { + repeated NonCompliantFile non_compliant_files = 2; + string non_compliance_reason = 3; +} + +// Details about files that caused a compliance check to fail. +message NonCompliantFile { + // display_command is a single command that can be used to display a list of + // non compliant files. When there is no such command, we can also iterate a + // list of non compliant file using 'path'. + + // Empty if `display_command` is set. + string path = 1; + // Command to display the non-compliant files. + string display_command = 2; + // Explains why a file is non compliant for a CIS check. + string reason = 3; +} diff --git a/packages/google-devtools-containeranalysis/protos/grafeas/v1/dsse_attestation.proto b/packages/google-devtools-containeranalysis/protos/grafeas/v1/dsse_attestation.proto new file mode 100644 index 00000000000..0264ab9911c --- /dev/null +++ b/packages/google-devtools-containeranalysis/protos/grafeas/v1/dsse_attestation.proto @@ -0,0 +1,52 @@ +// Copyright 2021 The Grafeas Authors. All rights reserved. +// +// 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. +syntax = "proto3"; + +package grafeas.v1; + +import "grafeas/v1/common.proto"; +import "grafeas/v1/intoto_statement.proto"; + +option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas"; +option java_multiple_files = true; +option java_package = "io.grafeas.v1"; +option objc_class_prefix = "GRA"; + +message DSSEAttestationNote { + // This submessage provides human-readable hints about the purpose of the + // authority. Because the name of a note acts as its resource reference, it is + // important to disambiguate the canonical name of the Note (which might be a + // UUID for security purposes) from "readable" names more suitable for debug + // output. Note that these hints should not be used to look up authorities in + // security sensitive contexts, such as when looking up attestations to + // verify. + message DSSEHint { + // Required. The human readable name of this attestation authority, for + // example "cloudbuild-prod". + string human_readable_name = 1; + } + // DSSEHint hints at the purpose of the attestation authority. + DSSEHint hint = 1; +} + +// Deprecated. Prefer to use a regular Occurrence, and populate the +// Envelope at the top level of the Occurrence. +message DSSEAttestationOccurrence { + // If doing something security critical, make sure to verify the signatures in + // this metadata. + Envelope envelope = 1; + oneof decoded_payload { + InTotoStatement statement = 2; + } +} \ No newline at end of file diff --git a/packages/google-devtools-containeranalysis/protos/grafeas/v1/grafeas.proto b/packages/google-devtools-containeranalysis/protos/grafeas/v1/grafeas.proto index 57b2fc23e5f..5665fe3623e 100644 --- a/packages/google-devtools-containeranalysis/protos/grafeas/v1/grafeas.proto +++ b/packages/google-devtools-containeranalysis/protos/grafeas/v1/grafeas.proto @@ -26,8 +26,10 @@ import "google/protobuf/timestamp.proto"; import "grafeas/v1/attestation.proto"; import "grafeas/v1/build.proto"; import "grafeas/v1/common.proto"; +import "grafeas/v1/compliance.proto"; import "grafeas/v1/deployment.proto"; import "grafeas/v1/discovery.proto"; +import "grafeas/v1/dsse_attestation.proto"; import "grafeas/v1/image.proto"; import "grafeas/v1/package.proto"; import "grafeas/v1/upgrade.proto"; @@ -242,7 +244,14 @@ message Occurrence { grafeas.v1.AttestationOccurrence attestation = 14; // Describes an available package upgrade on the linked resource. grafeas.v1.UpgradeOccurrence upgrade = 15; + // Describes a compliance violation on a linked resource. + grafeas.v1.ComplianceOccurrence compliance = 16; + // Describes an attestation of an artifact using dsse. + grafeas.v1.DSSEAttestationOccurrence dsse_attestation = 17; } + + // https://github.com/secure-systems-lab/dsse + grafeas.v1.Envelope envelope = 18; } // A type of analysis that can be done for a resource. @@ -301,6 +310,10 @@ message Note { grafeas.v1.AttestationNote attestation = 16; // A note describing available package upgrades. grafeas.v1.UpgradeNote upgrade = 17; + // A note describing a compliance check. + grafeas.v1.ComplianceNote compliance = 18; + // A note describing a dsse attestation note. + grafeas.v1.DSSEAttestationNote dsse_attestation = 19; } } diff --git a/packages/google-devtools-containeranalysis/protos/grafeas/v1/intoto_provenance.proto b/packages/google-devtools-containeranalysis/protos/grafeas/v1/intoto_provenance.proto new file mode 100644 index 00000000000..f2e6c3764e3 --- /dev/null +++ b/packages/google-devtools-containeranalysis/protos/grafeas/v1/intoto_provenance.proto @@ -0,0 +1,112 @@ +// Copyright 2021 The Grafeas Authors. All rights reserved. +// +// 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. + +syntax = "proto3"; + +package grafeas.v1; + +import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas"; +option java_multiple_files = true; +option java_package = "io.grafeas.v1"; +option objc_class_prefix = "GRA"; + +// Spec defined at +// https://github.com/in-toto/attestation/blob/main/spec/predicates/provenance.md + +// Steps taken to build the artifact. +// For a TaskRun, typically each container corresponds to one step in the +// recipe. +message Recipe { + // URI indicating what type of recipe was performed. It determines the meaning + // of recipe.entryPoint, recipe.arguments, recipe.environment, and materials. + string type = 1; + // Index in materials containing the recipe steps that are not implied by + // recipe.type. For example, if the recipe type were "make", then this would + // point to the source containing the Makefile, not the make program itself. + // Set to -1 if the recipe doesn't come from a material, as zero is default + // unset value for int64. + int64 defined_in_material = 2; + // String identifying the entry point into the build. + // This is often a path to a configuration file and/or a target label within + // that file. The syntax and meaning are defined by recipe.type. For example, + // if the recipe type were "make", then this would reference the directory in + // which to run make as well as which target to use. + string entry_point = 3; + // Collection of all external inputs that influenced the build on top of + // recipe.definedInMaterial and recipe.entryPoint. For example, if the recipe + // type were "make", then this might be the flags passed to make aside from + // the target, which is captured in recipe.entryPoint. Since the arguments + // field can greatly vary in structure, depending on the builder and recipe + // type, this is of form "Any". + repeated google.protobuf.Any arguments = 4; + // Any other builder-controlled inputs necessary for correctly evaluating the + // recipe. Usually only needed for reproducing the build but not evaluated as + // part of policy. Since the environment field can greatly vary in structure, + // depending on the builder and recipe type, this is of form "Any". + repeated google.protobuf.Any environment = 5; +} + +// Indicates that the builder claims certain fields in this message to be +// complete. +message Completeness { + // If true, the builder claims that recipe.arguments is complete, meaning that + // all external inputs are properly captured in the recipe. + bool arguments = 1; + // If true, the builder claims that recipe.environment is claimed to be + // complete. + bool environment = 2; + // If true, the builder claims that materials are complete, usually through + // some controls to prevent network access. Sometimes called "hermetic". + bool materials = 3; +} + +// Other properties of the build. +message Metadata { + // Identifies the particular build invocation, which can be useful for finding + // associated logs or other ad-hoc analysis. The value SHOULD be globally + // unique, per in-toto Provenance spec. + string build_invocation_id = 1; + // The timestamp of when the build started. + google.protobuf.Timestamp build_started_on = 2; + // The timestamp of when the build completed. + google.protobuf.Timestamp build_finished_on = 3; + // Indicates that the builder claims certain fields in this message to be + // complete. + Completeness completeness = 4; + // If true, the builder claims that running the recipe on materials will + // produce bit-for-bit identical output. + bool reproducible = 5; +} + +message BuilderConfig { + string id = 1; +} + +message InTotoProvenance { + BuilderConfig builder_config = 1; // required + // Identifies the configuration used for the build. + // When combined with materials, this SHOULD fully describe the build, + // such that re-running this recipe results in bit-for-bit identical output + // (if the build is reproducible). + Recipe recipe = 2; // required + Metadata metadata = 3; + // The collection of artifacts that influenced the build including sources, + // dependencies, build tools, base images, and so on. This is considered to be + // incomplete unless metadata.completeness.materials is true. Unset or null is + // equivalent to empty. + repeated string materials = 4; +} diff --git a/packages/google-devtools-containeranalysis/protos/grafeas/v1/intoto_statement.proto b/packages/google-devtools-containeranalysis/protos/grafeas/v1/intoto_statement.proto new file mode 100644 index 00000000000..4399627390c --- /dev/null +++ b/packages/google-devtools-containeranalysis/protos/grafeas/v1/intoto_statement.proto @@ -0,0 +1,49 @@ +// Copyright 2021 The Grafeas Authors. All rights reserved. +// +// 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. + +syntax = "proto3"; + +package grafeas.v1; + +import "grafeas/v1/intoto_provenance.proto"; +import "grafeas/v1/slsa_provenance.proto"; + +option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas"; +option java_multiple_files = true; +option java_package = "io.grafeas.v1"; +option objc_class_prefix = "GRA"; + +// Spec defined at +// https://github.com/in-toto/attestation/tree/main/spec#statement The +// serialized InTotoStatement will be stored as Envelope.payload. +// Envelope.payloadType is always "application/vnd.in-toto+json". +message InTotoStatement { + // Always `https://in-toto.io/Statement/v0.1`. + string type = 1 [json_name = "_type"]; + repeated Subject subject = 2; + // `https://slsa.dev/provenance/v0.1` for SlsaProvenance. + string predicate_type = 3; + oneof predicate { + InTotoProvenance provenance = 4; + SlsaProvenance slsa_provenance = 5; + } +} +message Subject { + string name = 1; + // `"": ""` + // Algorithms can be e.g. sha256, sha512 + // See + // https://github.com/in-toto/attestation/blob/main/spec/field_types.md#DigestSet + map digest = 2; +} diff --git a/packages/google-devtools-containeranalysis/protos/grafeas/v1/package.proto b/packages/google-devtools-containeranalysis/protos/grafeas/v1/package.proto index b04686d9fc3..078c88c7702 100644 --- a/packages/google-devtools-containeranalysis/protos/grafeas/v1/package.proto +++ b/packages/google-devtools-containeranalysis/protos/grafeas/v1/package.proto @@ -102,6 +102,14 @@ message Version { // The iteration of the package build from the above version. string revision = 3; + // Whether this version is specifying part of an inclusive range. Grafeas + // does not have the capability to specify version ranges; instead we have + // fields that specify start version and end versions. At times this is + // insufficient - we also need to specify whether the version is included in + // the range or is excluded from the range. This boolean is expected to be set + // to true when the version is included in a range. + bool inclusive = 6; + // Whether this is an ordinary package version or a sentinel MIN/MAX version. enum VersionKind { // Unknown. @@ -112,7 +120,7 @@ message Version { MINIMUM = 2; // A special version representing positive infinity. MAXIMUM = 3; - }; + } // Required. Distinguishes between sentinel MIN/MAX versions and normal // versions. diff --git a/packages/google-devtools-containeranalysis/protos/grafeas/v1/slsa_provenance.proto b/packages/google-devtools-containeranalysis/protos/grafeas/v1/slsa_provenance.proto new file mode 100644 index 00000000000..b585f0b7bcf --- /dev/null +++ b/packages/google-devtools-containeranalysis/protos/grafeas/v1/slsa_provenance.proto @@ -0,0 +1,114 @@ +// Copyright 2021 The Grafeas Authors. All rights reserved. +// +// 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. + +syntax = "proto3"; + +package grafeas.v1; + +import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/grafeas/v1;grafeas"; +option java_multiple_files = true; +option java_package = "io.grafeas.v1"; +option objc_class_prefix = "GRA"; + +message SlsaProvenance { + // Steps taken to build the artifact. + // For a TaskRun, typically each container corresponds to one step in the + // recipe. + message SlsaRecipe { + // URI indicating what type of recipe was performed. It determines the + // meaning of recipe.entryPoint, recipe.arguments, recipe.environment, and + // materials. + string type = 1; + // Index in materials containing the recipe steps that are not implied by + // recipe.type. For example, if the recipe type were "make", then this would + // point to the source containing the Makefile, not the make program itself. + // Set to -1 if the recipe doesn't come from a material, as zero is default + // unset value for int64. + int64 defined_in_material = 2; + // String identifying the entry point into the build. + // This is often a path to a configuration file and/or a target label within + // that file. The syntax and meaning are defined by recipe.type. For + // example, if the recipe type were "make", then this would reference the + // directory in which to run make as well as which target to use. + string entry_point = 3; + // Collection of all external inputs that influenced the build on top of + // recipe.definedInMaterial and recipe.entryPoint. For example, if the + // recipe type were "make", then this might be the flags passed to make + // aside from the target, which is captured in recipe.entryPoint. Depending + // on the recipe Type, the structure may be different. + google.protobuf.Any arguments = 4; + // Any other builder-controlled inputs necessary for correctly evaluating + // the recipe. Usually only needed for reproducing the build but not + // evaluated as part of policy. Depending on the recipe Type, the structure + // may be different. + google.protobuf.Any environment = 5; + } + + // Indicates that the builder claims certain fields in this message to be + // complete. + message SlsaCompleteness { + // If true, the builder claims that recipe.arguments is complete, meaning + // that all external inputs are properly captured in the recipe. + bool arguments = 1; + // If true, the builder claims that recipe.environment is claimed to be + // complete. + bool environment = 2; + // If true, the builder claims that materials are complete, usually through + // some controls to prevent network access. Sometimes called "hermetic". + bool materials = 3; + } + + // Other properties of the build. + message SlsaMetadata { + // Identifies the particular build invocation, which can be useful for + // finding associated logs or other ad-hoc analysis. The value SHOULD be + // globally unique, per in-toto Provenance spec. + string build_invocation_id = 1; + // The timestamp of when the build started. + google.protobuf.Timestamp build_started_on = 2; + // The timestamp of when the build completed. + google.protobuf.Timestamp build_finished_on = 3; + // Indicates that the builder claims certain fields in this message to be + // complete. + SlsaCompleteness completeness = 4; + // If true, the builder claims that running the recipe on materials will + // produce bit-for-bit identical output. + bool reproducible = 5; + } + + message SlsaBuilder { + string id = 1; + } + + message Material { + string uri = 1; + map digest = 2; + } + + SlsaBuilder builder = 1; // required + // Identifies the configuration used for the build. + // When combined with materials, this SHOULD fully describe the build, + // such that re-running this recipe results in bit-for-bit identical output + // (if the build is reproducible). + SlsaRecipe recipe = 2; // required + SlsaMetadata metadata = 3; + // The collection of artifacts that influenced the build including sources, + // dependencies, build tools, base images, and so on. This is considered to be + // incomplete unless metadata.completeness.materials is true. Unset or null is + // equivalent to empty. + repeated Material materials = 4; +} \ No newline at end of file diff --git a/packages/google-devtools-containeranalysis/protos/grafeas/v1/vulnerability.proto b/packages/google-devtools-containeranalysis/protos/grafeas/v1/vulnerability.proto index 6c94cdf0502..476d320292e 100644 --- a/packages/google-devtools-containeranalysis/protos/grafeas/v1/vulnerability.proto +++ b/packages/google-devtools-containeranalysis/protos/grafeas/v1/vulnerability.proto @@ -16,6 +16,7 @@ syntax = "proto3"; package grafeas.v1; +import "google/api/field_behavior.proto"; import "google/protobuf/timestamp.proto"; import "grafeas/v1/common.proto"; import "grafeas/v1/cvss.proto"; @@ -115,6 +116,12 @@ message VulnerabilityNote { // upstream timestamp from the underlying information source - e.g. Ubuntu // security tracker. google.protobuf.Timestamp source_update_time = 12; + + // The source from which the information in this Detail was obtained. + string source = 13; + + // The name of the vendor of the product. + string vendor = 14; } // The full description of the CVSSv3 for this vulnerability. @@ -172,6 +179,18 @@ message VulnerabilityOccurrence { // severity. float cvss_score = 3; + // The CVSS v3 score for this vulnerability. + message CVSSV3 { + // The base score for for this vulnerability according to cvss v3. + float base_score = 1; + // The severity rating assigned to this vulnerability by vulnerability + // provider. + Severity severity = 2; + } + + // The cvss v3 score for the vulnerability. + CVSSV3 cvssv3 = 10; + // Required. The set of affected locations and their fixes (if available) // within the associated resource. repeated PackageIssue package_issue = 4; @@ -205,6 +224,14 @@ message VulnerabilityOccurrence { // Output only. Whether a fix is available for this package. bool fix_available = 7; + + // The type of package (e.g. OS, MAVEN, GO). + string package_type = 8; + + // The distro or language system assigned severity for this vulnerability + // when that is available and note provider assigned severity when it is not + // available. + Severity effective_severity = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Output only. A one sentence description of this vulnerability. @@ -218,6 +245,14 @@ message VulnerabilityOccurrence { // The distro assigned severity for this vulnerability when it is available, // otherwise this is the note provider assigned severity. + // + // When there are multiple PackageIssues for this vulnerability, they can have + // different effective severities because some might be provided by the distro + // while others are provided by the language ecosystem for a language pack. + // For this reason, it is advised to use the effective severity on the + // PackageIssue level. In the case where multiple PackageIssues have differing + // effective severities, this field should be the highest severity for any of + // the PackageIssues. Severity effective_severity = 8; // Output only. Whether at least one of the affected packages has a fix diff --git a/packages/google-devtools-containeranalysis/protos/protos.d.ts b/packages/google-devtools-containeranalysis/protos/protos.d.ts index 819be06cb91..7b7e6fdfadc 100644 --- a/packages/google-devtools-containeranalysis/protos/protos.d.ts +++ b/packages/google-devtools-containeranalysis/protos/protos.d.ts @@ -190,6 +190,12 @@ export namespace grafeas { /** Detail sourceUpdateTime */ sourceUpdateTime?: (google.protobuf.ITimestamp|null); + + /** Detail source */ + source?: (string|null); + + /** Detail vendor */ + vendor?: (string|null); } /** Represents a Detail. */ @@ -237,6 +243,12 @@ export namespace grafeas { /** Detail sourceUpdateTime. */ public sourceUpdateTime?: (google.protobuf.ITimestamp|null); + /** Detail source. */ + public source: string; + + /** Detail vendor. */ + public vendor: string; + /** * Creates a new Detail instance using the specified properties. * @param [properties] Properties to set @@ -528,6 +540,9 @@ export namespace grafeas { /** VulnerabilityOccurrence cvssScore */ cvssScore?: (number|null); + /** VulnerabilityOccurrence cvssv3 */ + cvssv3?: (grafeas.v1.VulnerabilityOccurrence.ICVSSV3|null); + /** VulnerabilityOccurrence packageIssue */ packageIssue?: (grafeas.v1.VulnerabilityOccurrence.IPackageIssue[]|null); @@ -565,6 +580,9 @@ export namespace grafeas { /** VulnerabilityOccurrence cvssScore. */ public cvssScore: number; + /** VulnerabilityOccurrence cvssv3. */ + public cvssv3?: (grafeas.v1.VulnerabilityOccurrence.ICVSSV3|null); + /** VulnerabilityOccurrence packageIssue. */ public packageIssue: grafeas.v1.VulnerabilityOccurrence.IPackageIssue[]; @@ -656,6 +674,102 @@ export namespace grafeas { namespace VulnerabilityOccurrence { + /** Properties of a CVSSV3. */ + interface ICVSSV3 { + + /** CVSSV3 baseScore */ + baseScore?: (number|null); + + /** CVSSV3 severity */ + severity?: (grafeas.v1.Severity|keyof typeof grafeas.v1.Severity|null); + } + + /** Represents a CVSSV3. */ + class CVSSV3 implements ICVSSV3 { + + /** + * Constructs a new CVSSV3. + * @param [properties] Properties to set + */ + constructor(properties?: grafeas.v1.VulnerabilityOccurrence.ICVSSV3); + + /** CVSSV3 baseScore. */ + public baseScore: number; + + /** CVSSV3 severity. */ + public severity: (grafeas.v1.Severity|keyof typeof grafeas.v1.Severity); + + /** + * Creates a new CVSSV3 instance using the specified properties. + * @param [properties] Properties to set + * @returns CVSSV3 instance + */ + public static create(properties?: grafeas.v1.VulnerabilityOccurrence.ICVSSV3): grafeas.v1.VulnerabilityOccurrence.CVSSV3; + + /** + * Encodes the specified CVSSV3 message. Does not implicitly {@link grafeas.v1.VulnerabilityOccurrence.CVSSV3.verify|verify} messages. + * @param message CVSSV3 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: grafeas.v1.VulnerabilityOccurrence.ICVSSV3, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CVSSV3 message, length delimited. Does not implicitly {@link grafeas.v1.VulnerabilityOccurrence.CVSSV3.verify|verify} messages. + * @param message CVSSV3 message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: grafeas.v1.VulnerabilityOccurrence.ICVSSV3, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CVSSV3 message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CVSSV3 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.VulnerabilityOccurrence.CVSSV3; + + /** + * Decodes a CVSSV3 message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CVSSV3 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.VulnerabilityOccurrence.CVSSV3; + + /** + * Verifies a CVSSV3 message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CVSSV3 message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CVSSV3 + */ + public static fromObject(object: { [k: string]: any }): grafeas.v1.VulnerabilityOccurrence.CVSSV3; + + /** + * Creates a plain object from a CVSSV3 message. Also converts values to other types if specified. + * @param message CVSSV3 + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: grafeas.v1.VulnerabilityOccurrence.CVSSV3, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CVSSV3 to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a PackageIssue. */ interface IPackageIssue { @@ -679,6 +793,12 @@ export namespace grafeas { /** PackageIssue fixAvailable */ fixAvailable?: (boolean|null); + + /** PackageIssue packageType */ + packageType?: (string|null); + + /** PackageIssue effectiveSeverity */ + effectiveSeverity?: (grafeas.v1.Severity|keyof typeof grafeas.v1.Severity|null); } /** Represents a PackageIssue. */ @@ -711,6 +831,12 @@ export namespace grafeas { /** PackageIssue fixAvailable. */ public fixAvailable: boolean; + /** PackageIssue packageType. */ + public packageType: string; + + /** PackageIssue effectiveSeverity. */ + public effectiveSeverity: (grafeas.v1.Severity|keyof typeof grafeas.v1.Severity); + /** * Creates a new PackageIssue instance using the specified properties. * @param [properties] Properties to set @@ -793,7 +919,9 @@ export namespace grafeas { DEPLOYMENT = 5, DISCOVERY = 6, ATTESTATION = 7, - UPGRADE = 8 + UPGRADE = 8, + COMPLIANCE = 9, + DSSE_ATTESTATION = 10 } /** Properties of a RelatedUrl. */ @@ -988,6 +1116,204 @@ export namespace grafeas { public toJSON(): { [k: string]: any }; } + /** Properties of an Envelope. */ + interface IEnvelope { + + /** Envelope payload */ + payload?: (Uint8Array|string|null); + + /** Envelope payloadType */ + payloadType?: (string|null); + + /** Envelope signatures */ + signatures?: (grafeas.v1.IEnvelopeSignature[]|null); + } + + /** Represents an Envelope. */ + class Envelope implements IEnvelope { + + /** + * Constructs a new Envelope. + * @param [properties] Properties to set + */ + constructor(properties?: grafeas.v1.IEnvelope); + + /** Envelope payload. */ + public payload: (Uint8Array|string); + + /** Envelope payloadType. */ + public payloadType: string; + + /** Envelope signatures. */ + public signatures: grafeas.v1.IEnvelopeSignature[]; + + /** + * Creates a new Envelope instance using the specified properties. + * @param [properties] Properties to set + * @returns Envelope instance + */ + public static create(properties?: grafeas.v1.IEnvelope): grafeas.v1.Envelope; + + /** + * Encodes the specified Envelope message. Does not implicitly {@link grafeas.v1.Envelope.verify|verify} messages. + * @param message Envelope message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: grafeas.v1.IEnvelope, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Envelope message, length delimited. Does not implicitly {@link grafeas.v1.Envelope.verify|verify} messages. + * @param message Envelope message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: grafeas.v1.IEnvelope, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Envelope message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Envelope + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.Envelope; + + /** + * Decodes an Envelope message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Envelope + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.Envelope; + + /** + * Verifies an Envelope message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Envelope message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Envelope + */ + public static fromObject(object: { [k: string]: any }): grafeas.v1.Envelope; + + /** + * Creates a plain object from an Envelope message. Also converts values to other types if specified. + * @param message Envelope + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: grafeas.v1.Envelope, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Envelope to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnvelopeSignature. */ + interface IEnvelopeSignature { + + /** EnvelopeSignature sig */ + sig?: (Uint8Array|string|null); + + /** EnvelopeSignature keyid */ + keyid?: (string|null); + } + + /** Represents an EnvelopeSignature. */ + class EnvelopeSignature implements IEnvelopeSignature { + + /** + * Constructs a new EnvelopeSignature. + * @param [properties] Properties to set + */ + constructor(properties?: grafeas.v1.IEnvelopeSignature); + + /** EnvelopeSignature sig. */ + public sig: (Uint8Array|string); + + /** EnvelopeSignature keyid. */ + public keyid: string; + + /** + * Creates a new EnvelopeSignature instance using the specified properties. + * @param [properties] Properties to set + * @returns EnvelopeSignature instance + */ + public static create(properties?: grafeas.v1.IEnvelopeSignature): grafeas.v1.EnvelopeSignature; + + /** + * Encodes the specified EnvelopeSignature message. Does not implicitly {@link grafeas.v1.EnvelopeSignature.verify|verify} messages. + * @param message EnvelopeSignature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: grafeas.v1.IEnvelopeSignature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnvelopeSignature message, length delimited. Does not implicitly {@link grafeas.v1.EnvelopeSignature.verify|verify} messages. + * @param message EnvelopeSignature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: grafeas.v1.IEnvelopeSignature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnvelopeSignature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnvelopeSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.EnvelopeSignature; + + /** + * Decodes an EnvelopeSignature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnvelopeSignature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.EnvelopeSignature; + + /** + * Verifies an EnvelopeSignature message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnvelopeSignature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnvelopeSignature + */ + public static fromObject(object: { [k: string]: any }): grafeas.v1.EnvelopeSignature; + + /** + * Creates a plain object from an EnvelopeSignature message. Also converts values to other types if specified. + * @param message EnvelopeSignature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: grafeas.v1.EnvelopeSignature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnvelopeSignature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of a CVSSv3. */ interface ICVSSv3 { @@ -1620,6 +1946,9 @@ export namespace grafeas { /** Version revision */ revision?: (string|null); + /** Version inclusive */ + inclusive?: (boolean|null); + /** Version kind */ kind?: (grafeas.v1.Version.VersionKind|keyof typeof grafeas.v1.Version.VersionKind|null); @@ -1645,6 +1974,9 @@ export namespace grafeas { /** Version revision. */ public revision: string; + /** Version inclusive. */ + public inclusive: boolean; + /** Version kind. */ public kind: (grafeas.v1.Version.VersionKind|keyof typeof grafeas.v1.Version.VersionKind); @@ -1916,6 +2248,96 @@ export namespace grafeas { } } + /** Properties of a Jwt. */ + interface IJwt { + + /** Jwt compactJwt */ + compactJwt?: (string|null); + } + + /** Represents a Jwt. */ + class Jwt implements IJwt { + + /** + * Constructs a new Jwt. + * @param [properties] Properties to set + */ + constructor(properties?: grafeas.v1.IJwt); + + /** Jwt compactJwt. */ + public compactJwt: string; + + /** + * Creates a new Jwt instance using the specified properties. + * @param [properties] Properties to set + * @returns Jwt instance + */ + public static create(properties?: grafeas.v1.IJwt): grafeas.v1.Jwt; + + /** + * Encodes the specified Jwt message. Does not implicitly {@link grafeas.v1.Jwt.verify|verify} messages. + * @param message Jwt message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: grafeas.v1.IJwt, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Jwt message, length delimited. Does not implicitly {@link grafeas.v1.Jwt.verify|verify} messages. + * @param message Jwt message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: grafeas.v1.IJwt, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Jwt message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Jwt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.Jwt; + + /** + * Decodes a Jwt message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Jwt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.Jwt; + + /** + * Verifies a Jwt message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Jwt message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Jwt + */ + public static fromObject(object: { [k: string]: any }): grafeas.v1.Jwt; + + /** + * Creates a plain object from a Jwt message. Also converts values to other types if specified. + * @param message Jwt + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: grafeas.v1.Jwt, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Jwt to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Properties of an AttestationOccurrence. */ interface IAttestationOccurrence { @@ -1924,6 +2346,9 @@ export namespace grafeas { /** AttestationOccurrence signatures */ signatures?: (grafeas.v1.ISignature[]|null); + + /** AttestationOccurrence jwts */ + jwts?: (grafeas.v1.IJwt[]|null); } /** Represents an AttestationOccurrence. */ @@ -1941,6 +2366,9 @@ export namespace grafeas { /** AttestationOccurrence signatures. */ public signatures: grafeas.v1.ISignature[]; + /** AttestationOccurrence jwts. */ + public jwts: grafeas.v1.IJwt[]; + /** * Creates a new AttestationOccurrence instance using the specified properties. * @param [properties] Properties to set @@ -2110,6 +2538,12 @@ export namespace grafeas { /** BuildOccurrence provenanceBytes */ provenanceBytes?: (string|null); + + /** BuildOccurrence intotoProvenance */ + intotoProvenance?: (grafeas.v1.IInTotoProvenance|null); + + /** BuildOccurrence intotoStatement */ + intotoStatement?: (grafeas.v1.IInTotoStatement|null); } /** Represents a BuildOccurrence. */ @@ -2127,6 +2561,12 @@ export namespace grafeas { /** BuildOccurrence provenanceBytes. */ public provenanceBytes: string; + /** BuildOccurrence intotoProvenance. */ + public intotoProvenance?: (grafeas.v1.IInTotoProvenance|null); + + /** BuildOccurrence intotoStatement. */ + public intotoStatement?: (grafeas.v1.IInTotoStatement|null); + /** * Creates a new BuildOccurrence instance using the specified properties. * @param [properties] Properties to set @@ -2198,1404 +2638,3294 @@ export namespace grafeas { public toJSON(): { [k: string]: any }; } - /** Properties of a BuildProvenance. */ - interface IBuildProvenance { - - /** BuildProvenance id */ - id?: (string|null); - - /** BuildProvenance projectId */ - projectId?: (string|null); - - /** BuildProvenance commands */ - commands?: (grafeas.v1.ICommand[]|null); - - /** BuildProvenance builtArtifacts */ - builtArtifacts?: (grafeas.v1.IArtifact[]|null); - - /** BuildProvenance createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** BuildProvenance startTime */ - startTime?: (google.protobuf.ITimestamp|null); - - /** BuildProvenance endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** BuildProvenance creator */ - creator?: (string|null); + /** Properties of a Recipe. */ + interface IRecipe { - /** BuildProvenance logsUri */ - logsUri?: (string|null); + /** Recipe type */ + type?: (string|null); - /** BuildProvenance sourceProvenance */ - sourceProvenance?: (grafeas.v1.ISource|null); + /** Recipe definedInMaterial */ + definedInMaterial?: (number|Long|string|null); - /** BuildProvenance triggerId */ - triggerId?: (string|null); + /** Recipe entryPoint */ + entryPoint?: (string|null); - /** BuildProvenance buildOptions */ - buildOptions?: ({ [k: string]: string }|null); + /** Recipe arguments */ + "arguments"?: (google.protobuf.IAny[]|null); - /** BuildProvenance builderVersion */ - builderVersion?: (string|null); + /** Recipe environment */ + environment?: (google.protobuf.IAny[]|null); } - /** Represents a BuildProvenance. */ - class BuildProvenance implements IBuildProvenance { + /** Represents a Recipe. */ + class Recipe implements IRecipe { /** - * Constructs a new BuildProvenance. + * Constructs a new Recipe. * @param [properties] Properties to set */ - constructor(properties?: grafeas.v1.IBuildProvenance); - - /** BuildProvenance id. */ - public id: string; - - /** BuildProvenance projectId. */ - public projectId: string; - - /** BuildProvenance commands. */ - public commands: grafeas.v1.ICommand[]; - - /** BuildProvenance builtArtifacts. */ - public builtArtifacts: grafeas.v1.IArtifact[]; - - /** BuildProvenance createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** BuildProvenance startTime. */ - public startTime?: (google.protobuf.ITimestamp|null); - - /** BuildProvenance endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); + constructor(properties?: grafeas.v1.IRecipe); - /** BuildProvenance creator. */ - public creator: string; - - /** BuildProvenance logsUri. */ - public logsUri: string; + /** Recipe type. */ + public type: string; - /** BuildProvenance sourceProvenance. */ - public sourceProvenance?: (grafeas.v1.ISource|null); + /** Recipe definedInMaterial. */ + public definedInMaterial: (number|Long|string); - /** BuildProvenance triggerId. */ - public triggerId: string; + /** Recipe entryPoint. */ + public entryPoint: string; - /** BuildProvenance buildOptions. */ - public buildOptions: { [k: string]: string }; + /** Recipe arguments. */ + public arguments: google.protobuf.IAny[]; - /** BuildProvenance builderVersion. */ - public builderVersion: string; + /** Recipe environment. */ + public environment: google.protobuf.IAny[]; /** - * Creates a new BuildProvenance instance using the specified properties. + * Creates a new Recipe instance using the specified properties. * @param [properties] Properties to set - * @returns BuildProvenance instance + * @returns Recipe instance */ - public static create(properties?: grafeas.v1.IBuildProvenance): grafeas.v1.BuildProvenance; + public static create(properties?: grafeas.v1.IRecipe): grafeas.v1.Recipe; /** - * Encodes the specified BuildProvenance message. Does not implicitly {@link grafeas.v1.BuildProvenance.verify|verify} messages. - * @param message BuildProvenance message or plain object to encode + * Encodes the specified Recipe message. Does not implicitly {@link grafeas.v1.Recipe.verify|verify} messages. + * @param message Recipe message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: grafeas.v1.IBuildProvenance, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: grafeas.v1.IRecipe, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BuildProvenance message, length delimited. Does not implicitly {@link grafeas.v1.BuildProvenance.verify|verify} messages. - * @param message BuildProvenance message or plain object to encode + * Encodes the specified Recipe message, length delimited. Does not implicitly {@link grafeas.v1.Recipe.verify|verify} messages. + * @param message Recipe message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: grafeas.v1.IBuildProvenance, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: grafeas.v1.IRecipe, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BuildProvenance message from the specified reader or buffer. + * Decodes a Recipe message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BuildProvenance + * @returns Recipe * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.BuildProvenance; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.Recipe; /** - * Decodes a BuildProvenance message from the specified reader or buffer, length delimited. + * Decodes a Recipe message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BuildProvenance + * @returns Recipe * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.BuildProvenance; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.Recipe; /** - * Verifies a BuildProvenance message. + * Verifies a Recipe message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BuildProvenance message from a plain object. Also converts values to their respective internal types. + * Creates a Recipe message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BuildProvenance + * @returns Recipe */ - public static fromObject(object: { [k: string]: any }): grafeas.v1.BuildProvenance; + public static fromObject(object: { [k: string]: any }): grafeas.v1.Recipe; /** - * Creates a plain object from a BuildProvenance message. Also converts values to other types if specified. - * @param message BuildProvenance + * Creates a plain object from a Recipe message. Also converts values to other types if specified. + * @param message Recipe * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: grafeas.v1.BuildProvenance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: grafeas.v1.Recipe, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BuildProvenance to JSON. + * Converts this Recipe to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Source. */ - interface ISource { - - /** Source artifactStorageSourceUri */ - artifactStorageSourceUri?: (string|null); + /** Properties of a Completeness. */ + interface ICompleteness { - /** Source fileHashes */ - fileHashes?: ({ [k: string]: grafeas.v1.IFileHashes }|null); + /** Completeness arguments */ + "arguments"?: (boolean|null); - /** Source context */ - context?: (grafeas.v1.ISourceContext|null); + /** Completeness environment */ + environment?: (boolean|null); - /** Source additionalContexts */ - additionalContexts?: (grafeas.v1.ISourceContext[]|null); + /** Completeness materials */ + materials?: (boolean|null); } - /** Represents a Source. */ - class Source implements ISource { + /** Represents a Completeness. */ + class Completeness implements ICompleteness { /** - * Constructs a new Source. + * Constructs a new Completeness. * @param [properties] Properties to set */ - constructor(properties?: grafeas.v1.ISource); + constructor(properties?: grafeas.v1.ICompleteness); - /** Source artifactStorageSourceUri. */ - public artifactStorageSourceUri: string; - - /** Source fileHashes. */ - public fileHashes: { [k: string]: grafeas.v1.IFileHashes }; + /** Completeness arguments. */ + public arguments: boolean; - /** Source context. */ - public context?: (grafeas.v1.ISourceContext|null); + /** Completeness environment. */ + public environment: boolean; - /** Source additionalContexts. */ - public additionalContexts: grafeas.v1.ISourceContext[]; + /** Completeness materials. */ + public materials: boolean; /** - * Creates a new Source instance using the specified properties. + * Creates a new Completeness instance using the specified properties. * @param [properties] Properties to set - * @returns Source instance + * @returns Completeness instance */ - public static create(properties?: grafeas.v1.ISource): grafeas.v1.Source; + public static create(properties?: grafeas.v1.ICompleteness): grafeas.v1.Completeness; /** - * Encodes the specified Source message. Does not implicitly {@link grafeas.v1.Source.verify|verify} messages. - * @param message Source message or plain object to encode + * Encodes the specified Completeness message. Does not implicitly {@link grafeas.v1.Completeness.verify|verify} messages. + * @param message Completeness message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: grafeas.v1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: grafeas.v1.ICompleteness, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Source message, length delimited. Does not implicitly {@link grafeas.v1.Source.verify|verify} messages. - * @param message Source message or plain object to encode + * Encodes the specified Completeness message, length delimited. Does not implicitly {@link grafeas.v1.Completeness.verify|verify} messages. + * @param message Completeness message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: grafeas.v1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: grafeas.v1.ICompleteness, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Source message from the specified reader or buffer. + * Decodes a Completeness message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Source + * @returns Completeness * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.Source; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.Completeness; /** - * Decodes a Source message from the specified reader or buffer, length delimited. + * Decodes a Completeness message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Source + * @returns Completeness * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.Source; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.Completeness; /** - * Verifies a Source message. + * Verifies a Completeness message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Source message from a plain object. Also converts values to their respective internal types. + * Creates a Completeness message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Source + * @returns Completeness */ - public static fromObject(object: { [k: string]: any }): grafeas.v1.Source; + public static fromObject(object: { [k: string]: any }): grafeas.v1.Completeness; /** - * Creates a plain object from a Source message. Also converts values to other types if specified. - * @param message Source + * Creates a plain object from a Completeness message. Also converts values to other types if specified. + * @param message Completeness * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: grafeas.v1.Source, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: grafeas.v1.Completeness, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Source to JSON. + * Converts this Completeness to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a FileHashes. */ - interface IFileHashes { + /** Properties of a Metadata. */ + interface IMetadata { - /** FileHashes fileHash */ - fileHash?: (grafeas.v1.IHash[]|null); + /** Metadata buildInvocationId */ + buildInvocationId?: (string|null); + + /** Metadata buildStartedOn */ + buildStartedOn?: (google.protobuf.ITimestamp|null); + + /** Metadata buildFinishedOn */ + buildFinishedOn?: (google.protobuf.ITimestamp|null); + + /** Metadata completeness */ + completeness?: (grafeas.v1.ICompleteness|null); + + /** Metadata reproducible */ + reproducible?: (boolean|null); } - /** Represents a FileHashes. */ - class FileHashes implements IFileHashes { + /** Represents a Metadata. */ + class Metadata implements IMetadata { /** - * Constructs a new FileHashes. + * Constructs a new Metadata. * @param [properties] Properties to set */ - constructor(properties?: grafeas.v1.IFileHashes); + constructor(properties?: grafeas.v1.IMetadata); - /** FileHashes fileHash. */ - public fileHash: grafeas.v1.IHash[]; + /** Metadata buildInvocationId. */ + public buildInvocationId: string; + + /** Metadata buildStartedOn. */ + public buildStartedOn?: (google.protobuf.ITimestamp|null); + + /** Metadata buildFinishedOn. */ + public buildFinishedOn?: (google.protobuf.ITimestamp|null); + + /** Metadata completeness. */ + public completeness?: (grafeas.v1.ICompleteness|null); + + /** Metadata reproducible. */ + public reproducible: boolean; /** - * Creates a new FileHashes instance using the specified properties. + * Creates a new Metadata instance using the specified properties. * @param [properties] Properties to set - * @returns FileHashes instance + * @returns Metadata instance */ - public static create(properties?: grafeas.v1.IFileHashes): grafeas.v1.FileHashes; + public static create(properties?: grafeas.v1.IMetadata): grafeas.v1.Metadata; /** - * Encodes the specified FileHashes message. Does not implicitly {@link grafeas.v1.FileHashes.verify|verify} messages. - * @param message FileHashes message or plain object to encode + * Encodes the specified Metadata message. Does not implicitly {@link grafeas.v1.Metadata.verify|verify} messages. + * @param message Metadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: grafeas.v1.IFileHashes, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: grafeas.v1.IMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified FileHashes message, length delimited. Does not implicitly {@link grafeas.v1.FileHashes.verify|verify} messages. - * @param message FileHashes message or plain object to encode + * Encodes the specified Metadata message, length delimited. Does not implicitly {@link grafeas.v1.Metadata.verify|verify} messages. + * @param message Metadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: grafeas.v1.IFileHashes, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: grafeas.v1.IMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FileHashes message from the specified reader or buffer. + * Decodes a Metadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns FileHashes + * @returns Metadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.FileHashes; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.Metadata; /** - * Decodes a FileHashes message from the specified reader or buffer, length delimited. + * Decodes a Metadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FileHashes + * @returns Metadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.FileHashes; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.Metadata; /** - * Verifies a FileHashes message. + * Verifies a Metadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a FileHashes message from a plain object. Also converts values to their respective internal types. + * Creates a Metadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FileHashes + * @returns Metadata */ - public static fromObject(object: { [k: string]: any }): grafeas.v1.FileHashes; + public static fromObject(object: { [k: string]: any }): grafeas.v1.Metadata; /** - * Creates a plain object from a FileHashes message. Also converts values to other types if specified. - * @param message FileHashes + * Creates a plain object from a Metadata message. Also converts values to other types if specified. + * @param message Metadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: grafeas.v1.FileHashes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: grafeas.v1.Metadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FileHashes to JSON. + * Converts this Metadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Hash. */ - interface IHash { - - /** Hash type */ - type?: (string|null); + /** Properties of a BuilderConfig. */ + interface IBuilderConfig { - /** Hash value */ - value?: (Uint8Array|string|null); + /** BuilderConfig id */ + id?: (string|null); } - /** Represents a Hash. */ - class Hash implements IHash { + /** Represents a BuilderConfig. */ + class BuilderConfig implements IBuilderConfig { /** - * Constructs a new Hash. + * Constructs a new BuilderConfig. * @param [properties] Properties to set */ - constructor(properties?: grafeas.v1.IHash); - - /** Hash type. */ - public type: string; + constructor(properties?: grafeas.v1.IBuilderConfig); - /** Hash value. */ - public value: (Uint8Array|string); + /** BuilderConfig id. */ + public id: string; /** - * Creates a new Hash instance using the specified properties. + * Creates a new BuilderConfig instance using the specified properties. * @param [properties] Properties to set - * @returns Hash instance + * @returns BuilderConfig instance */ - public static create(properties?: grafeas.v1.IHash): grafeas.v1.Hash; + public static create(properties?: grafeas.v1.IBuilderConfig): grafeas.v1.BuilderConfig; /** - * Encodes the specified Hash message. Does not implicitly {@link grafeas.v1.Hash.verify|verify} messages. - * @param message Hash message or plain object to encode + * Encodes the specified BuilderConfig message. Does not implicitly {@link grafeas.v1.BuilderConfig.verify|verify} messages. + * @param message BuilderConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: grafeas.v1.IHash, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: grafeas.v1.IBuilderConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Hash message, length delimited. Does not implicitly {@link grafeas.v1.Hash.verify|verify} messages. - * @param message Hash message or plain object to encode + * Encodes the specified BuilderConfig message, length delimited. Does not implicitly {@link grafeas.v1.BuilderConfig.verify|verify} messages. + * @param message BuilderConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: grafeas.v1.IHash, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: grafeas.v1.IBuilderConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Hash message from the specified reader or buffer. + * Decodes a BuilderConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Hash + * @returns BuilderConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.Hash; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.BuilderConfig; /** - * Decodes a Hash message from the specified reader or buffer, length delimited. + * Decodes a BuilderConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Hash + * @returns BuilderConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.Hash; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.BuilderConfig; /** - * Verifies a Hash message. + * Verifies a BuilderConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Hash message from a plain object. Also converts values to their respective internal types. + * Creates a BuilderConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Hash + * @returns BuilderConfig */ - public static fromObject(object: { [k: string]: any }): grafeas.v1.Hash; + public static fromObject(object: { [k: string]: any }): grafeas.v1.BuilderConfig; /** - * Creates a plain object from a Hash message. Also converts values to other types if specified. - * @param message Hash + * Creates a plain object from a BuilderConfig message. Also converts values to other types if specified. + * @param message BuilderConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: grafeas.v1.Hash, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: grafeas.v1.BuilderConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Hash to JSON. + * Converts this BuilderConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Command. */ - interface ICommand { - - /** Command name */ - name?: (string|null); - - /** Command env */ - env?: (string[]|null); + /** Properties of an InTotoProvenance. */ + interface IInTotoProvenance { - /** Command args */ - args?: (string[]|null); + /** InTotoProvenance builderConfig */ + builderConfig?: (grafeas.v1.IBuilderConfig|null); - /** Command dir */ - dir?: (string|null); + /** InTotoProvenance recipe */ + recipe?: (grafeas.v1.IRecipe|null); - /** Command id */ - id?: (string|null); + /** InTotoProvenance metadata */ + metadata?: (grafeas.v1.IMetadata|null); - /** Command waitFor */ - waitFor?: (string[]|null); + /** InTotoProvenance materials */ + materials?: (string[]|null); } - /** Represents a Command. */ - class Command implements ICommand { + /** Represents an InTotoProvenance. */ + class InTotoProvenance implements IInTotoProvenance { /** - * Constructs a new Command. + * Constructs a new InTotoProvenance. * @param [properties] Properties to set */ - constructor(properties?: grafeas.v1.ICommand); + constructor(properties?: grafeas.v1.IInTotoProvenance); - /** Command name. */ - public name: string; + /** InTotoProvenance builderConfig. */ + public builderConfig?: (grafeas.v1.IBuilderConfig|null); - /** Command env. */ - public env: string[]; + /** InTotoProvenance recipe. */ + public recipe?: (grafeas.v1.IRecipe|null); - /** Command args. */ - public args: string[]; + /** InTotoProvenance metadata. */ + public metadata?: (grafeas.v1.IMetadata|null); - /** Command dir. */ - public dir: string; - - /** Command id. */ - public id: string; - - /** Command waitFor. */ - public waitFor: string[]; + /** InTotoProvenance materials. */ + public materials: string[]; /** - * Creates a new Command instance using the specified properties. + * Creates a new InTotoProvenance instance using the specified properties. * @param [properties] Properties to set - * @returns Command instance + * @returns InTotoProvenance instance */ - public static create(properties?: grafeas.v1.ICommand): grafeas.v1.Command; + public static create(properties?: grafeas.v1.IInTotoProvenance): grafeas.v1.InTotoProvenance; /** - * Encodes the specified Command message. Does not implicitly {@link grafeas.v1.Command.verify|verify} messages. - * @param message Command message or plain object to encode + * Encodes the specified InTotoProvenance message. Does not implicitly {@link grafeas.v1.InTotoProvenance.verify|verify} messages. + * @param message InTotoProvenance message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: grafeas.v1.ICommand, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: grafeas.v1.IInTotoProvenance, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Command message, length delimited. Does not implicitly {@link grafeas.v1.Command.verify|verify} messages. - * @param message Command message or plain object to encode + * Encodes the specified InTotoProvenance message, length delimited. Does not implicitly {@link grafeas.v1.InTotoProvenance.verify|verify} messages. + * @param message InTotoProvenance message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: grafeas.v1.ICommand, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: grafeas.v1.IInTotoProvenance, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Command message from the specified reader or buffer. + * Decodes an InTotoProvenance message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Command + * @returns InTotoProvenance * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.Command; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.InTotoProvenance; /** - * Decodes a Command message from the specified reader or buffer, length delimited. + * Decodes an InTotoProvenance message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Command + * @returns InTotoProvenance * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.Command; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.InTotoProvenance; /** - * Verifies a Command message. + * Verifies an InTotoProvenance message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Command message from a plain object. Also converts values to their respective internal types. + * Creates an InTotoProvenance message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Command + * @returns InTotoProvenance */ - public static fromObject(object: { [k: string]: any }): grafeas.v1.Command; + public static fromObject(object: { [k: string]: any }): grafeas.v1.InTotoProvenance; /** - * Creates a plain object from a Command message. Also converts values to other types if specified. - * @param message Command + * Creates a plain object from an InTotoProvenance message. Also converts values to other types if specified. + * @param message InTotoProvenance * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: grafeas.v1.Command, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: grafeas.v1.InTotoProvenance, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Command to JSON. + * Converts this InTotoProvenance to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an Artifact. */ - interface IArtifact { + /** Properties of an InTotoStatement. */ + interface IInTotoStatement { - /** Artifact checksum */ - checksum?: (string|null); + /** InTotoStatement type */ + type?: (string|null); - /** Artifact id */ - id?: (string|null); + /** InTotoStatement subject */ + subject?: (grafeas.v1.ISubject[]|null); - /** Artifact names */ - names?: (string[]|null); + /** InTotoStatement predicateType */ + predicateType?: (string|null); + + /** InTotoStatement provenance */ + provenance?: (grafeas.v1.IInTotoProvenance|null); + + /** InTotoStatement slsaProvenance */ + slsaProvenance?: (grafeas.v1.ISlsaProvenance|null); } - /** Represents an Artifact. */ - class Artifact implements IArtifact { + /** Represents an InTotoStatement. */ + class InTotoStatement implements IInTotoStatement { /** - * Constructs a new Artifact. + * Constructs a new InTotoStatement. * @param [properties] Properties to set */ - constructor(properties?: grafeas.v1.IArtifact); + constructor(properties?: grafeas.v1.IInTotoStatement); - /** Artifact checksum. */ - public checksum: string; + /** InTotoStatement type. */ + public type: string; - /** Artifact id. */ - public id: string; + /** InTotoStatement subject. */ + public subject: grafeas.v1.ISubject[]; - /** Artifact names. */ - public names: string[]; + /** InTotoStatement predicateType. */ + public predicateType: string; + + /** InTotoStatement provenance. */ + public provenance?: (grafeas.v1.IInTotoProvenance|null); + + /** InTotoStatement slsaProvenance. */ + public slsaProvenance?: (grafeas.v1.ISlsaProvenance|null); + + /** InTotoStatement predicate. */ + public predicate?: ("provenance"|"slsaProvenance"); /** - * Creates a new Artifact instance using the specified properties. + * Creates a new InTotoStatement instance using the specified properties. * @param [properties] Properties to set - * @returns Artifact instance + * @returns InTotoStatement instance */ - public static create(properties?: grafeas.v1.IArtifact): grafeas.v1.Artifact; + public static create(properties?: grafeas.v1.IInTotoStatement): grafeas.v1.InTotoStatement; /** - * Encodes the specified Artifact message. Does not implicitly {@link grafeas.v1.Artifact.verify|verify} messages. - * @param message Artifact message or plain object to encode + * Encodes the specified InTotoStatement message. Does not implicitly {@link grafeas.v1.InTotoStatement.verify|verify} messages. + * @param message InTotoStatement message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: grafeas.v1.IArtifact, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: grafeas.v1.IInTotoStatement, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Artifact message, length delimited. Does not implicitly {@link grafeas.v1.Artifact.verify|verify} messages. - * @param message Artifact message or plain object to encode + * Encodes the specified InTotoStatement message, length delimited. Does not implicitly {@link grafeas.v1.InTotoStatement.verify|verify} messages. + * @param message InTotoStatement message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: grafeas.v1.IArtifact, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: grafeas.v1.IInTotoStatement, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Artifact message from the specified reader or buffer. + * Decodes an InTotoStatement message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Artifact + * @returns InTotoStatement * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.Artifact; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.InTotoStatement; /** - * Decodes an Artifact message from the specified reader or buffer, length delimited. + * Decodes an InTotoStatement message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Artifact + * @returns InTotoStatement * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.Artifact; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.InTotoStatement; /** - * Verifies an Artifact message. + * Verifies an InTotoStatement message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an Artifact message from a plain object. Also converts values to their respective internal types. + * Creates an InTotoStatement message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Artifact + * @returns InTotoStatement */ - public static fromObject(object: { [k: string]: any }): grafeas.v1.Artifact; + public static fromObject(object: { [k: string]: any }): grafeas.v1.InTotoStatement; /** - * Creates a plain object from an Artifact message. Also converts values to other types if specified. - * @param message Artifact + * Creates a plain object from an InTotoStatement message. Also converts values to other types if specified. + * @param message InTotoStatement * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: grafeas.v1.Artifact, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: grafeas.v1.InTotoStatement, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Artifact to JSON. + * Converts this InTotoStatement to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SourceContext. */ - interface ISourceContext { - - /** SourceContext cloudRepo */ - cloudRepo?: (grafeas.v1.ICloudRepoSourceContext|null); - - /** SourceContext gerrit */ - gerrit?: (grafeas.v1.IGerritSourceContext|null); + /** Properties of a Subject. */ + interface ISubject { - /** SourceContext git */ - git?: (grafeas.v1.IGitSourceContext|null); + /** Subject name */ + name?: (string|null); - /** SourceContext labels */ - labels?: ({ [k: string]: string }|null); + /** Subject digest */ + digest?: ({ [k: string]: string }|null); } - /** Represents a SourceContext. */ - class SourceContext implements ISourceContext { + /** Represents a Subject. */ + class Subject implements ISubject { /** - * Constructs a new SourceContext. + * Constructs a new Subject. * @param [properties] Properties to set */ - constructor(properties?: grafeas.v1.ISourceContext); + constructor(properties?: grafeas.v1.ISubject); - /** SourceContext cloudRepo. */ - public cloudRepo?: (grafeas.v1.ICloudRepoSourceContext|null); - - /** SourceContext gerrit. */ - public gerrit?: (grafeas.v1.IGerritSourceContext|null); - - /** SourceContext git. */ - public git?: (grafeas.v1.IGitSourceContext|null); - - /** SourceContext labels. */ - public labels: { [k: string]: string }; + /** Subject name. */ + public name: string; - /** SourceContext context. */ - public context?: ("cloudRepo"|"gerrit"|"git"); + /** Subject digest. */ + public digest: { [k: string]: string }; /** - * Creates a new SourceContext instance using the specified properties. + * Creates a new Subject instance using the specified properties. * @param [properties] Properties to set - * @returns SourceContext instance + * @returns Subject instance */ - public static create(properties?: grafeas.v1.ISourceContext): grafeas.v1.SourceContext; + public static create(properties?: grafeas.v1.ISubject): grafeas.v1.Subject; /** - * Encodes the specified SourceContext message. Does not implicitly {@link grafeas.v1.SourceContext.verify|verify} messages. - * @param message SourceContext message or plain object to encode + * Encodes the specified Subject message. Does not implicitly {@link grafeas.v1.Subject.verify|verify} messages. + * @param message Subject message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: grafeas.v1.ISourceContext, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: grafeas.v1.ISubject, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SourceContext message, length delimited. Does not implicitly {@link grafeas.v1.SourceContext.verify|verify} messages. - * @param message SourceContext message or plain object to encode + * Encodes the specified Subject message, length delimited. Does not implicitly {@link grafeas.v1.Subject.verify|verify} messages. + * @param message Subject message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: grafeas.v1.ISourceContext, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: grafeas.v1.ISubject, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SourceContext message from the specified reader or buffer. + * Decodes a Subject message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SourceContext + * @returns Subject * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.SourceContext; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.Subject; /** - * Decodes a SourceContext message from the specified reader or buffer, length delimited. + * Decodes a Subject message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SourceContext + * @returns Subject * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.SourceContext; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.Subject; /** - * Verifies a SourceContext message. + * Verifies a Subject message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SourceContext message from a plain object. Also converts values to their respective internal types. + * Creates a Subject message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SourceContext + * @returns Subject */ - public static fromObject(object: { [k: string]: any }): grafeas.v1.SourceContext; + public static fromObject(object: { [k: string]: any }): grafeas.v1.Subject; /** - * Creates a plain object from a SourceContext message. Also converts values to other types if specified. - * @param message SourceContext + * Creates a plain object from a Subject message. Also converts values to other types if specified. + * @param message Subject * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: grafeas.v1.SourceContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: grafeas.v1.Subject, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SourceContext to JSON. + * Converts this Subject to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an AliasContext. */ - interface IAliasContext { + /** Properties of a SlsaProvenance. */ + interface ISlsaProvenance { - /** AliasContext kind */ - kind?: (grafeas.v1.AliasContext.Kind|keyof typeof grafeas.v1.AliasContext.Kind|null); + /** SlsaProvenance builder */ + builder?: (grafeas.v1.SlsaProvenance.ISlsaBuilder|null); - /** AliasContext name */ - name?: (string|null); + /** SlsaProvenance recipe */ + recipe?: (grafeas.v1.SlsaProvenance.ISlsaRecipe|null); + + /** SlsaProvenance metadata */ + metadata?: (grafeas.v1.SlsaProvenance.ISlsaMetadata|null); + + /** SlsaProvenance materials */ + materials?: (grafeas.v1.SlsaProvenance.IMaterial[]|null); } - /** Represents an AliasContext. */ - class AliasContext implements IAliasContext { + /** Represents a SlsaProvenance. */ + class SlsaProvenance implements ISlsaProvenance { /** - * Constructs a new AliasContext. + * Constructs a new SlsaProvenance. * @param [properties] Properties to set */ - constructor(properties?: grafeas.v1.IAliasContext); + constructor(properties?: grafeas.v1.ISlsaProvenance); - /** AliasContext kind. */ - public kind: (grafeas.v1.AliasContext.Kind|keyof typeof grafeas.v1.AliasContext.Kind); + /** SlsaProvenance builder. */ + public builder?: (grafeas.v1.SlsaProvenance.ISlsaBuilder|null); - /** AliasContext name. */ - public name: string; + /** SlsaProvenance recipe. */ + public recipe?: (grafeas.v1.SlsaProvenance.ISlsaRecipe|null); + + /** SlsaProvenance metadata. */ + public metadata?: (grafeas.v1.SlsaProvenance.ISlsaMetadata|null); + + /** SlsaProvenance materials. */ + public materials: grafeas.v1.SlsaProvenance.IMaterial[]; /** - * Creates a new AliasContext instance using the specified properties. + * Creates a new SlsaProvenance instance using the specified properties. * @param [properties] Properties to set - * @returns AliasContext instance + * @returns SlsaProvenance instance */ - public static create(properties?: grafeas.v1.IAliasContext): grafeas.v1.AliasContext; + public static create(properties?: grafeas.v1.ISlsaProvenance): grafeas.v1.SlsaProvenance; /** - * Encodes the specified AliasContext message. Does not implicitly {@link grafeas.v1.AliasContext.verify|verify} messages. - * @param message AliasContext message or plain object to encode + * Encodes the specified SlsaProvenance message. Does not implicitly {@link grafeas.v1.SlsaProvenance.verify|verify} messages. + * @param message SlsaProvenance message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: grafeas.v1.IAliasContext, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: grafeas.v1.ISlsaProvenance, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified AliasContext message, length delimited. Does not implicitly {@link grafeas.v1.AliasContext.verify|verify} messages. - * @param message AliasContext message or plain object to encode + * Encodes the specified SlsaProvenance message, length delimited. Does not implicitly {@link grafeas.v1.SlsaProvenance.verify|verify} messages. + * @param message SlsaProvenance message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: grafeas.v1.IAliasContext, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: grafeas.v1.ISlsaProvenance, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an AliasContext message from the specified reader or buffer. + * Decodes a SlsaProvenance message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns AliasContext + * @returns SlsaProvenance * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.AliasContext; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.SlsaProvenance; /** - * Decodes an AliasContext message from the specified reader or buffer, length delimited. + * Decodes a SlsaProvenance message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns AliasContext + * @returns SlsaProvenance * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.AliasContext; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.SlsaProvenance; /** - * Verifies an AliasContext message. + * Verifies a SlsaProvenance message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an AliasContext message from a plain object. Also converts values to their respective internal types. + * Creates a SlsaProvenance message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns AliasContext + * @returns SlsaProvenance */ - public static fromObject(object: { [k: string]: any }): grafeas.v1.AliasContext; + public static fromObject(object: { [k: string]: any }): grafeas.v1.SlsaProvenance; /** - * Creates a plain object from an AliasContext message. Also converts values to other types if specified. - * @param message AliasContext + * Creates a plain object from a SlsaProvenance message. Also converts values to other types if specified. + * @param message SlsaProvenance * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: grafeas.v1.AliasContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: grafeas.v1.SlsaProvenance, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this AliasContext to JSON. + * Converts this SlsaProvenance to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace AliasContext { + namespace SlsaProvenance { - /** Kind enum. */ - enum Kind { - KIND_UNSPECIFIED = 0, - FIXED = 1, - MOVABLE = 2, - OTHER = 4 - } - } + /** Properties of a SlsaRecipe. */ + interface ISlsaRecipe { - /** Properties of a CloudRepoSourceContext. */ - interface ICloudRepoSourceContext { + /** SlsaRecipe type */ + type?: (string|null); - /** CloudRepoSourceContext repoId */ - repoId?: (grafeas.v1.IRepoId|null); + /** SlsaRecipe definedInMaterial */ + definedInMaterial?: (number|Long|string|null); - /** CloudRepoSourceContext revisionId */ - revisionId?: (string|null); + /** SlsaRecipe entryPoint */ + entryPoint?: (string|null); - /** CloudRepoSourceContext aliasContext */ - aliasContext?: (grafeas.v1.IAliasContext|null); - } + /** SlsaRecipe arguments */ + "arguments"?: (google.protobuf.IAny|null); - /** Represents a CloudRepoSourceContext. */ - class CloudRepoSourceContext implements ICloudRepoSourceContext { + /** SlsaRecipe environment */ + environment?: (google.protobuf.IAny|null); + } - /** - * Constructs a new CloudRepoSourceContext. - * @param [properties] Properties to set - */ - constructor(properties?: grafeas.v1.ICloudRepoSourceContext); + /** Represents a SlsaRecipe. */ + class SlsaRecipe implements ISlsaRecipe { - /** CloudRepoSourceContext repoId. */ - public repoId?: (grafeas.v1.IRepoId|null); + /** + * Constructs a new SlsaRecipe. + * @param [properties] Properties to set + */ + constructor(properties?: grafeas.v1.SlsaProvenance.ISlsaRecipe); - /** CloudRepoSourceContext revisionId. */ - public revisionId?: (string|null); + /** SlsaRecipe type. */ + public type: string; - /** CloudRepoSourceContext aliasContext. */ - public aliasContext?: (grafeas.v1.IAliasContext|null); + /** SlsaRecipe definedInMaterial. */ + public definedInMaterial: (number|Long|string); - /** CloudRepoSourceContext revision. */ - public revision?: ("revisionId"|"aliasContext"); + /** SlsaRecipe entryPoint. */ + public entryPoint: string; - /** - * Creates a new CloudRepoSourceContext instance using the specified properties. - * @param [properties] Properties to set - * @returns CloudRepoSourceContext instance - */ - public static create(properties?: grafeas.v1.ICloudRepoSourceContext): grafeas.v1.CloudRepoSourceContext; + /** SlsaRecipe arguments. */ + public arguments?: (google.protobuf.IAny|null); - /** - * Encodes the specified CloudRepoSourceContext message. Does not implicitly {@link grafeas.v1.CloudRepoSourceContext.verify|verify} messages. - * @param message CloudRepoSourceContext message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: grafeas.v1.ICloudRepoSourceContext, writer?: $protobuf.Writer): $protobuf.Writer; + /** SlsaRecipe environment. */ + public environment?: (google.protobuf.IAny|null); - /** - * Encodes the specified CloudRepoSourceContext message, length delimited. Does not implicitly {@link grafeas.v1.CloudRepoSourceContext.verify|verify} messages. - * @param message CloudRepoSourceContext message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: grafeas.v1.ICloudRepoSourceContext, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new SlsaRecipe instance using the specified properties. + * @param [properties] Properties to set + * @returns SlsaRecipe instance + */ + public static create(properties?: grafeas.v1.SlsaProvenance.ISlsaRecipe): grafeas.v1.SlsaProvenance.SlsaRecipe; - /** - * Decodes a CloudRepoSourceContext message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloudRepoSourceContext - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.CloudRepoSourceContext; + /** + * Encodes the specified SlsaRecipe message. Does not implicitly {@link grafeas.v1.SlsaProvenance.SlsaRecipe.verify|verify} messages. + * @param message SlsaRecipe message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: grafeas.v1.SlsaProvenance.ISlsaRecipe, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a CloudRepoSourceContext message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloudRepoSourceContext - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ + /** + * Encodes the specified SlsaRecipe message, length delimited. Does not implicitly {@link grafeas.v1.SlsaProvenance.SlsaRecipe.verify|verify} messages. + * @param message SlsaRecipe message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: grafeas.v1.SlsaProvenance.ISlsaRecipe, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SlsaRecipe message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SlsaRecipe + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.SlsaProvenance.SlsaRecipe; + + /** + * Decodes a SlsaRecipe message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SlsaRecipe + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.SlsaProvenance.SlsaRecipe; + + /** + * Verifies a SlsaRecipe message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SlsaRecipe message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SlsaRecipe + */ + public static fromObject(object: { [k: string]: any }): grafeas.v1.SlsaProvenance.SlsaRecipe; + + /** + * Creates a plain object from a SlsaRecipe message. Also converts values to other types if specified. + * @param message SlsaRecipe + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: grafeas.v1.SlsaProvenance.SlsaRecipe, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SlsaRecipe to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SlsaCompleteness. */ + interface ISlsaCompleteness { + + /** SlsaCompleteness arguments */ + "arguments"?: (boolean|null); + + /** SlsaCompleteness environment */ + environment?: (boolean|null); + + /** SlsaCompleteness materials */ + materials?: (boolean|null); + } + + /** Represents a SlsaCompleteness. */ + class SlsaCompleteness implements ISlsaCompleteness { + + /** + * Constructs a new SlsaCompleteness. + * @param [properties] Properties to set + */ + constructor(properties?: grafeas.v1.SlsaProvenance.ISlsaCompleteness); + + /** SlsaCompleteness arguments. */ + public arguments: boolean; + + /** SlsaCompleteness environment. */ + public environment: boolean; + + /** SlsaCompleteness materials. */ + public materials: boolean; + + /** + * Creates a new SlsaCompleteness instance using the specified properties. + * @param [properties] Properties to set + * @returns SlsaCompleteness instance + */ + public static create(properties?: grafeas.v1.SlsaProvenance.ISlsaCompleteness): grafeas.v1.SlsaProvenance.SlsaCompleteness; + + /** + * Encodes the specified SlsaCompleteness message. Does not implicitly {@link grafeas.v1.SlsaProvenance.SlsaCompleteness.verify|verify} messages. + * @param message SlsaCompleteness message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: grafeas.v1.SlsaProvenance.ISlsaCompleteness, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SlsaCompleteness message, length delimited. Does not implicitly {@link grafeas.v1.SlsaProvenance.SlsaCompleteness.verify|verify} messages. + * @param message SlsaCompleteness message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: grafeas.v1.SlsaProvenance.ISlsaCompleteness, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SlsaCompleteness message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SlsaCompleteness + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.SlsaProvenance.SlsaCompleteness; + + /** + * Decodes a SlsaCompleteness message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SlsaCompleteness + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.SlsaProvenance.SlsaCompleteness; + + /** + * Verifies a SlsaCompleteness message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SlsaCompleteness message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SlsaCompleteness + */ + public static fromObject(object: { [k: string]: any }): grafeas.v1.SlsaProvenance.SlsaCompleteness; + + /** + * Creates a plain object from a SlsaCompleteness message. Also converts values to other types if specified. + * @param message SlsaCompleteness + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: grafeas.v1.SlsaProvenance.SlsaCompleteness, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SlsaCompleteness to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SlsaMetadata. */ + interface ISlsaMetadata { + + /** SlsaMetadata buildInvocationId */ + buildInvocationId?: (string|null); + + /** SlsaMetadata buildStartedOn */ + buildStartedOn?: (google.protobuf.ITimestamp|null); + + /** SlsaMetadata buildFinishedOn */ + buildFinishedOn?: (google.protobuf.ITimestamp|null); + + /** SlsaMetadata completeness */ + completeness?: (grafeas.v1.SlsaProvenance.ISlsaCompleteness|null); + + /** SlsaMetadata reproducible */ + reproducible?: (boolean|null); + } + + /** Represents a SlsaMetadata. */ + class SlsaMetadata implements ISlsaMetadata { + + /** + * Constructs a new SlsaMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: grafeas.v1.SlsaProvenance.ISlsaMetadata); + + /** SlsaMetadata buildInvocationId. */ + public buildInvocationId: string; + + /** SlsaMetadata buildStartedOn. */ + public buildStartedOn?: (google.protobuf.ITimestamp|null); + + /** SlsaMetadata buildFinishedOn. */ + public buildFinishedOn?: (google.protobuf.ITimestamp|null); + + /** SlsaMetadata completeness. */ + public completeness?: (grafeas.v1.SlsaProvenance.ISlsaCompleteness|null); + + /** SlsaMetadata reproducible. */ + public reproducible: boolean; + + /** + * Creates a new SlsaMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns SlsaMetadata instance + */ + public static create(properties?: grafeas.v1.SlsaProvenance.ISlsaMetadata): grafeas.v1.SlsaProvenance.SlsaMetadata; + + /** + * Encodes the specified SlsaMetadata message. Does not implicitly {@link grafeas.v1.SlsaProvenance.SlsaMetadata.verify|verify} messages. + * @param message SlsaMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: grafeas.v1.SlsaProvenance.ISlsaMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SlsaMetadata message, length delimited. Does not implicitly {@link grafeas.v1.SlsaProvenance.SlsaMetadata.verify|verify} messages. + * @param message SlsaMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: grafeas.v1.SlsaProvenance.ISlsaMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SlsaMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SlsaMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.SlsaProvenance.SlsaMetadata; + + /** + * Decodes a SlsaMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SlsaMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.SlsaProvenance.SlsaMetadata; + + /** + * Verifies a SlsaMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SlsaMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SlsaMetadata + */ + public static fromObject(object: { [k: string]: any }): grafeas.v1.SlsaProvenance.SlsaMetadata; + + /** + * Creates a plain object from a SlsaMetadata message. Also converts values to other types if specified. + * @param message SlsaMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: grafeas.v1.SlsaProvenance.SlsaMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SlsaMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SlsaBuilder. */ + interface ISlsaBuilder { + + /** SlsaBuilder id */ + id?: (string|null); + } + + /** Represents a SlsaBuilder. */ + class SlsaBuilder implements ISlsaBuilder { + + /** + * Constructs a new SlsaBuilder. + * @param [properties] Properties to set + */ + constructor(properties?: grafeas.v1.SlsaProvenance.ISlsaBuilder); + + /** SlsaBuilder id. */ + public id: string; + + /** + * Creates a new SlsaBuilder instance using the specified properties. + * @param [properties] Properties to set + * @returns SlsaBuilder instance + */ + public static create(properties?: grafeas.v1.SlsaProvenance.ISlsaBuilder): grafeas.v1.SlsaProvenance.SlsaBuilder; + + /** + * Encodes the specified SlsaBuilder message. Does not implicitly {@link grafeas.v1.SlsaProvenance.SlsaBuilder.verify|verify} messages. + * @param message SlsaBuilder message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: grafeas.v1.SlsaProvenance.ISlsaBuilder, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SlsaBuilder message, length delimited. Does not implicitly {@link grafeas.v1.SlsaProvenance.SlsaBuilder.verify|verify} messages. + * @param message SlsaBuilder message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: grafeas.v1.SlsaProvenance.ISlsaBuilder, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SlsaBuilder message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SlsaBuilder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.SlsaProvenance.SlsaBuilder; + + /** + * Decodes a SlsaBuilder message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SlsaBuilder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.SlsaProvenance.SlsaBuilder; + + /** + * Verifies a SlsaBuilder message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SlsaBuilder message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SlsaBuilder + */ + public static fromObject(object: { [k: string]: any }): grafeas.v1.SlsaProvenance.SlsaBuilder; + + /** + * Creates a plain object from a SlsaBuilder message. Also converts values to other types if specified. + * @param message SlsaBuilder + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: grafeas.v1.SlsaProvenance.SlsaBuilder, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SlsaBuilder to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Material. */ + interface IMaterial { + + /** Material uri */ + uri?: (string|null); + + /** Material digest */ + digest?: ({ [k: string]: string }|null); + } + + /** Represents a Material. */ + class Material implements IMaterial { + + /** + * Constructs a new Material. + * @param [properties] Properties to set + */ + constructor(properties?: grafeas.v1.SlsaProvenance.IMaterial); + + /** Material uri. */ + public uri: string; + + /** Material digest. */ + public digest: { [k: string]: string }; + + /** + * Creates a new Material instance using the specified properties. + * @param [properties] Properties to set + * @returns Material instance + */ + public static create(properties?: grafeas.v1.SlsaProvenance.IMaterial): grafeas.v1.SlsaProvenance.Material; + + /** + * Encodes the specified Material message. Does not implicitly {@link grafeas.v1.SlsaProvenance.Material.verify|verify} messages. + * @param message Material message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: grafeas.v1.SlsaProvenance.IMaterial, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Material message, length delimited. Does not implicitly {@link grafeas.v1.SlsaProvenance.Material.verify|verify} messages. + * @param message Material message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: grafeas.v1.SlsaProvenance.IMaterial, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Material message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Material + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.SlsaProvenance.Material; + + /** + * Decodes a Material message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Material + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.SlsaProvenance.Material; + + /** + * Verifies a Material message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Material message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Material + */ + public static fromObject(object: { [k: string]: any }): grafeas.v1.SlsaProvenance.Material; + + /** + * Creates a plain object from a Material message. Also converts values to other types if specified. + * @param message Material + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: grafeas.v1.SlsaProvenance.Material, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Material to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a BuildProvenance. */ + interface IBuildProvenance { + + /** BuildProvenance id */ + id?: (string|null); + + /** BuildProvenance projectId */ + projectId?: (string|null); + + /** BuildProvenance commands */ + commands?: (grafeas.v1.ICommand[]|null); + + /** BuildProvenance builtArtifacts */ + builtArtifacts?: (grafeas.v1.IArtifact[]|null); + + /** BuildProvenance createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** BuildProvenance startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** BuildProvenance endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** BuildProvenance creator */ + creator?: (string|null); + + /** BuildProvenance logsUri */ + logsUri?: (string|null); + + /** BuildProvenance sourceProvenance */ + sourceProvenance?: (grafeas.v1.ISource|null); + + /** BuildProvenance triggerId */ + triggerId?: (string|null); + + /** BuildProvenance buildOptions */ + buildOptions?: ({ [k: string]: string }|null); + + /** BuildProvenance builderVersion */ + builderVersion?: (string|null); + } + + /** Represents a BuildProvenance. */ + class BuildProvenance implements IBuildProvenance { + + /** + * Constructs a new BuildProvenance. + * @param [properties] Properties to set + */ + constructor(properties?: grafeas.v1.IBuildProvenance); + + /** BuildProvenance id. */ + public id: string; + + /** BuildProvenance projectId. */ + public projectId: string; + + /** BuildProvenance commands. */ + public commands: grafeas.v1.ICommand[]; + + /** BuildProvenance builtArtifacts. */ + public builtArtifacts: grafeas.v1.IArtifact[]; + + /** BuildProvenance createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** BuildProvenance startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** BuildProvenance endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** BuildProvenance creator. */ + public creator: string; + + /** BuildProvenance logsUri. */ + public logsUri: string; + + /** BuildProvenance sourceProvenance. */ + public sourceProvenance?: (grafeas.v1.ISource|null); + + /** BuildProvenance triggerId. */ + public triggerId: string; + + /** BuildProvenance buildOptions. */ + public buildOptions: { [k: string]: string }; + + /** BuildProvenance builderVersion. */ + public builderVersion: string; + + /** + * Creates a new BuildProvenance instance using the specified properties. + * @param [properties] Properties to set + * @returns BuildProvenance instance + */ + public static create(properties?: grafeas.v1.IBuildProvenance): grafeas.v1.BuildProvenance; + + /** + * Encodes the specified BuildProvenance message. Does not implicitly {@link grafeas.v1.BuildProvenance.verify|verify} messages. + * @param message BuildProvenance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: grafeas.v1.IBuildProvenance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BuildProvenance message, length delimited. Does not implicitly {@link grafeas.v1.BuildProvenance.verify|verify} messages. + * @param message BuildProvenance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: grafeas.v1.IBuildProvenance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BuildProvenance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BuildProvenance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.BuildProvenance; + + /** + * Decodes a BuildProvenance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BuildProvenance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.BuildProvenance; + + /** + * Verifies a BuildProvenance message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BuildProvenance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BuildProvenance + */ + public static fromObject(object: { [k: string]: any }): grafeas.v1.BuildProvenance; + + /** + * Creates a plain object from a BuildProvenance message. Also converts values to other types if specified. + * @param message BuildProvenance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: grafeas.v1.BuildProvenance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BuildProvenance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Source. */ + interface ISource { + + /** Source artifactStorageSourceUri */ + artifactStorageSourceUri?: (string|null); + + /** Source fileHashes */ + fileHashes?: ({ [k: string]: grafeas.v1.IFileHashes }|null); + + /** Source context */ + context?: (grafeas.v1.ISourceContext|null); + + /** Source additionalContexts */ + additionalContexts?: (grafeas.v1.ISourceContext[]|null); + } + + /** Represents a Source. */ + class Source implements ISource { + + /** + * Constructs a new Source. + * @param [properties] Properties to set + */ + constructor(properties?: grafeas.v1.ISource); + + /** Source artifactStorageSourceUri. */ + public artifactStorageSourceUri: string; + + /** Source fileHashes. */ + public fileHashes: { [k: string]: grafeas.v1.IFileHashes }; + + /** Source context. */ + public context?: (grafeas.v1.ISourceContext|null); + + /** Source additionalContexts. */ + public additionalContexts: grafeas.v1.ISourceContext[]; + + /** + * Creates a new Source instance using the specified properties. + * @param [properties] Properties to set + * @returns Source instance + */ + public static create(properties?: grafeas.v1.ISource): grafeas.v1.Source; + + /** + * Encodes the specified Source message. Does not implicitly {@link grafeas.v1.Source.verify|verify} messages. + * @param message Source message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: grafeas.v1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Source message, length delimited. Does not implicitly {@link grafeas.v1.Source.verify|verify} messages. + * @param message Source message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: grafeas.v1.ISource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Source message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Source + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.Source; + + /** + * Decodes a Source message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Source + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.Source; + + /** + * Verifies a Source message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Source message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Source + */ + public static fromObject(object: { [k: string]: any }): grafeas.v1.Source; + + /** + * Creates a plain object from a Source message. Also converts values to other types if specified. + * @param message Source + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: grafeas.v1.Source, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Source to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FileHashes. */ + interface IFileHashes { + + /** FileHashes fileHash */ + fileHash?: (grafeas.v1.IHash[]|null); + } + + /** Represents a FileHashes. */ + class FileHashes implements IFileHashes { + + /** + * Constructs a new FileHashes. + * @param [properties] Properties to set + */ + constructor(properties?: grafeas.v1.IFileHashes); + + /** FileHashes fileHash. */ + public fileHash: grafeas.v1.IHash[]; + + /** + * Creates a new FileHashes instance using the specified properties. + * @param [properties] Properties to set + * @returns FileHashes instance + */ + public static create(properties?: grafeas.v1.IFileHashes): grafeas.v1.FileHashes; + + /** + * Encodes the specified FileHashes message. Does not implicitly {@link grafeas.v1.FileHashes.verify|verify} messages. + * @param message FileHashes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: grafeas.v1.IFileHashes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileHashes message, length delimited. Does not implicitly {@link grafeas.v1.FileHashes.verify|verify} messages. + * @param message FileHashes message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: grafeas.v1.IFileHashes, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileHashes message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileHashes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.FileHashes; + + /** + * Decodes a FileHashes message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileHashes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.FileHashes; + + /** + * Verifies a FileHashes message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileHashes message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileHashes + */ + public static fromObject(object: { [k: string]: any }): grafeas.v1.FileHashes; + + /** + * Creates a plain object from a FileHashes message. Also converts values to other types if specified. + * @param message FileHashes + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: grafeas.v1.FileHashes, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileHashes to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Hash. */ + interface IHash { + + /** Hash type */ + type?: (string|null); + + /** Hash value */ + value?: (Uint8Array|string|null); + } + + /** Represents a Hash. */ + class Hash implements IHash { + + /** + * Constructs a new Hash. + * @param [properties] Properties to set + */ + constructor(properties?: grafeas.v1.IHash); + + /** Hash type. */ + public type: string; + + /** Hash value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Hash instance using the specified properties. + * @param [properties] Properties to set + * @returns Hash instance + */ + public static create(properties?: grafeas.v1.IHash): grafeas.v1.Hash; + + /** + * Encodes the specified Hash message. Does not implicitly {@link grafeas.v1.Hash.verify|verify} messages. + * @param message Hash message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: grafeas.v1.IHash, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Hash message, length delimited. Does not implicitly {@link grafeas.v1.Hash.verify|verify} messages. + * @param message Hash message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: grafeas.v1.IHash, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Hash message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Hash + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.Hash; + + /** + * Decodes a Hash message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Hash + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.Hash; + + /** + * Verifies a Hash message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Hash message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Hash + */ + public static fromObject(object: { [k: string]: any }): grafeas.v1.Hash; + + /** + * Creates a plain object from a Hash message. Also converts values to other types if specified. + * @param message Hash + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: grafeas.v1.Hash, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Hash to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Command. */ + interface ICommand { + + /** Command name */ + name?: (string|null); + + /** Command env */ + env?: (string[]|null); + + /** Command args */ + args?: (string[]|null); + + /** Command dir */ + dir?: (string|null); + + /** Command id */ + id?: (string|null); + + /** Command waitFor */ + waitFor?: (string[]|null); + } + + /** Represents a Command. */ + class Command implements ICommand { + + /** + * Constructs a new Command. + * @param [properties] Properties to set + */ + constructor(properties?: grafeas.v1.ICommand); + + /** Command name. */ + public name: string; + + /** Command env. */ + public env: string[]; + + /** Command args. */ + public args: string[]; + + /** Command dir. */ + public dir: string; + + /** Command id. */ + public id: string; + + /** Command waitFor. */ + public waitFor: string[]; + + /** + * Creates a new Command instance using the specified properties. + * @param [properties] Properties to set + * @returns Command instance + */ + public static create(properties?: grafeas.v1.ICommand): grafeas.v1.Command; + + /** + * Encodes the specified Command message. Does not implicitly {@link grafeas.v1.Command.verify|verify} messages. + * @param message Command message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: grafeas.v1.ICommand, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Command message, length delimited. Does not implicitly {@link grafeas.v1.Command.verify|verify} messages. + * @param message Command message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: grafeas.v1.ICommand, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Command message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Command + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.Command; + + /** + * Decodes a Command message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Command + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.Command; + + /** + * Verifies a Command message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Command message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Command + */ + public static fromObject(object: { [k: string]: any }): grafeas.v1.Command; + + /** + * Creates a plain object from a Command message. Also converts values to other types if specified. + * @param message Command + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: grafeas.v1.Command, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Command to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Artifact. */ + interface IArtifact { + + /** Artifact checksum */ + checksum?: (string|null); + + /** Artifact id */ + id?: (string|null); + + /** Artifact names */ + names?: (string[]|null); + } + + /** Represents an Artifact. */ + class Artifact implements IArtifact { + + /** + * Constructs a new Artifact. + * @param [properties] Properties to set + */ + constructor(properties?: grafeas.v1.IArtifact); + + /** Artifact checksum. */ + public checksum: string; + + /** Artifact id. */ + public id: string; + + /** Artifact names. */ + public names: string[]; + + /** + * Creates a new Artifact instance using the specified properties. + * @param [properties] Properties to set + * @returns Artifact instance + */ + public static create(properties?: grafeas.v1.IArtifact): grafeas.v1.Artifact; + + /** + * Encodes the specified Artifact message. Does not implicitly {@link grafeas.v1.Artifact.verify|verify} messages. + * @param message Artifact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: grafeas.v1.IArtifact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Artifact message, length delimited. Does not implicitly {@link grafeas.v1.Artifact.verify|verify} messages. + * @param message Artifact message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: grafeas.v1.IArtifact, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Artifact message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Artifact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.Artifact; + + /** + * Decodes an Artifact message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Artifact + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.Artifact; + + /** + * Verifies an Artifact message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Artifact message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Artifact + */ + public static fromObject(object: { [k: string]: any }): grafeas.v1.Artifact; + + /** + * Creates a plain object from an Artifact message. Also converts values to other types if specified. + * @param message Artifact + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: grafeas.v1.Artifact, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Artifact to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SourceContext. */ + interface ISourceContext { + + /** SourceContext cloudRepo */ + cloudRepo?: (grafeas.v1.ICloudRepoSourceContext|null); + + /** SourceContext gerrit */ + gerrit?: (grafeas.v1.IGerritSourceContext|null); + + /** SourceContext git */ + git?: (grafeas.v1.IGitSourceContext|null); + + /** SourceContext labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a SourceContext. */ + class SourceContext implements ISourceContext { + + /** + * Constructs a new SourceContext. + * @param [properties] Properties to set + */ + constructor(properties?: grafeas.v1.ISourceContext); + + /** SourceContext cloudRepo. */ + public cloudRepo?: (grafeas.v1.ICloudRepoSourceContext|null); + + /** SourceContext gerrit. */ + public gerrit?: (grafeas.v1.IGerritSourceContext|null); + + /** SourceContext git. */ + public git?: (grafeas.v1.IGitSourceContext|null); + + /** SourceContext labels. */ + public labels: { [k: string]: string }; + + /** SourceContext context. */ + public context?: ("cloudRepo"|"gerrit"|"git"); + + /** + * Creates a new SourceContext instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceContext instance + */ + public static create(properties?: grafeas.v1.ISourceContext): grafeas.v1.SourceContext; + + /** + * Encodes the specified SourceContext message. Does not implicitly {@link grafeas.v1.SourceContext.verify|verify} messages. + * @param message SourceContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: grafeas.v1.ISourceContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceContext message, length delimited. Does not implicitly {@link grafeas.v1.SourceContext.verify|verify} messages. + * @param message SourceContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: grafeas.v1.ISourceContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.SourceContext; + + /** + * Decodes a SourceContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.SourceContext; + + /** + * Verifies a SourceContext message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceContext + */ + public static fromObject(object: { [k: string]: any }): grafeas.v1.SourceContext; + + /** + * Creates a plain object from a SourceContext message. Also converts values to other types if specified. + * @param message SourceContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: grafeas.v1.SourceContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AliasContext. */ + interface IAliasContext { + + /** AliasContext kind */ + kind?: (grafeas.v1.AliasContext.Kind|keyof typeof grafeas.v1.AliasContext.Kind|null); + + /** AliasContext name */ + name?: (string|null); + } + + /** Represents an AliasContext. */ + class AliasContext implements IAliasContext { + + /** + * Constructs a new AliasContext. + * @param [properties] Properties to set + */ + constructor(properties?: grafeas.v1.IAliasContext); + + /** AliasContext kind. */ + public kind: (grafeas.v1.AliasContext.Kind|keyof typeof grafeas.v1.AliasContext.Kind); + + /** AliasContext name. */ + public name: string; + + /** + * Creates a new AliasContext instance using the specified properties. + * @param [properties] Properties to set + * @returns AliasContext instance + */ + public static create(properties?: grafeas.v1.IAliasContext): grafeas.v1.AliasContext; + + /** + * Encodes the specified AliasContext message. Does not implicitly {@link grafeas.v1.AliasContext.verify|verify} messages. + * @param message AliasContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: grafeas.v1.IAliasContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AliasContext message, length delimited. Does not implicitly {@link grafeas.v1.AliasContext.verify|verify} messages. + * @param message AliasContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: grafeas.v1.IAliasContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AliasContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AliasContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.AliasContext; + + /** + * Decodes an AliasContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AliasContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.AliasContext; + + /** + * Verifies an AliasContext message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AliasContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AliasContext + */ + public static fromObject(object: { [k: string]: any }): grafeas.v1.AliasContext; + + /** + * Creates a plain object from an AliasContext message. Also converts values to other types if specified. + * @param message AliasContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: grafeas.v1.AliasContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AliasContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AliasContext { + + /** Kind enum. */ + enum Kind { + KIND_UNSPECIFIED = 0, + FIXED = 1, + MOVABLE = 2, + OTHER = 4 + } + } + + /** Properties of a CloudRepoSourceContext. */ + interface ICloudRepoSourceContext { + + /** CloudRepoSourceContext repoId */ + repoId?: (grafeas.v1.IRepoId|null); + + /** CloudRepoSourceContext revisionId */ + revisionId?: (string|null); + + /** CloudRepoSourceContext aliasContext */ + aliasContext?: (grafeas.v1.IAliasContext|null); + } + + /** Represents a CloudRepoSourceContext. */ + class CloudRepoSourceContext implements ICloudRepoSourceContext { + + /** + * Constructs a new CloudRepoSourceContext. + * @param [properties] Properties to set + */ + constructor(properties?: grafeas.v1.ICloudRepoSourceContext); + + /** CloudRepoSourceContext repoId. */ + public repoId?: (grafeas.v1.IRepoId|null); + + /** CloudRepoSourceContext revisionId. */ + public revisionId?: (string|null); + + /** CloudRepoSourceContext aliasContext. */ + public aliasContext?: (grafeas.v1.IAliasContext|null); + + /** CloudRepoSourceContext revision. */ + public revision?: ("revisionId"|"aliasContext"); + + /** + * Creates a new CloudRepoSourceContext instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudRepoSourceContext instance + */ + public static create(properties?: grafeas.v1.ICloudRepoSourceContext): grafeas.v1.CloudRepoSourceContext; + + /** + * Encodes the specified CloudRepoSourceContext message. Does not implicitly {@link grafeas.v1.CloudRepoSourceContext.verify|verify} messages. + * @param message CloudRepoSourceContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: grafeas.v1.ICloudRepoSourceContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudRepoSourceContext message, length delimited. Does not implicitly {@link grafeas.v1.CloudRepoSourceContext.verify|verify} messages. + * @param message CloudRepoSourceContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: grafeas.v1.ICloudRepoSourceContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudRepoSourceContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudRepoSourceContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.CloudRepoSourceContext; + + /** + * Decodes a CloudRepoSourceContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudRepoSourceContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.CloudRepoSourceContext; /** - * Verifies a CloudRepoSourceContext message. + * Verifies a CloudRepoSourceContext message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudRepoSourceContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudRepoSourceContext + */ + public static fromObject(object: { [k: string]: any }): grafeas.v1.CloudRepoSourceContext; + + /** + * Creates a plain object from a CloudRepoSourceContext message. Also converts values to other types if specified. + * @param message CloudRepoSourceContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: grafeas.v1.CloudRepoSourceContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudRepoSourceContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GerritSourceContext. */ + interface IGerritSourceContext { + + /** GerritSourceContext hostUri */ + hostUri?: (string|null); + + /** GerritSourceContext gerritProject */ + gerritProject?: (string|null); + + /** GerritSourceContext revisionId */ + revisionId?: (string|null); + + /** GerritSourceContext aliasContext */ + aliasContext?: (grafeas.v1.IAliasContext|null); + } + + /** Represents a GerritSourceContext. */ + class GerritSourceContext implements IGerritSourceContext { + + /** + * Constructs a new GerritSourceContext. + * @param [properties] Properties to set + */ + constructor(properties?: grafeas.v1.IGerritSourceContext); + + /** GerritSourceContext hostUri. */ + public hostUri: string; + + /** GerritSourceContext gerritProject. */ + public gerritProject: string; + + /** GerritSourceContext revisionId. */ + public revisionId?: (string|null); + + /** GerritSourceContext aliasContext. */ + public aliasContext?: (grafeas.v1.IAliasContext|null); + + /** GerritSourceContext revision. */ + public revision?: ("revisionId"|"aliasContext"); + + /** + * Creates a new GerritSourceContext instance using the specified properties. + * @param [properties] Properties to set + * @returns GerritSourceContext instance + */ + public static create(properties?: grafeas.v1.IGerritSourceContext): grafeas.v1.GerritSourceContext; + + /** + * Encodes the specified GerritSourceContext message. Does not implicitly {@link grafeas.v1.GerritSourceContext.verify|verify} messages. + * @param message GerritSourceContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: grafeas.v1.IGerritSourceContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GerritSourceContext message, length delimited. Does not implicitly {@link grafeas.v1.GerritSourceContext.verify|verify} messages. + * @param message GerritSourceContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: grafeas.v1.IGerritSourceContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GerritSourceContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GerritSourceContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.GerritSourceContext; + + /** + * Decodes a GerritSourceContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GerritSourceContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.GerritSourceContext; + + /** + * Verifies a GerritSourceContext message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GerritSourceContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GerritSourceContext + */ + public static fromObject(object: { [k: string]: any }): grafeas.v1.GerritSourceContext; + + /** + * Creates a plain object from a GerritSourceContext message. Also converts values to other types if specified. + * @param message GerritSourceContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: grafeas.v1.GerritSourceContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GerritSourceContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GitSourceContext. */ + interface IGitSourceContext { + + /** GitSourceContext url */ + url?: (string|null); + + /** GitSourceContext revisionId */ + revisionId?: (string|null); + } + + /** Represents a GitSourceContext. */ + class GitSourceContext implements IGitSourceContext { + + /** + * Constructs a new GitSourceContext. + * @param [properties] Properties to set + */ + constructor(properties?: grafeas.v1.IGitSourceContext); + + /** GitSourceContext url. */ + public url: string; + + /** GitSourceContext revisionId. */ + public revisionId: string; + + /** + * Creates a new GitSourceContext instance using the specified properties. + * @param [properties] Properties to set + * @returns GitSourceContext instance + */ + public static create(properties?: grafeas.v1.IGitSourceContext): grafeas.v1.GitSourceContext; + + /** + * Encodes the specified GitSourceContext message. Does not implicitly {@link grafeas.v1.GitSourceContext.verify|verify} messages. + * @param message GitSourceContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: grafeas.v1.IGitSourceContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GitSourceContext message, length delimited. Does not implicitly {@link grafeas.v1.GitSourceContext.verify|verify} messages. + * @param message GitSourceContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: grafeas.v1.IGitSourceContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GitSourceContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GitSourceContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.GitSourceContext; + + /** + * Decodes a GitSourceContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GitSourceContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.GitSourceContext; + + /** + * Verifies a GitSourceContext message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GitSourceContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GitSourceContext + */ + public static fromObject(object: { [k: string]: any }): grafeas.v1.GitSourceContext; + + /** + * Creates a plain object from a GitSourceContext message. Also converts values to other types if specified. + * @param message GitSourceContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: grafeas.v1.GitSourceContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GitSourceContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RepoId. */ + interface IRepoId { + + /** RepoId projectRepoId */ + projectRepoId?: (grafeas.v1.IProjectRepoId|null); + + /** RepoId uid */ + uid?: (string|null); + } + + /** Represents a RepoId. */ + class RepoId implements IRepoId { + + /** + * Constructs a new RepoId. + * @param [properties] Properties to set + */ + constructor(properties?: grafeas.v1.IRepoId); + + /** RepoId projectRepoId. */ + public projectRepoId?: (grafeas.v1.IProjectRepoId|null); + + /** RepoId uid. */ + public uid?: (string|null); + + /** RepoId id. */ + public id?: ("projectRepoId"|"uid"); + + /** + * Creates a new RepoId instance using the specified properties. + * @param [properties] Properties to set + * @returns RepoId instance + */ + public static create(properties?: grafeas.v1.IRepoId): grafeas.v1.RepoId; + + /** + * Encodes the specified RepoId message. Does not implicitly {@link grafeas.v1.RepoId.verify|verify} messages. + * @param message RepoId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: grafeas.v1.IRepoId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RepoId message, length delimited. Does not implicitly {@link grafeas.v1.RepoId.verify|verify} messages. + * @param message RepoId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: grafeas.v1.IRepoId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RepoId message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RepoId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.RepoId; + + /** + * Decodes a RepoId message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RepoId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.RepoId; + + /** + * Verifies a RepoId message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RepoId message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RepoId + */ + public static fromObject(object: { [k: string]: any }): grafeas.v1.RepoId; + + /** + * Creates a plain object from a RepoId message. Also converts values to other types if specified. + * @param message RepoId + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: grafeas.v1.RepoId, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RepoId to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ProjectRepoId. */ + interface IProjectRepoId { + + /** ProjectRepoId projectId */ + projectId?: (string|null); + + /** ProjectRepoId repoName */ + repoName?: (string|null); + } + + /** Represents a ProjectRepoId. */ + class ProjectRepoId implements IProjectRepoId { + + /** + * Constructs a new ProjectRepoId. + * @param [properties] Properties to set + */ + constructor(properties?: grafeas.v1.IProjectRepoId); + + /** ProjectRepoId projectId. */ + public projectId: string; + + /** ProjectRepoId repoName. */ + public repoName: string; + + /** + * Creates a new ProjectRepoId instance using the specified properties. + * @param [properties] Properties to set + * @returns ProjectRepoId instance + */ + public static create(properties?: grafeas.v1.IProjectRepoId): grafeas.v1.ProjectRepoId; + + /** + * Encodes the specified ProjectRepoId message. Does not implicitly {@link grafeas.v1.ProjectRepoId.verify|verify} messages. + * @param message ProjectRepoId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: grafeas.v1.IProjectRepoId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProjectRepoId message, length delimited. Does not implicitly {@link grafeas.v1.ProjectRepoId.verify|verify} messages. + * @param message ProjectRepoId message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: grafeas.v1.IProjectRepoId, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProjectRepoId message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProjectRepoId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.ProjectRepoId; + + /** + * Decodes a ProjectRepoId message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProjectRepoId + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.ProjectRepoId; + + /** + * Verifies a ProjectRepoId message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CloudRepoSourceContext message from a plain object. Also converts values to their respective internal types. + * Creates a ProjectRepoId message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CloudRepoSourceContext + * @returns ProjectRepoId */ - public static fromObject(object: { [k: string]: any }): grafeas.v1.CloudRepoSourceContext; + public static fromObject(object: { [k: string]: any }): grafeas.v1.ProjectRepoId; /** - * Creates a plain object from a CloudRepoSourceContext message. Also converts values to other types if specified. - * @param message CloudRepoSourceContext + * Creates a plain object from a ProjectRepoId message. Also converts values to other types if specified. + * @param message ProjectRepoId * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: grafeas.v1.CloudRepoSourceContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: grafeas.v1.ProjectRepoId, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CloudRepoSourceContext to JSON. + * Converts this ProjectRepoId to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GerritSourceContext. */ - interface IGerritSourceContext { + /** Properties of a ComplianceNote. */ + interface IComplianceNote { - /** GerritSourceContext hostUri */ - hostUri?: (string|null); + /** ComplianceNote title */ + title?: (string|null); - /** GerritSourceContext gerritProject */ - gerritProject?: (string|null); + /** ComplianceNote description */ + description?: (string|null); - /** GerritSourceContext revisionId */ - revisionId?: (string|null); + /** ComplianceNote version */ + version?: (grafeas.v1.IComplianceVersion[]|null); - /** GerritSourceContext aliasContext */ - aliasContext?: (grafeas.v1.IAliasContext|null); + /** ComplianceNote rationale */ + rationale?: (string|null); + + /** ComplianceNote remediation */ + remediation?: (string|null); + + /** ComplianceNote cisBenchmark */ + cisBenchmark?: (grafeas.v1.ComplianceNote.ICisBenchmark|null); + + /** ComplianceNote scanInstructions */ + scanInstructions?: (Uint8Array|string|null); } - /** Represents a GerritSourceContext. */ - class GerritSourceContext implements IGerritSourceContext { + /** Represents a ComplianceNote. */ + class ComplianceNote implements IComplianceNote { /** - * Constructs a new GerritSourceContext. + * Constructs a new ComplianceNote. * @param [properties] Properties to set */ - constructor(properties?: grafeas.v1.IGerritSourceContext); + constructor(properties?: grafeas.v1.IComplianceNote); - /** GerritSourceContext hostUri. */ - public hostUri: string; + /** ComplianceNote title. */ + public title: string; - /** GerritSourceContext gerritProject. */ - public gerritProject: string; + /** ComplianceNote description. */ + public description: string; - /** GerritSourceContext revisionId. */ - public revisionId?: (string|null); + /** ComplianceNote version. */ + public version: grafeas.v1.IComplianceVersion[]; - /** GerritSourceContext aliasContext. */ - public aliasContext?: (grafeas.v1.IAliasContext|null); + /** ComplianceNote rationale. */ + public rationale: string; - /** GerritSourceContext revision. */ - public revision?: ("revisionId"|"aliasContext"); + /** ComplianceNote remediation. */ + public remediation: string; + + /** ComplianceNote cisBenchmark. */ + public cisBenchmark?: (grafeas.v1.ComplianceNote.ICisBenchmark|null); + + /** ComplianceNote scanInstructions. */ + public scanInstructions: (Uint8Array|string); + + /** ComplianceNote complianceType. */ + public complianceType?: "cisBenchmark"; /** - * Creates a new GerritSourceContext instance using the specified properties. + * Creates a new ComplianceNote instance using the specified properties. * @param [properties] Properties to set - * @returns GerritSourceContext instance + * @returns ComplianceNote instance */ - public static create(properties?: grafeas.v1.IGerritSourceContext): grafeas.v1.GerritSourceContext; + public static create(properties?: grafeas.v1.IComplianceNote): grafeas.v1.ComplianceNote; /** - * Encodes the specified GerritSourceContext message. Does not implicitly {@link grafeas.v1.GerritSourceContext.verify|verify} messages. - * @param message GerritSourceContext message or plain object to encode + * Encodes the specified ComplianceNote message. Does not implicitly {@link grafeas.v1.ComplianceNote.verify|verify} messages. + * @param message ComplianceNote message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: grafeas.v1.IGerritSourceContext, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: grafeas.v1.IComplianceNote, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GerritSourceContext message, length delimited. Does not implicitly {@link grafeas.v1.GerritSourceContext.verify|verify} messages. - * @param message GerritSourceContext message or plain object to encode + * Encodes the specified ComplianceNote message, length delimited. Does not implicitly {@link grafeas.v1.ComplianceNote.verify|verify} messages. + * @param message ComplianceNote message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: grafeas.v1.IGerritSourceContext, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: grafeas.v1.IComplianceNote, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GerritSourceContext message from the specified reader or buffer. + * Decodes a ComplianceNote message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GerritSourceContext + * @returns ComplianceNote * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.GerritSourceContext; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.ComplianceNote; /** - * Decodes a GerritSourceContext message from the specified reader or buffer, length delimited. + * Decodes a ComplianceNote message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GerritSourceContext + * @returns ComplianceNote * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.GerritSourceContext; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.ComplianceNote; /** - * Verifies a GerritSourceContext message. + * Verifies a ComplianceNote message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GerritSourceContext message from a plain object. Also converts values to their respective internal types. + * Creates a ComplianceNote message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GerritSourceContext + * @returns ComplianceNote */ - public static fromObject(object: { [k: string]: any }): grafeas.v1.GerritSourceContext; + public static fromObject(object: { [k: string]: any }): grafeas.v1.ComplianceNote; /** - * Creates a plain object from a GerritSourceContext message. Also converts values to other types if specified. - * @param message GerritSourceContext + * Creates a plain object from a ComplianceNote message. Also converts values to other types if specified. + * @param message ComplianceNote * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: grafeas.v1.GerritSourceContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: grafeas.v1.ComplianceNote, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GerritSourceContext to JSON. + * Converts this ComplianceNote to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GitSourceContext. */ - interface IGitSourceContext { + namespace ComplianceNote { - /** GitSourceContext url */ - url?: (string|null); + /** Properties of a CisBenchmark. */ + interface ICisBenchmark { - /** GitSourceContext revisionId */ - revisionId?: (string|null); + /** CisBenchmark profileLevel */ + profileLevel?: (number|null); + + /** CisBenchmark severity */ + severity?: (grafeas.v1.Severity|keyof typeof grafeas.v1.Severity|null); + } + + /** Represents a CisBenchmark. */ + class CisBenchmark implements ICisBenchmark { + + /** + * Constructs a new CisBenchmark. + * @param [properties] Properties to set + */ + constructor(properties?: grafeas.v1.ComplianceNote.ICisBenchmark); + + /** CisBenchmark profileLevel. */ + public profileLevel: number; + + /** CisBenchmark severity. */ + public severity: (grafeas.v1.Severity|keyof typeof grafeas.v1.Severity); + + /** + * Creates a new CisBenchmark instance using the specified properties. + * @param [properties] Properties to set + * @returns CisBenchmark instance + */ + public static create(properties?: grafeas.v1.ComplianceNote.ICisBenchmark): grafeas.v1.ComplianceNote.CisBenchmark; + + /** + * Encodes the specified CisBenchmark message. Does not implicitly {@link grafeas.v1.ComplianceNote.CisBenchmark.verify|verify} messages. + * @param message CisBenchmark message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: grafeas.v1.ComplianceNote.ICisBenchmark, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CisBenchmark message, length delimited. Does not implicitly {@link grafeas.v1.ComplianceNote.CisBenchmark.verify|verify} messages. + * @param message CisBenchmark message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: grafeas.v1.ComplianceNote.ICisBenchmark, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CisBenchmark message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CisBenchmark + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.ComplianceNote.CisBenchmark; + + /** + * Decodes a CisBenchmark message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CisBenchmark + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.ComplianceNote.CisBenchmark; + + /** + * Verifies a CisBenchmark message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CisBenchmark message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CisBenchmark + */ + public static fromObject(object: { [k: string]: any }): grafeas.v1.ComplianceNote.CisBenchmark; + + /** + * Creates a plain object from a CisBenchmark message. Also converts values to other types if specified. + * @param message CisBenchmark + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: grafeas.v1.ComplianceNote.CisBenchmark, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CisBenchmark to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } - /** Represents a GitSourceContext. */ - class GitSourceContext implements IGitSourceContext { + /** Properties of a ComplianceVersion. */ + interface IComplianceVersion { + + /** ComplianceVersion cpeUri */ + cpeUri?: (string|null); + + /** ComplianceVersion version */ + version?: (string|null); + } + + /** Represents a ComplianceVersion. */ + class ComplianceVersion implements IComplianceVersion { /** - * Constructs a new GitSourceContext. + * Constructs a new ComplianceVersion. * @param [properties] Properties to set */ - constructor(properties?: grafeas.v1.IGitSourceContext); + constructor(properties?: grafeas.v1.IComplianceVersion); - /** GitSourceContext url. */ - public url: string; + /** ComplianceVersion cpeUri. */ + public cpeUri: string; - /** GitSourceContext revisionId. */ - public revisionId: string; + /** ComplianceVersion version. */ + public version: string; /** - * Creates a new GitSourceContext instance using the specified properties. + * Creates a new ComplianceVersion instance using the specified properties. * @param [properties] Properties to set - * @returns GitSourceContext instance + * @returns ComplianceVersion instance */ - public static create(properties?: grafeas.v1.IGitSourceContext): grafeas.v1.GitSourceContext; + public static create(properties?: grafeas.v1.IComplianceVersion): grafeas.v1.ComplianceVersion; /** - * Encodes the specified GitSourceContext message. Does not implicitly {@link grafeas.v1.GitSourceContext.verify|verify} messages. - * @param message GitSourceContext message or plain object to encode + * Encodes the specified ComplianceVersion message. Does not implicitly {@link grafeas.v1.ComplianceVersion.verify|verify} messages. + * @param message ComplianceVersion message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: grafeas.v1.IGitSourceContext, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: grafeas.v1.IComplianceVersion, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GitSourceContext message, length delimited. Does not implicitly {@link grafeas.v1.GitSourceContext.verify|verify} messages. - * @param message GitSourceContext message or plain object to encode + * Encodes the specified ComplianceVersion message, length delimited. Does not implicitly {@link grafeas.v1.ComplianceVersion.verify|verify} messages. + * @param message ComplianceVersion message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: grafeas.v1.IGitSourceContext, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: grafeas.v1.IComplianceVersion, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GitSourceContext message from the specified reader or buffer. + * Decodes a ComplianceVersion message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GitSourceContext + * @returns ComplianceVersion * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.GitSourceContext; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.ComplianceVersion; /** - * Decodes a GitSourceContext message from the specified reader or buffer, length delimited. + * Decodes a ComplianceVersion message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GitSourceContext + * @returns ComplianceVersion * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.GitSourceContext; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.ComplianceVersion; /** - * Verifies a GitSourceContext message. + * Verifies a ComplianceVersion message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GitSourceContext message from a plain object. Also converts values to their respective internal types. + * Creates a ComplianceVersion message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GitSourceContext + * @returns ComplianceVersion */ - public static fromObject(object: { [k: string]: any }): grafeas.v1.GitSourceContext; + public static fromObject(object: { [k: string]: any }): grafeas.v1.ComplianceVersion; /** - * Creates a plain object from a GitSourceContext message. Also converts values to other types if specified. - * @param message GitSourceContext + * Creates a plain object from a ComplianceVersion message. Also converts values to other types if specified. + * @param message ComplianceVersion * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: grafeas.v1.GitSourceContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: grafeas.v1.ComplianceVersion, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GitSourceContext to JSON. + * Converts this ComplianceVersion to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a RepoId. */ - interface IRepoId { + /** Properties of a ComplianceOccurrence. */ + interface IComplianceOccurrence { - /** RepoId projectRepoId */ - projectRepoId?: (grafeas.v1.IProjectRepoId|null); + /** ComplianceOccurrence nonCompliantFiles */ + nonCompliantFiles?: (grafeas.v1.INonCompliantFile[]|null); - /** RepoId uid */ - uid?: (string|null); + /** ComplianceOccurrence nonComplianceReason */ + nonComplianceReason?: (string|null); } - /** Represents a RepoId. */ - class RepoId implements IRepoId { + /** Represents a ComplianceOccurrence. */ + class ComplianceOccurrence implements IComplianceOccurrence { /** - * Constructs a new RepoId. + * Constructs a new ComplianceOccurrence. * @param [properties] Properties to set */ - constructor(properties?: grafeas.v1.IRepoId); - - /** RepoId projectRepoId. */ - public projectRepoId?: (grafeas.v1.IProjectRepoId|null); + constructor(properties?: grafeas.v1.IComplianceOccurrence); - /** RepoId uid. */ - public uid?: (string|null); + /** ComplianceOccurrence nonCompliantFiles. */ + public nonCompliantFiles: grafeas.v1.INonCompliantFile[]; - /** RepoId id. */ - public id?: ("projectRepoId"|"uid"); + /** ComplianceOccurrence nonComplianceReason. */ + public nonComplianceReason: string; /** - * Creates a new RepoId instance using the specified properties. + * Creates a new ComplianceOccurrence instance using the specified properties. * @param [properties] Properties to set - * @returns RepoId instance + * @returns ComplianceOccurrence instance */ - public static create(properties?: grafeas.v1.IRepoId): grafeas.v1.RepoId; + public static create(properties?: grafeas.v1.IComplianceOccurrence): grafeas.v1.ComplianceOccurrence; /** - * Encodes the specified RepoId message. Does not implicitly {@link grafeas.v1.RepoId.verify|verify} messages. - * @param message RepoId message or plain object to encode + * Encodes the specified ComplianceOccurrence message. Does not implicitly {@link grafeas.v1.ComplianceOccurrence.verify|verify} messages. + * @param message ComplianceOccurrence message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: grafeas.v1.IRepoId, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: grafeas.v1.IComplianceOccurrence, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RepoId message, length delimited. Does not implicitly {@link grafeas.v1.RepoId.verify|verify} messages. - * @param message RepoId message or plain object to encode + * Encodes the specified ComplianceOccurrence message, length delimited. Does not implicitly {@link grafeas.v1.ComplianceOccurrence.verify|verify} messages. + * @param message ComplianceOccurrence message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: grafeas.v1.IRepoId, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: grafeas.v1.IComplianceOccurrence, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RepoId message from the specified reader or buffer. + * Decodes a ComplianceOccurrence message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RepoId + * @returns ComplianceOccurrence * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.RepoId; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.ComplianceOccurrence; /** - * Decodes a RepoId message from the specified reader or buffer, length delimited. + * Decodes a ComplianceOccurrence message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RepoId + * @returns ComplianceOccurrence * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.RepoId; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.ComplianceOccurrence; /** - * Verifies a RepoId message. + * Verifies a ComplianceOccurrence message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a RepoId message from a plain object. Also converts values to their respective internal types. + * Creates a ComplianceOccurrence message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RepoId + * @returns ComplianceOccurrence */ - public static fromObject(object: { [k: string]: any }): grafeas.v1.RepoId; + public static fromObject(object: { [k: string]: any }): grafeas.v1.ComplianceOccurrence; /** - * Creates a plain object from a RepoId message. Also converts values to other types if specified. - * @param message RepoId + * Creates a plain object from a ComplianceOccurrence message. Also converts values to other types if specified. + * @param message ComplianceOccurrence * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: grafeas.v1.RepoId, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: grafeas.v1.ComplianceOccurrence, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RepoId to JSON. + * Converts this ComplianceOccurrence to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ProjectRepoId. */ - interface IProjectRepoId { + /** Properties of a NonCompliantFile. */ + interface INonCompliantFile { - /** ProjectRepoId projectId */ - projectId?: (string|null); + /** NonCompliantFile path */ + path?: (string|null); - /** ProjectRepoId repoName */ - repoName?: (string|null); + /** NonCompliantFile displayCommand */ + displayCommand?: (string|null); + + /** NonCompliantFile reason */ + reason?: (string|null); } - /** Represents a ProjectRepoId. */ - class ProjectRepoId implements IProjectRepoId { + /** Represents a NonCompliantFile. */ + class NonCompliantFile implements INonCompliantFile { /** - * Constructs a new ProjectRepoId. + * Constructs a new NonCompliantFile. * @param [properties] Properties to set */ - constructor(properties?: grafeas.v1.IProjectRepoId); + constructor(properties?: grafeas.v1.INonCompliantFile); - /** ProjectRepoId projectId. */ - public projectId: string; + /** NonCompliantFile path. */ + public path: string; - /** ProjectRepoId repoName. */ - public repoName: string; + /** NonCompliantFile displayCommand. */ + public displayCommand: string; + + /** NonCompliantFile reason. */ + public reason: string; /** - * Creates a new ProjectRepoId instance using the specified properties. + * Creates a new NonCompliantFile instance using the specified properties. * @param [properties] Properties to set - * @returns ProjectRepoId instance + * @returns NonCompliantFile instance */ - public static create(properties?: grafeas.v1.IProjectRepoId): grafeas.v1.ProjectRepoId; + public static create(properties?: grafeas.v1.INonCompliantFile): grafeas.v1.NonCompliantFile; /** - * Encodes the specified ProjectRepoId message. Does not implicitly {@link grafeas.v1.ProjectRepoId.verify|verify} messages. - * @param message ProjectRepoId message or plain object to encode + * Encodes the specified NonCompliantFile message. Does not implicitly {@link grafeas.v1.NonCompliantFile.verify|verify} messages. + * @param message NonCompliantFile message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: grafeas.v1.IProjectRepoId, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: grafeas.v1.INonCompliantFile, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ProjectRepoId message, length delimited. Does not implicitly {@link grafeas.v1.ProjectRepoId.verify|verify} messages. - * @param message ProjectRepoId message or plain object to encode + * Encodes the specified NonCompliantFile message, length delimited. Does not implicitly {@link grafeas.v1.NonCompliantFile.verify|verify} messages. + * @param message NonCompliantFile message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: grafeas.v1.IProjectRepoId, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: grafeas.v1.INonCompliantFile, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ProjectRepoId message from the specified reader or buffer. + * Decodes a NonCompliantFile message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ProjectRepoId + * @returns NonCompliantFile * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.ProjectRepoId; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.NonCompliantFile; /** - * Decodes a ProjectRepoId message from the specified reader or buffer, length delimited. + * Decodes a NonCompliantFile message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ProjectRepoId + * @returns NonCompliantFile * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.ProjectRepoId; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.NonCompliantFile; /** - * Verifies a ProjectRepoId message. + * Verifies a NonCompliantFile message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ProjectRepoId message from a plain object. Also converts values to their respective internal types. + * Creates a NonCompliantFile message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ProjectRepoId + * @returns NonCompliantFile */ - public static fromObject(object: { [k: string]: any }): grafeas.v1.ProjectRepoId; + public static fromObject(object: { [k: string]: any }): grafeas.v1.NonCompliantFile; /** - * Creates a plain object from a ProjectRepoId message. Also converts values to other types if specified. - * @param message ProjectRepoId + * Creates a plain object from a NonCompliantFile message. Also converts values to other types if specified. + * @param message NonCompliantFile * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: grafeas.v1.ProjectRepoId, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: grafeas.v1.NonCompliantFile, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ProjectRepoId to JSON. + * Converts this NonCompliantFile to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; @@ -4052,6 +6382,288 @@ export namespace grafeas { } } + /** Properties of a DSSEAttestationNote. */ + interface IDSSEAttestationNote { + + /** DSSEAttestationNote hint */ + hint?: (grafeas.v1.DSSEAttestationNote.IDSSEHint|null); + } + + /** Represents a DSSEAttestationNote. */ + class DSSEAttestationNote implements IDSSEAttestationNote { + + /** + * Constructs a new DSSEAttestationNote. + * @param [properties] Properties to set + */ + constructor(properties?: grafeas.v1.IDSSEAttestationNote); + + /** DSSEAttestationNote hint. */ + public hint?: (grafeas.v1.DSSEAttestationNote.IDSSEHint|null); + + /** + * Creates a new DSSEAttestationNote instance using the specified properties. + * @param [properties] Properties to set + * @returns DSSEAttestationNote instance + */ + public static create(properties?: grafeas.v1.IDSSEAttestationNote): grafeas.v1.DSSEAttestationNote; + + /** + * Encodes the specified DSSEAttestationNote message. Does not implicitly {@link grafeas.v1.DSSEAttestationNote.verify|verify} messages. + * @param message DSSEAttestationNote message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: grafeas.v1.IDSSEAttestationNote, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DSSEAttestationNote message, length delimited. Does not implicitly {@link grafeas.v1.DSSEAttestationNote.verify|verify} messages. + * @param message DSSEAttestationNote message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: grafeas.v1.IDSSEAttestationNote, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DSSEAttestationNote message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DSSEAttestationNote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.DSSEAttestationNote; + + /** + * Decodes a DSSEAttestationNote message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DSSEAttestationNote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.DSSEAttestationNote; + + /** + * Verifies a DSSEAttestationNote message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DSSEAttestationNote message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DSSEAttestationNote + */ + public static fromObject(object: { [k: string]: any }): grafeas.v1.DSSEAttestationNote; + + /** + * Creates a plain object from a DSSEAttestationNote message. Also converts values to other types if specified. + * @param message DSSEAttestationNote + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: grafeas.v1.DSSEAttestationNote, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DSSEAttestationNote to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace DSSEAttestationNote { + + /** Properties of a DSSEHint. */ + interface IDSSEHint { + + /** DSSEHint humanReadableName */ + humanReadableName?: (string|null); + } + + /** Represents a DSSEHint. */ + class DSSEHint implements IDSSEHint { + + /** + * Constructs a new DSSEHint. + * @param [properties] Properties to set + */ + constructor(properties?: grafeas.v1.DSSEAttestationNote.IDSSEHint); + + /** DSSEHint humanReadableName. */ + public humanReadableName: string; + + /** + * Creates a new DSSEHint instance using the specified properties. + * @param [properties] Properties to set + * @returns DSSEHint instance + */ + public static create(properties?: grafeas.v1.DSSEAttestationNote.IDSSEHint): grafeas.v1.DSSEAttestationNote.DSSEHint; + + /** + * Encodes the specified DSSEHint message. Does not implicitly {@link grafeas.v1.DSSEAttestationNote.DSSEHint.verify|verify} messages. + * @param message DSSEHint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: grafeas.v1.DSSEAttestationNote.IDSSEHint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DSSEHint message, length delimited. Does not implicitly {@link grafeas.v1.DSSEAttestationNote.DSSEHint.verify|verify} messages. + * @param message DSSEHint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: grafeas.v1.DSSEAttestationNote.IDSSEHint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DSSEHint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DSSEHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.DSSEAttestationNote.DSSEHint; + + /** + * Decodes a DSSEHint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DSSEHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.DSSEAttestationNote.DSSEHint; + + /** + * Verifies a DSSEHint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DSSEHint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DSSEHint + */ + public static fromObject(object: { [k: string]: any }): grafeas.v1.DSSEAttestationNote.DSSEHint; + + /** + * Creates a plain object from a DSSEHint message. Also converts values to other types if specified. + * @param message DSSEHint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: grafeas.v1.DSSEAttestationNote.DSSEHint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DSSEHint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a DSSEAttestationOccurrence. */ + interface IDSSEAttestationOccurrence { + + /** DSSEAttestationOccurrence envelope */ + envelope?: (grafeas.v1.IEnvelope|null); + + /** DSSEAttestationOccurrence statement */ + statement?: (grafeas.v1.IInTotoStatement|null); + } + + /** Represents a DSSEAttestationOccurrence. */ + class DSSEAttestationOccurrence implements IDSSEAttestationOccurrence { + + /** + * Constructs a new DSSEAttestationOccurrence. + * @param [properties] Properties to set + */ + constructor(properties?: grafeas.v1.IDSSEAttestationOccurrence); + + /** DSSEAttestationOccurrence envelope. */ + public envelope?: (grafeas.v1.IEnvelope|null); + + /** DSSEAttestationOccurrence statement. */ + public statement?: (grafeas.v1.IInTotoStatement|null); + + /** DSSEAttestationOccurrence decodedPayload. */ + public decodedPayload?: "statement"; + + /** + * Creates a new DSSEAttestationOccurrence instance using the specified properties. + * @param [properties] Properties to set + * @returns DSSEAttestationOccurrence instance + */ + public static create(properties?: grafeas.v1.IDSSEAttestationOccurrence): grafeas.v1.DSSEAttestationOccurrence; + + /** + * Encodes the specified DSSEAttestationOccurrence message. Does not implicitly {@link grafeas.v1.DSSEAttestationOccurrence.verify|verify} messages. + * @param message DSSEAttestationOccurrence message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: grafeas.v1.IDSSEAttestationOccurrence, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DSSEAttestationOccurrence message, length delimited. Does not implicitly {@link grafeas.v1.DSSEAttestationOccurrence.verify|verify} messages. + * @param message DSSEAttestationOccurrence message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: grafeas.v1.IDSSEAttestationOccurrence, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DSSEAttestationOccurrence message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DSSEAttestationOccurrence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): grafeas.v1.DSSEAttestationOccurrence; + + /** + * Decodes a DSSEAttestationOccurrence message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DSSEAttestationOccurrence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): grafeas.v1.DSSEAttestationOccurrence; + + /** + * Verifies a DSSEAttestationOccurrence message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DSSEAttestationOccurrence message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DSSEAttestationOccurrence + */ + public static fromObject(object: { [k: string]: any }): grafeas.v1.DSSEAttestationOccurrence; + + /** + * Creates a plain object from a DSSEAttestationOccurrence message. Also converts values to other types if specified. + * @param message DSSEAttestationOccurrence + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: grafeas.v1.DSSEAttestationOccurrence, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DSSEAttestationOccurrence to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + /** Represents a Grafeas */ class Grafeas extends $protobuf.rpc.Service { @@ -4417,6 +7029,15 @@ export namespace grafeas { /** Occurrence upgrade */ upgrade?: (grafeas.v1.IUpgradeOccurrence|null); + + /** Occurrence compliance */ + compliance?: (grafeas.v1.IComplianceOccurrence|null); + + /** Occurrence dsseAttestation */ + dsseAttestation?: (grafeas.v1.IDSSEAttestationOccurrence|null); + + /** Occurrence envelope */ + envelope?: (grafeas.v1.IEnvelope|null); } /** Represents an Occurrence. */ @@ -4473,8 +7094,17 @@ export namespace grafeas { /** Occurrence upgrade. */ public upgrade?: (grafeas.v1.IUpgradeOccurrence|null); + /** Occurrence compliance. */ + public compliance?: (grafeas.v1.IComplianceOccurrence|null); + + /** Occurrence dsseAttestation. */ + public dsseAttestation?: (grafeas.v1.IDSSEAttestationOccurrence|null); + + /** Occurrence envelope. */ + public envelope?: (grafeas.v1.IEnvelope|null); + /** Occurrence details. */ - public details?: ("vulnerability"|"build"|"image"|"package"|"deployment"|"discovery"|"attestation"|"upgrade"); + public details?: ("vulnerability"|"build"|"image"|"package"|"deployment"|"discovery"|"attestation"|"upgrade"|"compliance"|"dsseAttestation"); /** * Creates a new Occurrence instance using the specified properties. @@ -4600,6 +7230,12 @@ export namespace grafeas { /** Note upgrade */ upgrade?: (grafeas.v1.IUpgradeNote|null); + + /** Note compliance */ + compliance?: (grafeas.v1.IComplianceNote|null); + + /** Note dsseAttestation */ + dsseAttestation?: (grafeas.v1.IDSSEAttestationNote|null); } /** Represents a Note. */ @@ -4662,8 +7298,14 @@ export namespace grafeas { /** Note upgrade. */ public upgrade?: (grafeas.v1.IUpgradeNote|null); + /** Note compliance. */ + public compliance?: (grafeas.v1.IComplianceNote|null); + + /** Note dsseAttestation. */ + public dsseAttestation?: (grafeas.v1.IDSSEAttestationNote|null); + /** Note type. */ - public type?: ("vulnerability"|"build"|"image"|"package"|"deployment"|"discovery"|"attestation"|"upgrade"); + public type?: ("vulnerability"|"build"|"image"|"package"|"deployment"|"discovery"|"attestation"|"upgrade"|"compliance"|"dsseAttestation"); /** * Creates a new Note instance using the specified properties. diff --git a/packages/google-devtools-containeranalysis/protos/protos.js b/packages/google-devtools-containeranalysis/protos/protos.js index 8a710e3418b..87df0275ecf 100644 --- a/packages/google-devtools-containeranalysis/protos/protos.js +++ b/packages/google-devtools-containeranalysis/protos/protos.js @@ -470,6 +470,8 @@ * @property {grafeas.v1.IVersion|null} [fixedVersion] Detail fixedVersion * @property {boolean|null} [isObsolete] Detail isObsolete * @property {google.protobuf.ITimestamp|null} [sourceUpdateTime] Detail sourceUpdateTime + * @property {string|null} [source] Detail source + * @property {string|null} [vendor] Detail vendor */ /** @@ -583,6 +585,22 @@ */ Detail.prototype.sourceUpdateTime = null; + /** + * Detail source. + * @member {string} source + * @memberof grafeas.v1.VulnerabilityNote.Detail + * @instance + */ + Detail.prototype.source = ""; + + /** + * Detail vendor. + * @member {string} vendor + * @memberof grafeas.v1.VulnerabilityNote.Detail + * @instance + */ + Detail.prototype.vendor = ""; + /** * Creates a new Detail instance using the specified properties. * @function create @@ -631,6 +649,10 @@ writer.uint32(/* id 11, wireType 0 =*/88).bool(message.isObsolete); if (message.sourceUpdateTime != null && Object.hasOwnProperty.call(message, "sourceUpdateTime")) $root.google.protobuf.Timestamp.encode(message.sourceUpdateTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.source); + if (message.vendor != null && Object.hasOwnProperty.call(message, "vendor")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.vendor); return writer; }; @@ -701,6 +723,12 @@ case 12: message.sourceUpdateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; + case 13: + message.source = reader.string(); + break; + case 14: + message.vendor = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -780,6 +808,12 @@ if (error) return "sourceUpdateTime." + error; } + if (message.source != null && message.hasOwnProperty("source")) + if (!$util.isString(message.source)) + return "source: string expected"; + if (message.vendor != null && message.hasOwnProperty("vendor")) + if (!$util.isString(message.vendor)) + return "vendor: string expected"; return null; }; @@ -831,6 +865,10 @@ throw TypeError(".grafeas.v1.VulnerabilityNote.Detail.sourceUpdateTime: object expected"); message.sourceUpdateTime = $root.google.protobuf.Timestamp.fromObject(object.sourceUpdateTime); } + if (object.source != null) + message.source = String(object.source); + if (object.vendor != null) + message.vendor = String(object.vendor); return message; }; @@ -860,6 +898,8 @@ object.fixedVersion = null; object.isObsolete = false; object.sourceUpdateTime = null; + object.source = ""; + object.vendor = ""; } if (message.severityName != null && message.hasOwnProperty("severityName")) object.severityName = message.severityName; @@ -885,6 +925,10 @@ object.isObsolete = message.isObsolete; if (message.sourceUpdateTime != null && message.hasOwnProperty("sourceUpdateTime")) object.sourceUpdateTime = $root.google.protobuf.Timestamp.toObject(message.sourceUpdateTime, options); + if (message.source != null && message.hasOwnProperty("source")) + object.source = message.source; + if (message.vendor != null && message.hasOwnProperty("vendor")) + object.vendor = message.vendor; return object; }; @@ -1400,6 +1444,7 @@ * @property {string|null} [type] VulnerabilityOccurrence type * @property {grafeas.v1.Severity|null} [severity] VulnerabilityOccurrence severity * @property {number|null} [cvssScore] VulnerabilityOccurrence cvssScore + * @property {grafeas.v1.VulnerabilityOccurrence.ICVSSV3|null} [cvssv3] VulnerabilityOccurrence cvssv3 * @property {Array.|null} [packageIssue] VulnerabilityOccurrence packageIssue * @property {string|null} [shortDescription] VulnerabilityOccurrence shortDescription * @property {string|null} [longDescription] VulnerabilityOccurrence longDescription @@ -1449,6 +1494,14 @@ */ VulnerabilityOccurrence.prototype.cvssScore = 0; + /** + * VulnerabilityOccurrence cvssv3. + * @member {grafeas.v1.VulnerabilityOccurrence.ICVSSV3|null|undefined} cvssv3 + * @memberof grafeas.v1.VulnerabilityOccurrence + * @instance + */ + VulnerabilityOccurrence.prototype.cvssv3 = null; + /** * VulnerabilityOccurrence packageIssue. * @member {Array.} packageIssue @@ -1541,6 +1594,8 @@ writer.uint32(/* id 8, wireType 0 =*/64).int32(message.effectiveSeverity); if (message.fixAvailable != null && Object.hasOwnProperty.call(message, "fixAvailable")) writer.uint32(/* id 9, wireType 0 =*/72).bool(message.fixAvailable); + if (message.cvssv3 != null && Object.hasOwnProperty.call(message, "cvssv3")) + $root.grafeas.v1.VulnerabilityOccurrence.CVSSV3.encode(message.cvssv3, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); return writer; }; @@ -1584,6 +1639,9 @@ case 3: message.cvssScore = reader.float(); break; + case 10: + message.cvssv3 = $root.grafeas.v1.VulnerabilityOccurrence.CVSSV3.decode(reader, reader.uint32()); + break; case 4: if (!(message.packageIssue && message.packageIssue.length)) message.packageIssue = []; @@ -1659,6 +1717,11 @@ if (message.cvssScore != null && message.hasOwnProperty("cvssScore")) if (typeof message.cvssScore !== "number") return "cvssScore: number expected"; + if (message.cvssv3 != null && message.hasOwnProperty("cvssv3")) { + var error = $root.grafeas.v1.VulnerabilityOccurrence.CVSSV3.verify(message.cvssv3); + if (error) + return "cvssv3." + error; + } if (message.packageIssue != null && message.hasOwnProperty("packageIssue")) { if (!Array.isArray(message.packageIssue)) return "packageIssue: array expected"; @@ -1743,6 +1806,11 @@ } if (object.cvssScore != null) message.cvssScore = Number(object.cvssScore); + if (object.cvssv3 != null) { + if (typeof object.cvssv3 !== "object") + throw TypeError(".grafeas.v1.VulnerabilityOccurrence.cvssv3: object expected"); + message.cvssv3 = $root.grafeas.v1.VulnerabilityOccurrence.CVSSV3.fromObject(object.cvssv3); + } if (object.packageIssue) { if (!Array.isArray(object.packageIssue)) throw TypeError(".grafeas.v1.VulnerabilityOccurrence.packageIssue: array expected"); @@ -1823,6 +1891,7 @@ object.longDescription = ""; object.effectiveSeverity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; object.fixAvailable = false; + object.cvssv3 = null; } if (message.type != null && message.hasOwnProperty("type")) object.type = message.type; @@ -1848,6 +1917,8 @@ object.effectiveSeverity = options.enums === String ? $root.grafeas.v1.Severity[message.effectiveSeverity] : message.effectiveSeverity; if (message.fixAvailable != null && message.hasOwnProperty("fixAvailable")) object.fixAvailable = message.fixAvailable; + if (message.cvssv3 != null && message.hasOwnProperty("cvssv3")) + object.cvssv3 = $root.grafeas.v1.VulnerabilityOccurrence.CVSSV3.toObject(message.cvssv3, options); return object; }; @@ -1862,6 +1933,249 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + VulnerabilityOccurrence.CVSSV3 = (function() { + + /** + * Properties of a CVSSV3. + * @memberof grafeas.v1.VulnerabilityOccurrence + * @interface ICVSSV3 + * @property {number|null} [baseScore] CVSSV3 baseScore + * @property {grafeas.v1.Severity|null} [severity] CVSSV3 severity + */ + + /** + * Constructs a new CVSSV3. + * @memberof grafeas.v1.VulnerabilityOccurrence + * @classdesc Represents a CVSSV3. + * @implements ICVSSV3 + * @constructor + * @param {grafeas.v1.VulnerabilityOccurrence.ICVSSV3=} [properties] Properties to set + */ + function CVSSV3(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CVSSV3 baseScore. + * @member {number} baseScore + * @memberof grafeas.v1.VulnerabilityOccurrence.CVSSV3 + * @instance + */ + CVSSV3.prototype.baseScore = 0; + + /** + * CVSSV3 severity. + * @member {grafeas.v1.Severity} severity + * @memberof grafeas.v1.VulnerabilityOccurrence.CVSSV3 + * @instance + */ + CVSSV3.prototype.severity = 0; + + /** + * Creates a new CVSSV3 instance using the specified properties. + * @function create + * @memberof grafeas.v1.VulnerabilityOccurrence.CVSSV3 + * @static + * @param {grafeas.v1.VulnerabilityOccurrence.ICVSSV3=} [properties] Properties to set + * @returns {grafeas.v1.VulnerabilityOccurrence.CVSSV3} CVSSV3 instance + */ + CVSSV3.create = function create(properties) { + return new CVSSV3(properties); + }; + + /** + * Encodes the specified CVSSV3 message. Does not implicitly {@link grafeas.v1.VulnerabilityOccurrence.CVSSV3.verify|verify} messages. + * @function encode + * @memberof grafeas.v1.VulnerabilityOccurrence.CVSSV3 + * @static + * @param {grafeas.v1.VulnerabilityOccurrence.ICVSSV3} message CVSSV3 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CVSSV3.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.baseScore != null && Object.hasOwnProperty.call(message, "baseScore")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.baseScore); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.severity); + return writer; + }; + + /** + * Encodes the specified CVSSV3 message, length delimited. Does not implicitly {@link grafeas.v1.VulnerabilityOccurrence.CVSSV3.verify|verify} messages. + * @function encodeDelimited + * @memberof grafeas.v1.VulnerabilityOccurrence.CVSSV3 + * @static + * @param {grafeas.v1.VulnerabilityOccurrence.ICVSSV3} message CVSSV3 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CVSSV3.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CVSSV3 message from the specified reader or buffer. + * @function decode + * @memberof grafeas.v1.VulnerabilityOccurrence.CVSSV3 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {grafeas.v1.VulnerabilityOccurrence.CVSSV3} CVSSV3 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CVSSV3.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.VulnerabilityOccurrence.CVSSV3(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.baseScore = reader.float(); + break; + case 2: + message.severity = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CVSSV3 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof grafeas.v1.VulnerabilityOccurrence.CVSSV3 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {grafeas.v1.VulnerabilityOccurrence.CVSSV3} CVSSV3 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CVSSV3.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CVSSV3 message. + * @function verify + * @memberof grafeas.v1.VulnerabilityOccurrence.CVSSV3 + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CVSSV3.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.baseScore != null && message.hasOwnProperty("baseScore")) + if (typeof message.baseScore !== "number") + return "baseScore: number expected"; + if (message.severity != null && message.hasOwnProperty("severity")) + switch (message.severity) { + default: + return "severity: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a CVSSV3 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof grafeas.v1.VulnerabilityOccurrence.CVSSV3 + * @static + * @param {Object.} object Plain object + * @returns {grafeas.v1.VulnerabilityOccurrence.CVSSV3} CVSSV3 + */ + CVSSV3.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.VulnerabilityOccurrence.CVSSV3) + return object; + var message = new $root.grafeas.v1.VulnerabilityOccurrence.CVSSV3(); + if (object.baseScore != null) + message.baseScore = Number(object.baseScore); + switch (object.severity) { + case "SEVERITY_UNSPECIFIED": + case 0: + message.severity = 0; + break; + case "MINIMAL": + case 1: + message.severity = 1; + break; + case "LOW": + case 2: + message.severity = 2; + break; + case "MEDIUM": + case 3: + message.severity = 3; + break; + case "HIGH": + case 4: + message.severity = 4; + break; + case "CRITICAL": + case 5: + message.severity = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a CVSSV3 message. Also converts values to other types if specified. + * @function toObject + * @memberof grafeas.v1.VulnerabilityOccurrence.CVSSV3 + * @static + * @param {grafeas.v1.VulnerabilityOccurrence.CVSSV3} message CVSSV3 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CVSSV3.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.baseScore = 0; + object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; + } + if (message.baseScore != null && message.hasOwnProperty("baseScore")) + object.baseScore = options.json && !isFinite(message.baseScore) ? String(message.baseScore) : message.baseScore; + if (message.severity != null && message.hasOwnProperty("severity")) + object.severity = options.enums === String ? $root.grafeas.v1.Severity[message.severity] : message.severity; + return object; + }; + + /** + * Converts this CVSSV3 to JSON. + * @function toJSON + * @memberof grafeas.v1.VulnerabilityOccurrence.CVSSV3 + * @instance + * @returns {Object.} JSON object + */ + CVSSV3.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CVSSV3; + })(); + VulnerabilityOccurrence.PackageIssue = (function() { /** @@ -1875,6 +2189,8 @@ * @property {string|null} [fixedPackage] PackageIssue fixedPackage * @property {grafeas.v1.IVersion|null} [fixedVersion] PackageIssue fixedVersion * @property {boolean|null} [fixAvailable] PackageIssue fixAvailable + * @property {string|null} [packageType] PackageIssue packageType + * @property {grafeas.v1.Severity|null} [effectiveSeverity] PackageIssue effectiveSeverity */ /** @@ -1948,6 +2264,22 @@ */ PackageIssue.prototype.fixAvailable = false; + /** + * PackageIssue packageType. + * @member {string} packageType + * @memberof grafeas.v1.VulnerabilityOccurrence.PackageIssue + * @instance + */ + PackageIssue.prototype.packageType = ""; + + /** + * PackageIssue effectiveSeverity. + * @member {grafeas.v1.Severity} effectiveSeverity + * @memberof grafeas.v1.VulnerabilityOccurrence.PackageIssue + * @instance + */ + PackageIssue.prototype.effectiveSeverity = 0; + /** * Creates a new PackageIssue instance using the specified properties. * @function create @@ -1986,6 +2318,10 @@ $root.grafeas.v1.Version.encode(message.fixedVersion, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); if (message.fixAvailable != null && Object.hasOwnProperty.call(message, "fixAvailable")) writer.uint32(/* id 7, wireType 0 =*/56).bool(message.fixAvailable); + if (message.packageType != null && Object.hasOwnProperty.call(message, "packageType")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.packageType); + if (message.effectiveSeverity != null && Object.hasOwnProperty.call(message, "effectiveSeverity")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.effectiveSeverity); return writer; }; @@ -2041,6 +2377,12 @@ case 7: message.fixAvailable = reader.bool(); break; + case 8: + message.packageType = reader.string(); + break; + case 9: + message.effectiveSeverity = reader.int32(); + break; default: reader.skipType(tag & 7); break; @@ -2101,6 +2443,21 @@ if (message.fixAvailable != null && message.hasOwnProperty("fixAvailable")) if (typeof message.fixAvailable !== "boolean") return "fixAvailable: boolean expected"; + if (message.packageType != null && message.hasOwnProperty("packageType")) + if (!$util.isString(message.packageType)) + return "packageType: string expected"; + if (message.effectiveSeverity != null && message.hasOwnProperty("effectiveSeverity")) + switch (message.effectiveSeverity) { + default: + return "effectiveSeverity: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } return null; }; @@ -2136,19 +2493,47 @@ } if (object.fixAvailable != null) message.fixAvailable = Boolean(object.fixAvailable); - return message; - }; - - /** - * Creates a plain object from a PackageIssue message. Also converts values to other types if specified. - * @function toObject - * @memberof grafeas.v1.VulnerabilityOccurrence.PackageIssue - * @static - * @param {grafeas.v1.VulnerabilityOccurrence.PackageIssue} message PackageIssue - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PackageIssue.toObject = function toObject(message, options) { + if (object.packageType != null) + message.packageType = String(object.packageType); + switch (object.effectiveSeverity) { + case "SEVERITY_UNSPECIFIED": + case 0: + message.effectiveSeverity = 0; + break; + case "MINIMAL": + case 1: + message.effectiveSeverity = 1; + break; + case "LOW": + case 2: + message.effectiveSeverity = 2; + break; + case "MEDIUM": + case 3: + message.effectiveSeverity = 3; + break; + case "HIGH": + case 4: + message.effectiveSeverity = 4; + break; + case "CRITICAL": + case 5: + message.effectiveSeverity = 5; + break; + } + return message; + }; + + /** + * Creates a plain object from a PackageIssue message. Also converts values to other types if specified. + * @function toObject + * @memberof grafeas.v1.VulnerabilityOccurrence.PackageIssue + * @static + * @param {grafeas.v1.VulnerabilityOccurrence.PackageIssue} message PackageIssue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PackageIssue.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -2160,6 +2545,8 @@ object.fixedPackage = ""; object.fixedVersion = null; object.fixAvailable = false; + object.packageType = ""; + object.effectiveSeverity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; } if (message.affectedCpeUri != null && message.hasOwnProperty("affectedCpeUri")) object.affectedCpeUri = message.affectedCpeUri; @@ -2175,6 +2562,10 @@ object.fixedVersion = $root.grafeas.v1.Version.toObject(message.fixedVersion, options); if (message.fixAvailable != null && message.hasOwnProperty("fixAvailable")) object.fixAvailable = message.fixAvailable; + if (message.packageType != null && message.hasOwnProperty("packageType")) + object.packageType = message.packageType; + if (message.effectiveSeverity != null && message.hasOwnProperty("effectiveSeverity")) + object.effectiveSeverity = options.enums === String ? $root.grafeas.v1.Severity[message.effectiveSeverity] : message.effectiveSeverity; return object; }; @@ -2208,6 +2599,8 @@ * @property {number} DISCOVERY=6 DISCOVERY value * @property {number} ATTESTATION=7 ATTESTATION value * @property {number} UPGRADE=8 UPGRADE value + * @property {number} COMPLIANCE=9 COMPLIANCE value + * @property {number} DSSE_ATTESTATION=10 DSSE_ATTESTATION value */ v1.NoteKind = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -2220,6 +2613,8 @@ values[valuesById[6] = "DISCOVERY"] = 6; values[valuesById[7] = "ATTESTATION"] = 7; values[valuesById[8] = "UPGRADE"] = 8; + values[valuesById[9] = "COMPLIANCE"] = 9; + values[valuesById[10] = "DSSE_ATTESTATION"] = 10; return values; })(); @@ -2652,34 +3047,27 @@ return Signature; })(); - v1.CVSSv3 = (function() { + v1.Envelope = (function() { /** - * Properties of a CVSSv3. + * Properties of an Envelope. * @memberof grafeas.v1 - * @interface ICVSSv3 - * @property {number|null} [baseScore] CVSSv3 baseScore - * @property {number|null} [exploitabilityScore] CVSSv3 exploitabilityScore - * @property {number|null} [impactScore] CVSSv3 impactScore - * @property {grafeas.v1.CVSSv3.AttackVector|null} [attackVector] CVSSv3 attackVector - * @property {grafeas.v1.CVSSv3.AttackComplexity|null} [attackComplexity] CVSSv3 attackComplexity - * @property {grafeas.v1.CVSSv3.PrivilegesRequired|null} [privilegesRequired] CVSSv3 privilegesRequired - * @property {grafeas.v1.CVSSv3.UserInteraction|null} [userInteraction] CVSSv3 userInteraction - * @property {grafeas.v1.CVSSv3.Scope|null} [scope] CVSSv3 scope - * @property {grafeas.v1.CVSSv3.Impact|null} [confidentialityImpact] CVSSv3 confidentialityImpact - * @property {grafeas.v1.CVSSv3.Impact|null} [integrityImpact] CVSSv3 integrityImpact - * @property {grafeas.v1.CVSSv3.Impact|null} [availabilityImpact] CVSSv3 availabilityImpact + * @interface IEnvelope + * @property {Uint8Array|null} [payload] Envelope payload + * @property {string|null} [payloadType] Envelope payloadType + * @property {Array.|null} [signatures] Envelope signatures */ /** - * Constructs a new CVSSv3. + * Constructs a new Envelope. * @memberof grafeas.v1 - * @classdesc Represents a CVSSv3. - * @implements ICVSSv3 + * @classdesc Represents an Envelope. + * @implements IEnvelope * @constructor - * @param {grafeas.v1.ICVSSv3=} [properties] Properties to set + * @param {grafeas.v1.IEnvelope=} [properties] Properties to set */ - function CVSSv3(properties) { + function Envelope(properties) { + this.signatures = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2687,205 +3075,104 @@ } /** - * CVSSv3 baseScore. - * @member {number} baseScore - * @memberof grafeas.v1.CVSSv3 - * @instance - */ - CVSSv3.prototype.baseScore = 0; - - /** - * CVSSv3 exploitabilityScore. - * @member {number} exploitabilityScore - * @memberof grafeas.v1.CVSSv3 - * @instance - */ - CVSSv3.prototype.exploitabilityScore = 0; - - /** - * CVSSv3 impactScore. - * @member {number} impactScore - * @memberof grafeas.v1.CVSSv3 - * @instance - */ - CVSSv3.prototype.impactScore = 0; - - /** - * CVSSv3 attackVector. - * @member {grafeas.v1.CVSSv3.AttackVector} attackVector - * @memberof grafeas.v1.CVSSv3 - * @instance - */ - CVSSv3.prototype.attackVector = 0; - - /** - * CVSSv3 attackComplexity. - * @member {grafeas.v1.CVSSv3.AttackComplexity} attackComplexity - * @memberof grafeas.v1.CVSSv3 - * @instance - */ - CVSSv3.prototype.attackComplexity = 0; - - /** - * CVSSv3 privilegesRequired. - * @member {grafeas.v1.CVSSv3.PrivilegesRequired} privilegesRequired - * @memberof grafeas.v1.CVSSv3 - * @instance - */ - CVSSv3.prototype.privilegesRequired = 0; - - /** - * CVSSv3 userInteraction. - * @member {grafeas.v1.CVSSv3.UserInteraction} userInteraction - * @memberof grafeas.v1.CVSSv3 - * @instance - */ - CVSSv3.prototype.userInteraction = 0; - - /** - * CVSSv3 scope. - * @member {grafeas.v1.CVSSv3.Scope} scope - * @memberof grafeas.v1.CVSSv3 - * @instance - */ - CVSSv3.prototype.scope = 0; - - /** - * CVSSv3 confidentialityImpact. - * @member {grafeas.v1.CVSSv3.Impact} confidentialityImpact - * @memberof grafeas.v1.CVSSv3 + * Envelope payload. + * @member {Uint8Array} payload + * @memberof grafeas.v1.Envelope * @instance */ - CVSSv3.prototype.confidentialityImpact = 0; + Envelope.prototype.payload = $util.newBuffer([]); /** - * CVSSv3 integrityImpact. - * @member {grafeas.v1.CVSSv3.Impact} integrityImpact - * @memberof grafeas.v1.CVSSv3 + * Envelope payloadType. + * @member {string} payloadType + * @memberof grafeas.v1.Envelope * @instance */ - CVSSv3.prototype.integrityImpact = 0; + Envelope.prototype.payloadType = ""; /** - * CVSSv3 availabilityImpact. - * @member {grafeas.v1.CVSSv3.Impact} availabilityImpact - * @memberof grafeas.v1.CVSSv3 + * Envelope signatures. + * @member {Array.} signatures + * @memberof grafeas.v1.Envelope * @instance */ - CVSSv3.prototype.availabilityImpact = 0; + Envelope.prototype.signatures = $util.emptyArray; /** - * Creates a new CVSSv3 instance using the specified properties. + * Creates a new Envelope instance using the specified properties. * @function create - * @memberof grafeas.v1.CVSSv3 + * @memberof grafeas.v1.Envelope * @static - * @param {grafeas.v1.ICVSSv3=} [properties] Properties to set - * @returns {grafeas.v1.CVSSv3} CVSSv3 instance + * @param {grafeas.v1.IEnvelope=} [properties] Properties to set + * @returns {grafeas.v1.Envelope} Envelope instance */ - CVSSv3.create = function create(properties) { - return new CVSSv3(properties); + Envelope.create = function create(properties) { + return new Envelope(properties); }; /** - * Encodes the specified CVSSv3 message. Does not implicitly {@link grafeas.v1.CVSSv3.verify|verify} messages. + * Encodes the specified Envelope message. Does not implicitly {@link grafeas.v1.Envelope.verify|verify} messages. * @function encode - * @memberof grafeas.v1.CVSSv3 + * @memberof grafeas.v1.Envelope * @static - * @param {grafeas.v1.ICVSSv3} message CVSSv3 message or plain object to encode + * @param {grafeas.v1.IEnvelope} message Envelope message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CVSSv3.encode = function encode(message, writer) { + Envelope.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.baseScore != null && Object.hasOwnProperty.call(message, "baseScore")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.baseScore); - if (message.exploitabilityScore != null && Object.hasOwnProperty.call(message, "exploitabilityScore")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.exploitabilityScore); - if (message.impactScore != null && Object.hasOwnProperty.call(message, "impactScore")) - writer.uint32(/* id 3, wireType 5 =*/29).float(message.impactScore); - if (message.attackVector != null && Object.hasOwnProperty.call(message, "attackVector")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.attackVector); - if (message.attackComplexity != null && Object.hasOwnProperty.call(message, "attackComplexity")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.attackComplexity); - if (message.privilegesRequired != null && Object.hasOwnProperty.call(message, "privilegesRequired")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.privilegesRequired); - if (message.userInteraction != null && Object.hasOwnProperty.call(message, "userInteraction")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.userInteraction); - if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.scope); - if (message.confidentialityImpact != null && Object.hasOwnProperty.call(message, "confidentialityImpact")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.confidentialityImpact); - if (message.integrityImpact != null && Object.hasOwnProperty.call(message, "integrityImpact")) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.integrityImpact); - if (message.availabilityImpact != null && Object.hasOwnProperty.call(message, "availabilityImpact")) - writer.uint32(/* id 12, wireType 0 =*/96).int32(message.availabilityImpact); + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.payload); + if (message.payloadType != null && Object.hasOwnProperty.call(message, "payloadType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.payloadType); + if (message.signatures != null && message.signatures.length) + for (var i = 0; i < message.signatures.length; ++i) + $root.grafeas.v1.EnvelopeSignature.encode(message.signatures[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified CVSSv3 message, length delimited. Does not implicitly {@link grafeas.v1.CVSSv3.verify|verify} messages. + * Encodes the specified Envelope message, length delimited. Does not implicitly {@link grafeas.v1.Envelope.verify|verify} messages. * @function encodeDelimited - * @memberof grafeas.v1.CVSSv3 + * @memberof grafeas.v1.Envelope * @static - * @param {grafeas.v1.ICVSSv3} message CVSSv3 message or plain object to encode + * @param {grafeas.v1.IEnvelope} message Envelope message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CVSSv3.encodeDelimited = function encodeDelimited(message, writer) { + Envelope.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CVSSv3 message from the specified reader or buffer. + * Decodes an Envelope message from the specified reader or buffer. * @function decode - * @memberof grafeas.v1.CVSSv3 + * @memberof grafeas.v1.Envelope * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {grafeas.v1.CVSSv3} CVSSv3 + * @returns {grafeas.v1.Envelope} Envelope * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CVSSv3.decode = function decode(reader, length) { + Envelope.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.CVSSv3(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.Envelope(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.baseScore = reader.float(); + message.payload = reader.bytes(); break; case 2: - message.exploitabilityScore = reader.float(); + message.payloadType = reader.string(); break; case 3: - message.impactScore = reader.float(); - break; - case 5: - message.attackVector = reader.int32(); - break; - case 6: - message.attackComplexity = reader.int32(); - break; - case 7: - message.privilegesRequired = reader.int32(); - break; - case 8: - message.userInteraction = reader.int32(); - break; - case 9: - message.scope = reader.int32(); - break; - case 10: - message.confidentialityImpact = reader.int32(); - break; - case 11: - message.integrityImpact = reader.int32(); - break; - case 12: - message.availabilityImpact = reader.int32(); + if (!(message.signatures && message.signatures.length)) + message.signatures = []; + message.signatures.push($root.grafeas.v1.EnvelopeSignature.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -2896,487 +3183,152 @@ }; /** - * Decodes a CVSSv3 message from the specified reader or buffer, length delimited. + * Decodes an Envelope message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof grafeas.v1.CVSSv3 + * @memberof grafeas.v1.Envelope * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {grafeas.v1.CVSSv3} CVSSv3 + * @returns {grafeas.v1.Envelope} Envelope * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CVSSv3.decodeDelimited = function decodeDelimited(reader) { + Envelope.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CVSSv3 message. + * Verifies an Envelope message. * @function verify - * @memberof grafeas.v1.CVSSv3 + * @memberof grafeas.v1.Envelope * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CVSSv3.verify = function verify(message) { + Envelope.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.baseScore != null && message.hasOwnProperty("baseScore")) - if (typeof message.baseScore !== "number") - return "baseScore: number expected"; - if (message.exploitabilityScore != null && message.hasOwnProperty("exploitabilityScore")) - if (typeof message.exploitabilityScore !== "number") - return "exploitabilityScore: number expected"; - if (message.impactScore != null && message.hasOwnProperty("impactScore")) - if (typeof message.impactScore !== "number") - return "impactScore: number expected"; - if (message.attackVector != null && message.hasOwnProperty("attackVector")) - switch (message.attackVector) { - default: - return "attackVector: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.attackComplexity != null && message.hasOwnProperty("attackComplexity")) - switch (message.attackComplexity) { - default: - return "attackComplexity: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.privilegesRequired != null && message.hasOwnProperty("privilegesRequired")) - switch (message.privilegesRequired) { - default: - return "privilegesRequired: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.userInteraction != null && message.hasOwnProperty("userInteraction")) - switch (message.userInteraction) { - default: - return "userInteraction: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.scope != null && message.hasOwnProperty("scope")) - switch (message.scope) { - default: - return "scope: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.confidentialityImpact != null && message.hasOwnProperty("confidentialityImpact")) - switch (message.confidentialityImpact) { - default: - return "confidentialityImpact: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.integrityImpact != null && message.hasOwnProperty("integrityImpact")) - switch (message.integrityImpact) { - default: - return "integrityImpact: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.availabilityImpact != null && message.hasOwnProperty("availabilityImpact")) - switch (message.availabilityImpact) { - default: - return "availabilityImpact: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; + if (message.payload != null && message.hasOwnProperty("payload")) + if (!(message.payload && typeof message.payload.length === "number" || $util.isString(message.payload))) + return "payload: buffer expected"; + if (message.payloadType != null && message.hasOwnProperty("payloadType")) + if (!$util.isString(message.payloadType)) + return "payloadType: string expected"; + if (message.signatures != null && message.hasOwnProperty("signatures")) { + if (!Array.isArray(message.signatures)) + return "signatures: array expected"; + for (var i = 0; i < message.signatures.length; ++i) { + var error = $root.grafeas.v1.EnvelopeSignature.verify(message.signatures[i]); + if (error) + return "signatures." + error; } + } return null; }; /** - * Creates a CVSSv3 message from a plain object. Also converts values to their respective internal types. + * Creates an Envelope message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof grafeas.v1.CVSSv3 + * @memberof grafeas.v1.Envelope * @static * @param {Object.} object Plain object - * @returns {grafeas.v1.CVSSv3} CVSSv3 + * @returns {grafeas.v1.Envelope} Envelope */ - CVSSv3.fromObject = function fromObject(object) { - if (object instanceof $root.grafeas.v1.CVSSv3) + Envelope.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.Envelope) return object; - var message = new $root.grafeas.v1.CVSSv3(); - if (object.baseScore != null) - message.baseScore = Number(object.baseScore); - if (object.exploitabilityScore != null) - message.exploitabilityScore = Number(object.exploitabilityScore); - if (object.impactScore != null) - message.impactScore = Number(object.impactScore); - switch (object.attackVector) { - case "ATTACK_VECTOR_UNSPECIFIED": - case 0: - message.attackVector = 0; - break; - case "ATTACK_VECTOR_NETWORK": - case 1: - message.attackVector = 1; - break; - case "ATTACK_VECTOR_ADJACENT": - case 2: - message.attackVector = 2; - break; - case "ATTACK_VECTOR_LOCAL": - case 3: - message.attackVector = 3; - break; - case "ATTACK_VECTOR_PHYSICAL": - case 4: - message.attackVector = 4; - break; - } - switch (object.attackComplexity) { - case "ATTACK_COMPLEXITY_UNSPECIFIED": - case 0: - message.attackComplexity = 0; - break; - case "ATTACK_COMPLEXITY_LOW": - case 1: - message.attackComplexity = 1; - break; - case "ATTACK_COMPLEXITY_HIGH": - case 2: - message.attackComplexity = 2; - break; - } - switch (object.privilegesRequired) { - case "PRIVILEGES_REQUIRED_UNSPECIFIED": - case 0: - message.privilegesRequired = 0; - break; - case "PRIVILEGES_REQUIRED_NONE": - case 1: - message.privilegesRequired = 1; - break; - case "PRIVILEGES_REQUIRED_LOW": - case 2: - message.privilegesRequired = 2; - break; - case "PRIVILEGES_REQUIRED_HIGH": - case 3: - message.privilegesRequired = 3; - break; - } - switch (object.userInteraction) { - case "USER_INTERACTION_UNSPECIFIED": - case 0: - message.userInteraction = 0; - break; - case "USER_INTERACTION_NONE": - case 1: - message.userInteraction = 1; - break; - case "USER_INTERACTION_REQUIRED": - case 2: - message.userInteraction = 2; - break; - } - switch (object.scope) { - case "SCOPE_UNSPECIFIED": - case 0: - message.scope = 0; - break; - case "SCOPE_UNCHANGED": - case 1: - message.scope = 1; - break; - case "SCOPE_CHANGED": - case 2: - message.scope = 2; - break; - } - switch (object.confidentialityImpact) { - case "IMPACT_UNSPECIFIED": - case 0: - message.confidentialityImpact = 0; - break; - case "IMPACT_HIGH": - case 1: - message.confidentialityImpact = 1; - break; - case "IMPACT_LOW": - case 2: - message.confidentialityImpact = 2; - break; - case "IMPACT_NONE": - case 3: - message.confidentialityImpact = 3; - break; - } - switch (object.integrityImpact) { - case "IMPACT_UNSPECIFIED": - case 0: - message.integrityImpact = 0; - break; - case "IMPACT_HIGH": - case 1: - message.integrityImpact = 1; - break; - case "IMPACT_LOW": - case 2: - message.integrityImpact = 2; - break; - case "IMPACT_NONE": - case 3: - message.integrityImpact = 3; - break; - } - switch (object.availabilityImpact) { - case "IMPACT_UNSPECIFIED": - case 0: - message.availabilityImpact = 0; - break; - case "IMPACT_HIGH": - case 1: - message.availabilityImpact = 1; - break; - case "IMPACT_LOW": - case 2: - message.availabilityImpact = 2; - break; - case "IMPACT_NONE": - case 3: - message.availabilityImpact = 3; - break; + var message = new $root.grafeas.v1.Envelope(); + if (object.payload != null) + if (typeof object.payload === "string") + $util.base64.decode(object.payload, message.payload = $util.newBuffer($util.base64.length(object.payload)), 0); + else if (object.payload.length) + message.payload = object.payload; + if (object.payloadType != null) + message.payloadType = String(object.payloadType); + if (object.signatures) { + if (!Array.isArray(object.signatures)) + throw TypeError(".grafeas.v1.Envelope.signatures: array expected"); + message.signatures = []; + for (var i = 0; i < object.signatures.length; ++i) { + if (typeof object.signatures[i] !== "object") + throw TypeError(".grafeas.v1.Envelope.signatures: object expected"); + message.signatures[i] = $root.grafeas.v1.EnvelopeSignature.fromObject(object.signatures[i]); + } } return message; }; /** - * Creates a plain object from a CVSSv3 message. Also converts values to other types if specified. + * Creates a plain object from an Envelope message. Also converts values to other types if specified. * @function toObject - * @memberof grafeas.v1.CVSSv3 + * @memberof grafeas.v1.Envelope * @static - * @param {grafeas.v1.CVSSv3} message CVSSv3 + * @param {grafeas.v1.Envelope} message Envelope * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CVSSv3.toObject = function toObject(message, options) { + Envelope.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.signatures = []; if (options.defaults) { - object.baseScore = 0; - object.exploitabilityScore = 0; - object.impactScore = 0; - object.attackVector = options.enums === String ? "ATTACK_VECTOR_UNSPECIFIED" : 0; - object.attackComplexity = options.enums === String ? "ATTACK_COMPLEXITY_UNSPECIFIED" : 0; - object.privilegesRequired = options.enums === String ? "PRIVILEGES_REQUIRED_UNSPECIFIED" : 0; - object.userInteraction = options.enums === String ? "USER_INTERACTION_UNSPECIFIED" : 0; - object.scope = options.enums === String ? "SCOPE_UNSPECIFIED" : 0; - object.confidentialityImpact = options.enums === String ? "IMPACT_UNSPECIFIED" : 0; - object.integrityImpact = options.enums === String ? "IMPACT_UNSPECIFIED" : 0; - object.availabilityImpact = options.enums === String ? "IMPACT_UNSPECIFIED" : 0; + if (options.bytes === String) + object.payload = ""; + else { + object.payload = []; + if (options.bytes !== Array) + object.payload = $util.newBuffer(object.payload); + } + object.payloadType = ""; } - if (message.baseScore != null && message.hasOwnProperty("baseScore")) - object.baseScore = options.json && !isFinite(message.baseScore) ? String(message.baseScore) : message.baseScore; - if (message.exploitabilityScore != null && message.hasOwnProperty("exploitabilityScore")) - object.exploitabilityScore = options.json && !isFinite(message.exploitabilityScore) ? String(message.exploitabilityScore) : message.exploitabilityScore; - if (message.impactScore != null && message.hasOwnProperty("impactScore")) - object.impactScore = options.json && !isFinite(message.impactScore) ? String(message.impactScore) : message.impactScore; - if (message.attackVector != null && message.hasOwnProperty("attackVector")) - object.attackVector = options.enums === String ? $root.grafeas.v1.CVSSv3.AttackVector[message.attackVector] : message.attackVector; - if (message.attackComplexity != null && message.hasOwnProperty("attackComplexity")) - object.attackComplexity = options.enums === String ? $root.grafeas.v1.CVSSv3.AttackComplexity[message.attackComplexity] : message.attackComplexity; - if (message.privilegesRequired != null && message.hasOwnProperty("privilegesRequired")) - object.privilegesRequired = options.enums === String ? $root.grafeas.v1.CVSSv3.PrivilegesRequired[message.privilegesRequired] : message.privilegesRequired; - if (message.userInteraction != null && message.hasOwnProperty("userInteraction")) - object.userInteraction = options.enums === String ? $root.grafeas.v1.CVSSv3.UserInteraction[message.userInteraction] : message.userInteraction; - if (message.scope != null && message.hasOwnProperty("scope")) - object.scope = options.enums === String ? $root.grafeas.v1.CVSSv3.Scope[message.scope] : message.scope; - if (message.confidentialityImpact != null && message.hasOwnProperty("confidentialityImpact")) - object.confidentialityImpact = options.enums === String ? $root.grafeas.v1.CVSSv3.Impact[message.confidentialityImpact] : message.confidentialityImpact; - if (message.integrityImpact != null && message.hasOwnProperty("integrityImpact")) - object.integrityImpact = options.enums === String ? $root.grafeas.v1.CVSSv3.Impact[message.integrityImpact] : message.integrityImpact; - if (message.availabilityImpact != null && message.hasOwnProperty("availabilityImpact")) - object.availabilityImpact = options.enums === String ? $root.grafeas.v1.CVSSv3.Impact[message.availabilityImpact] : message.availabilityImpact; - return object; - }; + if (message.payload != null && message.hasOwnProperty("payload")) + object.payload = options.bytes === String ? $util.base64.encode(message.payload, 0, message.payload.length) : options.bytes === Array ? Array.prototype.slice.call(message.payload) : message.payload; + if (message.payloadType != null && message.hasOwnProperty("payloadType")) + object.payloadType = message.payloadType; + if (message.signatures && message.signatures.length) { + object.signatures = []; + for (var j = 0; j < message.signatures.length; ++j) + object.signatures[j] = $root.grafeas.v1.EnvelopeSignature.toObject(message.signatures[j], options); + } + return object; + }; /** - * Converts this CVSSv3 to JSON. + * Converts this Envelope to JSON. * @function toJSON - * @memberof grafeas.v1.CVSSv3 + * @memberof grafeas.v1.Envelope * @instance * @returns {Object.} JSON object */ - CVSSv3.prototype.toJSON = function toJSON() { + Envelope.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * AttackVector enum. - * @name grafeas.v1.CVSSv3.AttackVector - * @enum {number} - * @property {number} ATTACK_VECTOR_UNSPECIFIED=0 ATTACK_VECTOR_UNSPECIFIED value - * @property {number} ATTACK_VECTOR_NETWORK=1 ATTACK_VECTOR_NETWORK value - * @property {number} ATTACK_VECTOR_ADJACENT=2 ATTACK_VECTOR_ADJACENT value - * @property {number} ATTACK_VECTOR_LOCAL=3 ATTACK_VECTOR_LOCAL value - * @property {number} ATTACK_VECTOR_PHYSICAL=4 ATTACK_VECTOR_PHYSICAL value - */ - CVSSv3.AttackVector = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ATTACK_VECTOR_UNSPECIFIED"] = 0; - values[valuesById[1] = "ATTACK_VECTOR_NETWORK"] = 1; - values[valuesById[2] = "ATTACK_VECTOR_ADJACENT"] = 2; - values[valuesById[3] = "ATTACK_VECTOR_LOCAL"] = 3; - values[valuesById[4] = "ATTACK_VECTOR_PHYSICAL"] = 4; - return values; - })(); - - /** - * AttackComplexity enum. - * @name grafeas.v1.CVSSv3.AttackComplexity - * @enum {number} - * @property {number} ATTACK_COMPLEXITY_UNSPECIFIED=0 ATTACK_COMPLEXITY_UNSPECIFIED value - * @property {number} ATTACK_COMPLEXITY_LOW=1 ATTACK_COMPLEXITY_LOW value - * @property {number} ATTACK_COMPLEXITY_HIGH=2 ATTACK_COMPLEXITY_HIGH value - */ - CVSSv3.AttackComplexity = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ATTACK_COMPLEXITY_UNSPECIFIED"] = 0; - values[valuesById[1] = "ATTACK_COMPLEXITY_LOW"] = 1; - values[valuesById[2] = "ATTACK_COMPLEXITY_HIGH"] = 2; - return values; - })(); - - /** - * PrivilegesRequired enum. - * @name grafeas.v1.CVSSv3.PrivilegesRequired - * @enum {number} - * @property {number} PRIVILEGES_REQUIRED_UNSPECIFIED=0 PRIVILEGES_REQUIRED_UNSPECIFIED value - * @property {number} PRIVILEGES_REQUIRED_NONE=1 PRIVILEGES_REQUIRED_NONE value - * @property {number} PRIVILEGES_REQUIRED_LOW=2 PRIVILEGES_REQUIRED_LOW value - * @property {number} PRIVILEGES_REQUIRED_HIGH=3 PRIVILEGES_REQUIRED_HIGH value - */ - CVSSv3.PrivilegesRequired = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PRIVILEGES_REQUIRED_UNSPECIFIED"] = 0; - values[valuesById[1] = "PRIVILEGES_REQUIRED_NONE"] = 1; - values[valuesById[2] = "PRIVILEGES_REQUIRED_LOW"] = 2; - values[valuesById[3] = "PRIVILEGES_REQUIRED_HIGH"] = 3; - return values; - })(); - - /** - * UserInteraction enum. - * @name grafeas.v1.CVSSv3.UserInteraction - * @enum {number} - * @property {number} USER_INTERACTION_UNSPECIFIED=0 USER_INTERACTION_UNSPECIFIED value - * @property {number} USER_INTERACTION_NONE=1 USER_INTERACTION_NONE value - * @property {number} USER_INTERACTION_REQUIRED=2 USER_INTERACTION_REQUIRED value - */ - CVSSv3.UserInteraction = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "USER_INTERACTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "USER_INTERACTION_NONE"] = 1; - values[valuesById[2] = "USER_INTERACTION_REQUIRED"] = 2; - return values; - })(); - - /** - * Scope enum. - * @name grafeas.v1.CVSSv3.Scope - * @enum {number} - * @property {number} SCOPE_UNSPECIFIED=0 SCOPE_UNSPECIFIED value - * @property {number} SCOPE_UNCHANGED=1 SCOPE_UNCHANGED value - * @property {number} SCOPE_CHANGED=2 SCOPE_CHANGED value - */ - CVSSv3.Scope = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SCOPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SCOPE_UNCHANGED"] = 1; - values[valuesById[2] = "SCOPE_CHANGED"] = 2; - return values; - })(); - - /** - * Impact enum. - * @name grafeas.v1.CVSSv3.Impact - * @enum {number} - * @property {number} IMPACT_UNSPECIFIED=0 IMPACT_UNSPECIFIED value - * @property {number} IMPACT_HIGH=1 IMPACT_HIGH value - * @property {number} IMPACT_LOW=2 IMPACT_LOW value - * @property {number} IMPACT_NONE=3 IMPACT_NONE value - */ - CVSSv3.Impact = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "IMPACT_UNSPECIFIED"] = 0; - values[valuesById[1] = "IMPACT_HIGH"] = 1; - values[valuesById[2] = "IMPACT_LOW"] = 2; - values[valuesById[3] = "IMPACT_NONE"] = 3; - return values; - })(); - - return CVSSv3; - })(); - - /** - * Architecture enum. - * @name grafeas.v1.Architecture - * @enum {number} - * @property {number} ARCHITECTURE_UNSPECIFIED=0 ARCHITECTURE_UNSPECIFIED value - * @property {number} X86=1 X86 value - * @property {number} X64=2 X64 value - */ - v1.Architecture = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ARCHITECTURE_UNSPECIFIED"] = 0; - values[valuesById[1] = "X86"] = 1; - values[valuesById[2] = "X64"] = 2; - return values; + return Envelope; })(); - v1.Distribution = (function() { + v1.EnvelopeSignature = (function() { /** - * Properties of a Distribution. + * Properties of an EnvelopeSignature. * @memberof grafeas.v1 - * @interface IDistribution - * @property {string|null} [cpeUri] Distribution cpeUri - * @property {grafeas.v1.Architecture|null} [architecture] Distribution architecture - * @property {grafeas.v1.IVersion|null} [latestVersion] Distribution latestVersion - * @property {string|null} [maintainer] Distribution maintainer - * @property {string|null} [url] Distribution url - * @property {string|null} [description] Distribution description + * @interface IEnvelopeSignature + * @property {Uint8Array|null} [sig] EnvelopeSignature sig + * @property {string|null} [keyid] EnvelopeSignature keyid */ /** - * Constructs a new Distribution. + * Constructs a new EnvelopeSignature. * @memberof grafeas.v1 - * @classdesc Represents a Distribution. - * @implements IDistribution + * @classdesc Represents an EnvelopeSignature. + * @implements IEnvelopeSignature * @constructor - * @param {grafeas.v1.IDistribution=} [properties] Properties to set + * @param {grafeas.v1.IEnvelopeSignature=} [properties] Properties to set */ - function Distribution(properties) { + function EnvelopeSignature(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3384,140 +3336,88 @@ } /** - * Distribution cpeUri. - * @member {string} cpeUri - * @memberof grafeas.v1.Distribution - * @instance - */ - Distribution.prototype.cpeUri = ""; - - /** - * Distribution architecture. - * @member {grafeas.v1.Architecture} architecture - * @memberof grafeas.v1.Distribution - * @instance - */ - Distribution.prototype.architecture = 0; - - /** - * Distribution latestVersion. - * @member {grafeas.v1.IVersion|null|undefined} latestVersion - * @memberof grafeas.v1.Distribution - * @instance - */ - Distribution.prototype.latestVersion = null; - - /** - * Distribution maintainer. - * @member {string} maintainer - * @memberof grafeas.v1.Distribution - * @instance - */ - Distribution.prototype.maintainer = ""; - - /** - * Distribution url. - * @member {string} url - * @memberof grafeas.v1.Distribution + * EnvelopeSignature sig. + * @member {Uint8Array} sig + * @memberof grafeas.v1.EnvelopeSignature * @instance */ - Distribution.prototype.url = ""; + EnvelopeSignature.prototype.sig = $util.newBuffer([]); /** - * Distribution description. - * @member {string} description - * @memberof grafeas.v1.Distribution + * EnvelopeSignature keyid. + * @member {string} keyid + * @memberof grafeas.v1.EnvelopeSignature * @instance */ - Distribution.prototype.description = ""; + EnvelopeSignature.prototype.keyid = ""; /** - * Creates a new Distribution instance using the specified properties. + * Creates a new EnvelopeSignature instance using the specified properties. * @function create - * @memberof grafeas.v1.Distribution + * @memberof grafeas.v1.EnvelopeSignature * @static - * @param {grafeas.v1.IDistribution=} [properties] Properties to set - * @returns {grafeas.v1.Distribution} Distribution instance + * @param {grafeas.v1.IEnvelopeSignature=} [properties] Properties to set + * @returns {grafeas.v1.EnvelopeSignature} EnvelopeSignature instance */ - Distribution.create = function create(properties) { - return new Distribution(properties); + EnvelopeSignature.create = function create(properties) { + return new EnvelopeSignature(properties); }; /** - * Encodes the specified Distribution message. Does not implicitly {@link grafeas.v1.Distribution.verify|verify} messages. + * Encodes the specified EnvelopeSignature message. Does not implicitly {@link grafeas.v1.EnvelopeSignature.verify|verify} messages. * @function encode - * @memberof grafeas.v1.Distribution + * @memberof grafeas.v1.EnvelopeSignature * @static - * @param {grafeas.v1.IDistribution} message Distribution message or plain object to encode + * @param {grafeas.v1.IEnvelopeSignature} message EnvelopeSignature message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Distribution.encode = function encode(message, writer) { + EnvelopeSignature.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.cpeUri != null && Object.hasOwnProperty.call(message, "cpeUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.cpeUri); - if (message.architecture != null && Object.hasOwnProperty.call(message, "architecture")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.architecture); - if (message.latestVersion != null && Object.hasOwnProperty.call(message, "latestVersion")) - $root.grafeas.v1.Version.encode(message.latestVersion, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.maintainer != null && Object.hasOwnProperty.call(message, "maintainer")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.maintainer); - if (message.url != null && Object.hasOwnProperty.call(message, "url")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.url); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); + if (message.sig != null && Object.hasOwnProperty.call(message, "sig")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.sig); + if (message.keyid != null && Object.hasOwnProperty.call(message, "keyid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.keyid); return writer; }; /** - * Encodes the specified Distribution message, length delimited. Does not implicitly {@link grafeas.v1.Distribution.verify|verify} messages. + * Encodes the specified EnvelopeSignature message, length delimited. Does not implicitly {@link grafeas.v1.EnvelopeSignature.verify|verify} messages. * @function encodeDelimited - * @memberof grafeas.v1.Distribution + * @memberof grafeas.v1.EnvelopeSignature * @static - * @param {grafeas.v1.IDistribution} message Distribution message or plain object to encode + * @param {grafeas.v1.IEnvelopeSignature} message EnvelopeSignature message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Distribution.encodeDelimited = function encodeDelimited(message, writer) { + EnvelopeSignature.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Distribution message from the specified reader or buffer. + * Decodes an EnvelopeSignature message from the specified reader or buffer. * @function decode - * @memberof grafeas.v1.Distribution + * @memberof grafeas.v1.EnvelopeSignature * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {grafeas.v1.Distribution} Distribution + * @returns {grafeas.v1.EnvelopeSignature} EnvelopeSignature * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Distribution.decode = function decode(reader, length) { + EnvelopeSignature.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.Distribution(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.EnvelopeSignature(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.cpeUri = reader.string(); + message.sig = reader.bytes(); break; case 2: - message.architecture = reader.int32(); - break; - case 3: - message.latestVersion = $root.grafeas.v1.Version.decode(reader, reader.uint32()); - break; - case 4: - message.maintainer = reader.string(); - break; - case 5: - message.url = reader.string(); - break; - case 6: - message.description = reader.string(); + message.keyid = reader.string(); break; default: reader.skipType(tag & 7); @@ -3528,173 +3428,135 @@ }; /** - * Decodes a Distribution message from the specified reader or buffer, length delimited. + * Decodes an EnvelopeSignature message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof grafeas.v1.Distribution + * @memberof grafeas.v1.EnvelopeSignature * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {grafeas.v1.Distribution} Distribution + * @returns {grafeas.v1.EnvelopeSignature} EnvelopeSignature * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Distribution.decodeDelimited = function decodeDelimited(reader) { + EnvelopeSignature.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Distribution message. + * Verifies an EnvelopeSignature message. * @function verify - * @memberof grafeas.v1.Distribution + * @memberof grafeas.v1.EnvelopeSignature * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Distribution.verify = function verify(message) { + EnvelopeSignature.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.cpeUri != null && message.hasOwnProperty("cpeUri")) - if (!$util.isString(message.cpeUri)) - return "cpeUri: string expected"; - if (message.architecture != null && message.hasOwnProperty("architecture")) - switch (message.architecture) { - default: - return "architecture: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.latestVersion != null && message.hasOwnProperty("latestVersion")) { - var error = $root.grafeas.v1.Version.verify(message.latestVersion); - if (error) - return "latestVersion." + error; - } - if (message.maintainer != null && message.hasOwnProperty("maintainer")) - if (!$util.isString(message.maintainer)) - return "maintainer: string expected"; - if (message.url != null && message.hasOwnProperty("url")) - if (!$util.isString(message.url)) - return "url: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; + if (message.sig != null && message.hasOwnProperty("sig")) + if (!(message.sig && typeof message.sig.length === "number" || $util.isString(message.sig))) + return "sig: buffer expected"; + if (message.keyid != null && message.hasOwnProperty("keyid")) + if (!$util.isString(message.keyid)) + return "keyid: string expected"; return null; }; /** - * Creates a Distribution message from a plain object. Also converts values to their respective internal types. + * Creates an EnvelopeSignature message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof grafeas.v1.Distribution + * @memberof grafeas.v1.EnvelopeSignature * @static * @param {Object.} object Plain object - * @returns {grafeas.v1.Distribution} Distribution + * @returns {grafeas.v1.EnvelopeSignature} EnvelopeSignature */ - Distribution.fromObject = function fromObject(object) { - if (object instanceof $root.grafeas.v1.Distribution) + EnvelopeSignature.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.EnvelopeSignature) return object; - var message = new $root.grafeas.v1.Distribution(); - if (object.cpeUri != null) - message.cpeUri = String(object.cpeUri); - switch (object.architecture) { - case "ARCHITECTURE_UNSPECIFIED": - case 0: - message.architecture = 0; - break; - case "X86": - case 1: - message.architecture = 1; - break; - case "X64": - case 2: - message.architecture = 2; - break; - } - if (object.latestVersion != null) { - if (typeof object.latestVersion !== "object") - throw TypeError(".grafeas.v1.Distribution.latestVersion: object expected"); - message.latestVersion = $root.grafeas.v1.Version.fromObject(object.latestVersion); - } - if (object.maintainer != null) - message.maintainer = String(object.maintainer); - if (object.url != null) - message.url = String(object.url); - if (object.description != null) - message.description = String(object.description); + var message = new $root.grafeas.v1.EnvelopeSignature(); + if (object.sig != null) + if (typeof object.sig === "string") + $util.base64.decode(object.sig, message.sig = $util.newBuffer($util.base64.length(object.sig)), 0); + else if (object.sig.length) + message.sig = object.sig; + if (object.keyid != null) + message.keyid = String(object.keyid); return message; }; /** - * Creates a plain object from a Distribution message. Also converts values to other types if specified. + * Creates a plain object from an EnvelopeSignature message. Also converts values to other types if specified. * @function toObject - * @memberof grafeas.v1.Distribution + * @memberof grafeas.v1.EnvelopeSignature * @static - * @param {grafeas.v1.Distribution} message Distribution + * @param {grafeas.v1.EnvelopeSignature} message EnvelopeSignature * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Distribution.toObject = function toObject(message, options) { + EnvelopeSignature.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.cpeUri = ""; - object.architecture = options.enums === String ? "ARCHITECTURE_UNSPECIFIED" : 0; - object.latestVersion = null; - object.maintainer = ""; - object.url = ""; - object.description = ""; + if (options.bytes === String) + object.sig = ""; + else { + object.sig = []; + if (options.bytes !== Array) + object.sig = $util.newBuffer(object.sig); + } + object.keyid = ""; } - if (message.cpeUri != null && message.hasOwnProperty("cpeUri")) - object.cpeUri = message.cpeUri; - if (message.architecture != null && message.hasOwnProperty("architecture")) - object.architecture = options.enums === String ? $root.grafeas.v1.Architecture[message.architecture] : message.architecture; - if (message.latestVersion != null && message.hasOwnProperty("latestVersion")) - object.latestVersion = $root.grafeas.v1.Version.toObject(message.latestVersion, options); - if (message.maintainer != null && message.hasOwnProperty("maintainer")) - object.maintainer = message.maintainer; - if (message.url != null && message.hasOwnProperty("url")) - object.url = message.url; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; + if (message.sig != null && message.hasOwnProperty("sig")) + object.sig = options.bytes === String ? $util.base64.encode(message.sig, 0, message.sig.length) : options.bytes === Array ? Array.prototype.slice.call(message.sig) : message.sig; + if (message.keyid != null && message.hasOwnProperty("keyid")) + object.keyid = message.keyid; return object; }; /** - * Converts this Distribution to JSON. + * Converts this EnvelopeSignature to JSON. * @function toJSON - * @memberof grafeas.v1.Distribution + * @memberof grafeas.v1.EnvelopeSignature * @instance * @returns {Object.} JSON object */ - Distribution.prototype.toJSON = function toJSON() { + EnvelopeSignature.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Distribution; + return EnvelopeSignature; })(); - v1.Location = (function() { + v1.CVSSv3 = (function() { /** - * Properties of a Location. + * Properties of a CVSSv3. * @memberof grafeas.v1 - * @interface ILocation - * @property {string|null} [cpeUri] Location cpeUri - * @property {grafeas.v1.IVersion|null} [version] Location version - * @property {string|null} [path] Location path + * @interface ICVSSv3 + * @property {number|null} [baseScore] CVSSv3 baseScore + * @property {number|null} [exploitabilityScore] CVSSv3 exploitabilityScore + * @property {number|null} [impactScore] CVSSv3 impactScore + * @property {grafeas.v1.CVSSv3.AttackVector|null} [attackVector] CVSSv3 attackVector + * @property {grafeas.v1.CVSSv3.AttackComplexity|null} [attackComplexity] CVSSv3 attackComplexity + * @property {grafeas.v1.CVSSv3.PrivilegesRequired|null} [privilegesRequired] CVSSv3 privilegesRequired + * @property {grafeas.v1.CVSSv3.UserInteraction|null} [userInteraction] CVSSv3 userInteraction + * @property {grafeas.v1.CVSSv3.Scope|null} [scope] CVSSv3 scope + * @property {grafeas.v1.CVSSv3.Impact|null} [confidentialityImpact] CVSSv3 confidentialityImpact + * @property {grafeas.v1.CVSSv3.Impact|null} [integrityImpact] CVSSv3 integrityImpact + * @property {grafeas.v1.CVSSv3.Impact|null} [availabilityImpact] CVSSv3 availabilityImpact */ /** - * Constructs a new Location. + * Constructs a new CVSSv3. * @memberof grafeas.v1 - * @classdesc Represents a Location. - * @implements ILocation + * @classdesc Represents a CVSSv3. + * @implements ICVSSv3 * @constructor - * @param {grafeas.v1.ILocation=} [properties] Properties to set + * @param {grafeas.v1.ICVSSv3=} [properties] Properties to set */ - function Location(properties) { + function CVSSv3(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3702,101 +3564,205 @@ } /** - * Location cpeUri. - * @member {string} cpeUri - * @memberof grafeas.v1.Location + * CVSSv3 baseScore. + * @member {number} baseScore + * @memberof grafeas.v1.CVSSv3 * @instance */ - Location.prototype.cpeUri = ""; + CVSSv3.prototype.baseScore = 0; /** - * Location version. - * @member {grafeas.v1.IVersion|null|undefined} version - * @memberof grafeas.v1.Location + * CVSSv3 exploitabilityScore. + * @member {number} exploitabilityScore + * @memberof grafeas.v1.CVSSv3 * @instance */ - Location.prototype.version = null; + CVSSv3.prototype.exploitabilityScore = 0; /** - * Location path. - * @member {string} path - * @memberof grafeas.v1.Location + * CVSSv3 impactScore. + * @member {number} impactScore + * @memberof grafeas.v1.CVSSv3 * @instance */ - Location.prototype.path = ""; + CVSSv3.prototype.impactScore = 0; /** - * Creates a new Location instance using the specified properties. + * CVSSv3 attackVector. + * @member {grafeas.v1.CVSSv3.AttackVector} attackVector + * @memberof grafeas.v1.CVSSv3 + * @instance + */ + CVSSv3.prototype.attackVector = 0; + + /** + * CVSSv3 attackComplexity. + * @member {grafeas.v1.CVSSv3.AttackComplexity} attackComplexity + * @memberof grafeas.v1.CVSSv3 + * @instance + */ + CVSSv3.prototype.attackComplexity = 0; + + /** + * CVSSv3 privilegesRequired. + * @member {grafeas.v1.CVSSv3.PrivilegesRequired} privilegesRequired + * @memberof grafeas.v1.CVSSv3 + * @instance + */ + CVSSv3.prototype.privilegesRequired = 0; + + /** + * CVSSv3 userInteraction. + * @member {grafeas.v1.CVSSv3.UserInteraction} userInteraction + * @memberof grafeas.v1.CVSSv3 + * @instance + */ + CVSSv3.prototype.userInteraction = 0; + + /** + * CVSSv3 scope. + * @member {grafeas.v1.CVSSv3.Scope} scope + * @memberof grafeas.v1.CVSSv3 + * @instance + */ + CVSSv3.prototype.scope = 0; + + /** + * CVSSv3 confidentialityImpact. + * @member {grafeas.v1.CVSSv3.Impact} confidentialityImpact + * @memberof grafeas.v1.CVSSv3 + * @instance + */ + CVSSv3.prototype.confidentialityImpact = 0; + + /** + * CVSSv3 integrityImpact. + * @member {grafeas.v1.CVSSv3.Impact} integrityImpact + * @memberof grafeas.v1.CVSSv3 + * @instance + */ + CVSSv3.prototype.integrityImpact = 0; + + /** + * CVSSv3 availabilityImpact. + * @member {grafeas.v1.CVSSv3.Impact} availabilityImpact + * @memberof grafeas.v1.CVSSv3 + * @instance + */ + CVSSv3.prototype.availabilityImpact = 0; + + /** + * Creates a new CVSSv3 instance using the specified properties. * @function create - * @memberof grafeas.v1.Location + * @memberof grafeas.v1.CVSSv3 * @static - * @param {grafeas.v1.ILocation=} [properties] Properties to set - * @returns {grafeas.v1.Location} Location instance + * @param {grafeas.v1.ICVSSv3=} [properties] Properties to set + * @returns {grafeas.v1.CVSSv3} CVSSv3 instance */ - Location.create = function create(properties) { - return new Location(properties); + CVSSv3.create = function create(properties) { + return new CVSSv3(properties); }; /** - * Encodes the specified Location message. Does not implicitly {@link grafeas.v1.Location.verify|verify} messages. + * Encodes the specified CVSSv3 message. Does not implicitly {@link grafeas.v1.CVSSv3.verify|verify} messages. * @function encode - * @memberof grafeas.v1.Location + * @memberof grafeas.v1.CVSSv3 * @static - * @param {grafeas.v1.ILocation} message Location message or plain object to encode + * @param {grafeas.v1.ICVSSv3} message CVSSv3 message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Location.encode = function encode(message, writer) { + CVSSv3.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.cpeUri != null && Object.hasOwnProperty.call(message, "cpeUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.cpeUri); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - $root.grafeas.v1.Version.encode(message.version, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.path != null && Object.hasOwnProperty.call(message, "path")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.path); + if (message.baseScore != null && Object.hasOwnProperty.call(message, "baseScore")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.baseScore); + if (message.exploitabilityScore != null && Object.hasOwnProperty.call(message, "exploitabilityScore")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.exploitabilityScore); + if (message.impactScore != null && Object.hasOwnProperty.call(message, "impactScore")) + writer.uint32(/* id 3, wireType 5 =*/29).float(message.impactScore); + if (message.attackVector != null && Object.hasOwnProperty.call(message, "attackVector")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.attackVector); + if (message.attackComplexity != null && Object.hasOwnProperty.call(message, "attackComplexity")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.attackComplexity); + if (message.privilegesRequired != null && Object.hasOwnProperty.call(message, "privilegesRequired")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.privilegesRequired); + if (message.userInteraction != null && Object.hasOwnProperty.call(message, "userInteraction")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.userInteraction); + if (message.scope != null && Object.hasOwnProperty.call(message, "scope")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.scope); + if (message.confidentialityImpact != null && Object.hasOwnProperty.call(message, "confidentialityImpact")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.confidentialityImpact); + if (message.integrityImpact != null && Object.hasOwnProperty.call(message, "integrityImpact")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.integrityImpact); + if (message.availabilityImpact != null && Object.hasOwnProperty.call(message, "availabilityImpact")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.availabilityImpact); return writer; }; /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link grafeas.v1.Location.verify|verify} messages. + * Encodes the specified CVSSv3 message, length delimited. Does not implicitly {@link grafeas.v1.CVSSv3.verify|verify} messages. * @function encodeDelimited - * @memberof grafeas.v1.Location + * @memberof grafeas.v1.CVSSv3 * @static - * @param {grafeas.v1.ILocation} message Location message or plain object to encode + * @param {grafeas.v1.ICVSSv3} message CVSSv3 message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Location.encodeDelimited = function encodeDelimited(message, writer) { + CVSSv3.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Location message from the specified reader or buffer. + * Decodes a CVSSv3 message from the specified reader or buffer. * @function decode - * @memberof grafeas.v1.Location + * @memberof grafeas.v1.CVSSv3 * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {grafeas.v1.Location} Location + * @returns {grafeas.v1.CVSSv3} CVSSv3 * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Location.decode = function decode(reader, length) { + CVSSv3.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.Location(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.CVSSv3(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.cpeUri = reader.string(); + message.baseScore = reader.float(); break; case 2: - message.version = $root.grafeas.v1.Version.decode(reader, reader.uint32()); + message.exploitabilityScore = reader.float(); break; case 3: - message.path = reader.string(); + message.impactScore = reader.float(); + break; + case 5: + message.attackVector = reader.int32(); + break; + case 6: + message.attackComplexity = reader.int32(); + break; + case 7: + message.privilegesRequired = reader.int32(); + break; + case 8: + message.userInteraction = reader.int32(); + break; + case 9: + message.scope = reader.int32(); + break; + case 10: + message.confidentialityImpact = reader.int32(); + break; + case 11: + message.integrityImpact = reader.int32(); + break; + case 12: + message.availabilityImpact = reader.int32(); break; default: reader.skipType(tag & 7); @@ -3807,131 +3773,6618 @@ }; /** - * Decodes a Location message from the specified reader or buffer, length delimited. + * Decodes a CVSSv3 message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof grafeas.v1.Location + * @memberof grafeas.v1.CVSSv3 * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {grafeas.v1.Location} Location + * @returns {grafeas.v1.CVSSv3} CVSSv3 * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Location.decodeDelimited = function decodeDelimited(reader) { + CVSSv3.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Location message. + * Verifies a CVSSv3 message. * @function verify - * @memberof grafeas.v1.Location + * @memberof grafeas.v1.CVSSv3 * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Location.verify = function verify(message) { + CVSSv3.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.cpeUri != null && message.hasOwnProperty("cpeUri")) - if (!$util.isString(message.cpeUri)) - return "cpeUri: string expected"; - if (message.version != null && message.hasOwnProperty("version")) { - var error = $root.grafeas.v1.Version.verify(message.version); - if (error) - return "version." + error; - } - if (message.path != null && message.hasOwnProperty("path")) - if (!$util.isString(message.path)) - return "path: string expected"; + if (message.baseScore != null && message.hasOwnProperty("baseScore")) + if (typeof message.baseScore !== "number") + return "baseScore: number expected"; + if (message.exploitabilityScore != null && message.hasOwnProperty("exploitabilityScore")) + if (typeof message.exploitabilityScore !== "number") + return "exploitabilityScore: number expected"; + if (message.impactScore != null && message.hasOwnProperty("impactScore")) + if (typeof message.impactScore !== "number") + return "impactScore: number expected"; + if (message.attackVector != null && message.hasOwnProperty("attackVector")) + switch (message.attackVector) { + default: + return "attackVector: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.attackComplexity != null && message.hasOwnProperty("attackComplexity")) + switch (message.attackComplexity) { + default: + return "attackComplexity: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.privilegesRequired != null && message.hasOwnProperty("privilegesRequired")) + switch (message.privilegesRequired) { + default: + return "privilegesRequired: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.userInteraction != null && message.hasOwnProperty("userInteraction")) + switch (message.userInteraction) { + default: + return "userInteraction: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.scope != null && message.hasOwnProperty("scope")) + switch (message.scope) { + default: + return "scope: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.confidentialityImpact != null && message.hasOwnProperty("confidentialityImpact")) + switch (message.confidentialityImpact) { + default: + return "confidentialityImpact: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.integrityImpact != null && message.hasOwnProperty("integrityImpact")) + switch (message.integrityImpact) { + default: + return "integrityImpact: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.availabilityImpact != null && message.hasOwnProperty("availabilityImpact")) + switch (message.availabilityImpact) { + default: + return "availabilityImpact: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } return null; }; /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. + * Creates a CVSSv3 message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof grafeas.v1.Location + * @memberof grafeas.v1.CVSSv3 * @static * @param {Object.} object Plain object - * @returns {grafeas.v1.Location} Location + * @returns {grafeas.v1.CVSSv3} CVSSv3 */ - Location.fromObject = function fromObject(object) { - if (object instanceof $root.grafeas.v1.Location) + CVSSv3.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.CVSSv3) return object; - var message = new $root.grafeas.v1.Location(); - if (object.cpeUri != null) - message.cpeUri = String(object.cpeUri); - if (object.version != null) { - if (typeof object.version !== "object") - throw TypeError(".grafeas.v1.Location.version: object expected"); - message.version = $root.grafeas.v1.Version.fromObject(object.version); + var message = new $root.grafeas.v1.CVSSv3(); + if (object.baseScore != null) + message.baseScore = Number(object.baseScore); + if (object.exploitabilityScore != null) + message.exploitabilityScore = Number(object.exploitabilityScore); + if (object.impactScore != null) + message.impactScore = Number(object.impactScore); + switch (object.attackVector) { + case "ATTACK_VECTOR_UNSPECIFIED": + case 0: + message.attackVector = 0; + break; + case "ATTACK_VECTOR_NETWORK": + case 1: + message.attackVector = 1; + break; + case "ATTACK_VECTOR_ADJACENT": + case 2: + message.attackVector = 2; + break; + case "ATTACK_VECTOR_LOCAL": + case 3: + message.attackVector = 3; + break; + case "ATTACK_VECTOR_PHYSICAL": + case 4: + message.attackVector = 4; + break; } - if (object.path != null) - message.path = String(object.path); - return message; - }; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @function toObject - * @memberof grafeas.v1.Location - * @static - * @param {grafeas.v1.Location} message Location - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Location.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.cpeUri = ""; - object.version = null; - object.path = ""; + switch (object.attackComplexity) { + case "ATTACK_COMPLEXITY_UNSPECIFIED": + case 0: + message.attackComplexity = 0; + break; + case "ATTACK_COMPLEXITY_LOW": + case 1: + message.attackComplexity = 1; + break; + case "ATTACK_COMPLEXITY_HIGH": + case 2: + message.attackComplexity = 2; + break; } - if (message.cpeUri != null && message.hasOwnProperty("cpeUri")) - object.cpeUri = message.cpeUri; - if (message.version != null && message.hasOwnProperty("version")) - object.version = $root.grafeas.v1.Version.toObject(message.version, options); - if (message.path != null && message.hasOwnProperty("path")) - object.path = message.path; - return object; - }; - - /** - * Converts this Location to JSON. - * @function toJSON - * @memberof grafeas.v1.Location - * @instance - * @returns {Object.} JSON object - */ - Location.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Location; - })(); - - v1.PackageNote = (function() { - - /** - * Properties of a PackageNote. - * @memberof grafeas.v1 - * @interface IPackageNote - * @property {string|null} [name] PackageNote name - * @property {Array.|null} [distribution] PackageNote distribution - */ - - /** - * Constructs a new PackageNote. - * @memberof grafeas.v1 - * @classdesc Represents a PackageNote. + switch (object.privilegesRequired) { + case "PRIVILEGES_REQUIRED_UNSPECIFIED": + case 0: + message.privilegesRequired = 0; + break; + case "PRIVILEGES_REQUIRED_NONE": + case 1: + message.privilegesRequired = 1; + break; + case "PRIVILEGES_REQUIRED_LOW": + case 2: + message.privilegesRequired = 2; + break; + case "PRIVILEGES_REQUIRED_HIGH": + case 3: + message.privilegesRequired = 3; + break; + } + switch (object.userInteraction) { + case "USER_INTERACTION_UNSPECIFIED": + case 0: + message.userInteraction = 0; + break; + case "USER_INTERACTION_NONE": + case 1: + message.userInteraction = 1; + break; + case "USER_INTERACTION_REQUIRED": + case 2: + message.userInteraction = 2; + break; + } + switch (object.scope) { + case "SCOPE_UNSPECIFIED": + case 0: + message.scope = 0; + break; + case "SCOPE_UNCHANGED": + case 1: + message.scope = 1; + break; + case "SCOPE_CHANGED": + case 2: + message.scope = 2; + break; + } + switch (object.confidentialityImpact) { + case "IMPACT_UNSPECIFIED": + case 0: + message.confidentialityImpact = 0; + break; + case "IMPACT_HIGH": + case 1: + message.confidentialityImpact = 1; + break; + case "IMPACT_LOW": + case 2: + message.confidentialityImpact = 2; + break; + case "IMPACT_NONE": + case 3: + message.confidentialityImpact = 3; + break; + } + switch (object.integrityImpact) { + case "IMPACT_UNSPECIFIED": + case 0: + message.integrityImpact = 0; + break; + case "IMPACT_HIGH": + case 1: + message.integrityImpact = 1; + break; + case "IMPACT_LOW": + case 2: + message.integrityImpact = 2; + break; + case "IMPACT_NONE": + case 3: + message.integrityImpact = 3; + break; + } + switch (object.availabilityImpact) { + case "IMPACT_UNSPECIFIED": + case 0: + message.availabilityImpact = 0; + break; + case "IMPACT_HIGH": + case 1: + message.availabilityImpact = 1; + break; + case "IMPACT_LOW": + case 2: + message.availabilityImpact = 2; + break; + case "IMPACT_NONE": + case 3: + message.availabilityImpact = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a CVSSv3 message. Also converts values to other types if specified. + * @function toObject + * @memberof grafeas.v1.CVSSv3 + * @static + * @param {grafeas.v1.CVSSv3} message CVSSv3 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CVSSv3.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.baseScore = 0; + object.exploitabilityScore = 0; + object.impactScore = 0; + object.attackVector = options.enums === String ? "ATTACK_VECTOR_UNSPECIFIED" : 0; + object.attackComplexity = options.enums === String ? "ATTACK_COMPLEXITY_UNSPECIFIED" : 0; + object.privilegesRequired = options.enums === String ? "PRIVILEGES_REQUIRED_UNSPECIFIED" : 0; + object.userInteraction = options.enums === String ? "USER_INTERACTION_UNSPECIFIED" : 0; + object.scope = options.enums === String ? "SCOPE_UNSPECIFIED" : 0; + object.confidentialityImpact = options.enums === String ? "IMPACT_UNSPECIFIED" : 0; + object.integrityImpact = options.enums === String ? "IMPACT_UNSPECIFIED" : 0; + object.availabilityImpact = options.enums === String ? "IMPACT_UNSPECIFIED" : 0; + } + if (message.baseScore != null && message.hasOwnProperty("baseScore")) + object.baseScore = options.json && !isFinite(message.baseScore) ? String(message.baseScore) : message.baseScore; + if (message.exploitabilityScore != null && message.hasOwnProperty("exploitabilityScore")) + object.exploitabilityScore = options.json && !isFinite(message.exploitabilityScore) ? String(message.exploitabilityScore) : message.exploitabilityScore; + if (message.impactScore != null && message.hasOwnProperty("impactScore")) + object.impactScore = options.json && !isFinite(message.impactScore) ? String(message.impactScore) : message.impactScore; + if (message.attackVector != null && message.hasOwnProperty("attackVector")) + object.attackVector = options.enums === String ? $root.grafeas.v1.CVSSv3.AttackVector[message.attackVector] : message.attackVector; + if (message.attackComplexity != null && message.hasOwnProperty("attackComplexity")) + object.attackComplexity = options.enums === String ? $root.grafeas.v1.CVSSv3.AttackComplexity[message.attackComplexity] : message.attackComplexity; + if (message.privilegesRequired != null && message.hasOwnProperty("privilegesRequired")) + object.privilegesRequired = options.enums === String ? $root.grafeas.v1.CVSSv3.PrivilegesRequired[message.privilegesRequired] : message.privilegesRequired; + if (message.userInteraction != null && message.hasOwnProperty("userInteraction")) + object.userInteraction = options.enums === String ? $root.grafeas.v1.CVSSv3.UserInteraction[message.userInteraction] : message.userInteraction; + if (message.scope != null && message.hasOwnProperty("scope")) + object.scope = options.enums === String ? $root.grafeas.v1.CVSSv3.Scope[message.scope] : message.scope; + if (message.confidentialityImpact != null && message.hasOwnProperty("confidentialityImpact")) + object.confidentialityImpact = options.enums === String ? $root.grafeas.v1.CVSSv3.Impact[message.confidentialityImpact] : message.confidentialityImpact; + if (message.integrityImpact != null && message.hasOwnProperty("integrityImpact")) + object.integrityImpact = options.enums === String ? $root.grafeas.v1.CVSSv3.Impact[message.integrityImpact] : message.integrityImpact; + if (message.availabilityImpact != null && message.hasOwnProperty("availabilityImpact")) + object.availabilityImpact = options.enums === String ? $root.grafeas.v1.CVSSv3.Impact[message.availabilityImpact] : message.availabilityImpact; + return object; + }; + + /** + * Converts this CVSSv3 to JSON. + * @function toJSON + * @memberof grafeas.v1.CVSSv3 + * @instance + * @returns {Object.} JSON object + */ + CVSSv3.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * AttackVector enum. + * @name grafeas.v1.CVSSv3.AttackVector + * @enum {number} + * @property {number} ATTACK_VECTOR_UNSPECIFIED=0 ATTACK_VECTOR_UNSPECIFIED value + * @property {number} ATTACK_VECTOR_NETWORK=1 ATTACK_VECTOR_NETWORK value + * @property {number} ATTACK_VECTOR_ADJACENT=2 ATTACK_VECTOR_ADJACENT value + * @property {number} ATTACK_VECTOR_LOCAL=3 ATTACK_VECTOR_LOCAL value + * @property {number} ATTACK_VECTOR_PHYSICAL=4 ATTACK_VECTOR_PHYSICAL value + */ + CVSSv3.AttackVector = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ATTACK_VECTOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "ATTACK_VECTOR_NETWORK"] = 1; + values[valuesById[2] = "ATTACK_VECTOR_ADJACENT"] = 2; + values[valuesById[3] = "ATTACK_VECTOR_LOCAL"] = 3; + values[valuesById[4] = "ATTACK_VECTOR_PHYSICAL"] = 4; + return values; + })(); + + /** + * AttackComplexity enum. + * @name grafeas.v1.CVSSv3.AttackComplexity + * @enum {number} + * @property {number} ATTACK_COMPLEXITY_UNSPECIFIED=0 ATTACK_COMPLEXITY_UNSPECIFIED value + * @property {number} ATTACK_COMPLEXITY_LOW=1 ATTACK_COMPLEXITY_LOW value + * @property {number} ATTACK_COMPLEXITY_HIGH=2 ATTACK_COMPLEXITY_HIGH value + */ + CVSSv3.AttackComplexity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ATTACK_COMPLEXITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "ATTACK_COMPLEXITY_LOW"] = 1; + values[valuesById[2] = "ATTACK_COMPLEXITY_HIGH"] = 2; + return values; + })(); + + /** + * PrivilegesRequired enum. + * @name grafeas.v1.CVSSv3.PrivilegesRequired + * @enum {number} + * @property {number} PRIVILEGES_REQUIRED_UNSPECIFIED=0 PRIVILEGES_REQUIRED_UNSPECIFIED value + * @property {number} PRIVILEGES_REQUIRED_NONE=1 PRIVILEGES_REQUIRED_NONE value + * @property {number} PRIVILEGES_REQUIRED_LOW=2 PRIVILEGES_REQUIRED_LOW value + * @property {number} PRIVILEGES_REQUIRED_HIGH=3 PRIVILEGES_REQUIRED_HIGH value + */ + CVSSv3.PrivilegesRequired = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PRIVILEGES_REQUIRED_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRIVILEGES_REQUIRED_NONE"] = 1; + values[valuesById[2] = "PRIVILEGES_REQUIRED_LOW"] = 2; + values[valuesById[3] = "PRIVILEGES_REQUIRED_HIGH"] = 3; + return values; + })(); + + /** + * UserInteraction enum. + * @name grafeas.v1.CVSSv3.UserInteraction + * @enum {number} + * @property {number} USER_INTERACTION_UNSPECIFIED=0 USER_INTERACTION_UNSPECIFIED value + * @property {number} USER_INTERACTION_NONE=1 USER_INTERACTION_NONE value + * @property {number} USER_INTERACTION_REQUIRED=2 USER_INTERACTION_REQUIRED value + */ + CVSSv3.UserInteraction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "USER_INTERACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "USER_INTERACTION_NONE"] = 1; + values[valuesById[2] = "USER_INTERACTION_REQUIRED"] = 2; + return values; + })(); + + /** + * Scope enum. + * @name grafeas.v1.CVSSv3.Scope + * @enum {number} + * @property {number} SCOPE_UNSPECIFIED=0 SCOPE_UNSPECIFIED value + * @property {number} SCOPE_UNCHANGED=1 SCOPE_UNCHANGED value + * @property {number} SCOPE_CHANGED=2 SCOPE_CHANGED value + */ + CVSSv3.Scope = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SCOPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SCOPE_UNCHANGED"] = 1; + values[valuesById[2] = "SCOPE_CHANGED"] = 2; + return values; + })(); + + /** + * Impact enum. + * @name grafeas.v1.CVSSv3.Impact + * @enum {number} + * @property {number} IMPACT_UNSPECIFIED=0 IMPACT_UNSPECIFIED value + * @property {number} IMPACT_HIGH=1 IMPACT_HIGH value + * @property {number} IMPACT_LOW=2 IMPACT_LOW value + * @property {number} IMPACT_NONE=3 IMPACT_NONE value + */ + CVSSv3.Impact = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IMPACT_UNSPECIFIED"] = 0; + values[valuesById[1] = "IMPACT_HIGH"] = 1; + values[valuesById[2] = "IMPACT_LOW"] = 2; + values[valuesById[3] = "IMPACT_NONE"] = 3; + return values; + })(); + + return CVSSv3; + })(); + + /** + * Architecture enum. + * @name grafeas.v1.Architecture + * @enum {number} + * @property {number} ARCHITECTURE_UNSPECIFIED=0 ARCHITECTURE_UNSPECIFIED value + * @property {number} X86=1 X86 value + * @property {number} X64=2 X64 value + */ + v1.Architecture = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ARCHITECTURE_UNSPECIFIED"] = 0; + values[valuesById[1] = "X86"] = 1; + values[valuesById[2] = "X64"] = 2; + return values; + })(); + + v1.Distribution = (function() { + + /** + * Properties of a Distribution. + * @memberof grafeas.v1 + * @interface IDistribution + * @property {string|null} [cpeUri] Distribution cpeUri + * @property {grafeas.v1.Architecture|null} [architecture] Distribution architecture + * @property {grafeas.v1.IVersion|null} [latestVersion] Distribution latestVersion + * @property {string|null} [maintainer] Distribution maintainer + * @property {string|null} [url] Distribution url + * @property {string|null} [description] Distribution description + */ + + /** + * Constructs a new Distribution. + * @memberof grafeas.v1 + * @classdesc Represents a Distribution. + * @implements IDistribution + * @constructor + * @param {grafeas.v1.IDistribution=} [properties] Properties to set + */ + function Distribution(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Distribution cpeUri. + * @member {string} cpeUri + * @memberof grafeas.v1.Distribution + * @instance + */ + Distribution.prototype.cpeUri = ""; + + /** + * Distribution architecture. + * @member {grafeas.v1.Architecture} architecture + * @memberof grafeas.v1.Distribution + * @instance + */ + Distribution.prototype.architecture = 0; + + /** + * Distribution latestVersion. + * @member {grafeas.v1.IVersion|null|undefined} latestVersion + * @memberof grafeas.v1.Distribution + * @instance + */ + Distribution.prototype.latestVersion = null; + + /** + * Distribution maintainer. + * @member {string} maintainer + * @memberof grafeas.v1.Distribution + * @instance + */ + Distribution.prototype.maintainer = ""; + + /** + * Distribution url. + * @member {string} url + * @memberof grafeas.v1.Distribution + * @instance + */ + Distribution.prototype.url = ""; + + /** + * Distribution description. + * @member {string} description + * @memberof grafeas.v1.Distribution + * @instance + */ + Distribution.prototype.description = ""; + + /** + * Creates a new Distribution instance using the specified properties. + * @function create + * @memberof grafeas.v1.Distribution + * @static + * @param {grafeas.v1.IDistribution=} [properties] Properties to set + * @returns {grafeas.v1.Distribution} Distribution instance + */ + Distribution.create = function create(properties) { + return new Distribution(properties); + }; + + /** + * Encodes the specified Distribution message. Does not implicitly {@link grafeas.v1.Distribution.verify|verify} messages. + * @function encode + * @memberof grafeas.v1.Distribution + * @static + * @param {grafeas.v1.IDistribution} message Distribution message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Distribution.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cpeUri != null && Object.hasOwnProperty.call(message, "cpeUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cpeUri); + if (message.architecture != null && Object.hasOwnProperty.call(message, "architecture")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.architecture); + if (message.latestVersion != null && Object.hasOwnProperty.call(message, "latestVersion")) + $root.grafeas.v1.Version.encode(message.latestVersion, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.maintainer != null && Object.hasOwnProperty.call(message, "maintainer")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.maintainer); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.url); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); + return writer; + }; + + /** + * Encodes the specified Distribution message, length delimited. Does not implicitly {@link grafeas.v1.Distribution.verify|verify} messages. + * @function encodeDelimited + * @memberof grafeas.v1.Distribution + * @static + * @param {grafeas.v1.IDistribution} message Distribution message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Distribution.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Distribution message from the specified reader or buffer. + * @function decode + * @memberof grafeas.v1.Distribution + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {grafeas.v1.Distribution} Distribution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Distribution.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.Distribution(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cpeUri = reader.string(); + break; + case 2: + message.architecture = reader.int32(); + break; + case 3: + message.latestVersion = $root.grafeas.v1.Version.decode(reader, reader.uint32()); + break; + case 4: + message.maintainer = reader.string(); + break; + case 5: + message.url = reader.string(); + break; + case 6: + message.description = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Distribution message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof grafeas.v1.Distribution + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {grafeas.v1.Distribution} Distribution + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Distribution.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Distribution message. + * @function verify + * @memberof grafeas.v1.Distribution + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Distribution.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cpeUri != null && message.hasOwnProperty("cpeUri")) + if (!$util.isString(message.cpeUri)) + return "cpeUri: string expected"; + if (message.architecture != null && message.hasOwnProperty("architecture")) + switch (message.architecture) { + default: + return "architecture: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.latestVersion != null && message.hasOwnProperty("latestVersion")) { + var error = $root.grafeas.v1.Version.verify(message.latestVersion); + if (error) + return "latestVersion." + error; + } + if (message.maintainer != null && message.hasOwnProperty("maintainer")) + if (!$util.isString(message.maintainer)) + return "maintainer: string expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + return null; + }; + + /** + * Creates a Distribution message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof grafeas.v1.Distribution + * @static + * @param {Object.} object Plain object + * @returns {grafeas.v1.Distribution} Distribution + */ + Distribution.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.Distribution) + return object; + var message = new $root.grafeas.v1.Distribution(); + if (object.cpeUri != null) + message.cpeUri = String(object.cpeUri); + switch (object.architecture) { + case "ARCHITECTURE_UNSPECIFIED": + case 0: + message.architecture = 0; + break; + case "X86": + case 1: + message.architecture = 1; + break; + case "X64": + case 2: + message.architecture = 2; + break; + } + if (object.latestVersion != null) { + if (typeof object.latestVersion !== "object") + throw TypeError(".grafeas.v1.Distribution.latestVersion: object expected"); + message.latestVersion = $root.grafeas.v1.Version.fromObject(object.latestVersion); + } + if (object.maintainer != null) + message.maintainer = String(object.maintainer); + if (object.url != null) + message.url = String(object.url); + if (object.description != null) + message.description = String(object.description); + return message; + }; + + /** + * Creates a plain object from a Distribution message. Also converts values to other types if specified. + * @function toObject + * @memberof grafeas.v1.Distribution + * @static + * @param {grafeas.v1.Distribution} message Distribution + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Distribution.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cpeUri = ""; + object.architecture = options.enums === String ? "ARCHITECTURE_UNSPECIFIED" : 0; + object.latestVersion = null; + object.maintainer = ""; + object.url = ""; + object.description = ""; + } + if (message.cpeUri != null && message.hasOwnProperty("cpeUri")) + object.cpeUri = message.cpeUri; + if (message.architecture != null && message.hasOwnProperty("architecture")) + object.architecture = options.enums === String ? $root.grafeas.v1.Architecture[message.architecture] : message.architecture; + if (message.latestVersion != null && message.hasOwnProperty("latestVersion")) + object.latestVersion = $root.grafeas.v1.Version.toObject(message.latestVersion, options); + if (message.maintainer != null && message.hasOwnProperty("maintainer")) + object.maintainer = message.maintainer; + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + return object; + }; + + /** + * Converts this Distribution to JSON. + * @function toJSON + * @memberof grafeas.v1.Distribution + * @instance + * @returns {Object.} JSON object + */ + Distribution.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Distribution; + })(); + + v1.Location = (function() { + + /** + * Properties of a Location. + * @memberof grafeas.v1 + * @interface ILocation + * @property {string|null} [cpeUri] Location cpeUri + * @property {grafeas.v1.IVersion|null} [version] Location version + * @property {string|null} [path] Location path + */ + + /** + * Constructs a new Location. + * @memberof grafeas.v1 + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {grafeas.v1.ILocation=} [properties] Properties to set + */ + function Location(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Location cpeUri. + * @member {string} cpeUri + * @memberof grafeas.v1.Location + * @instance + */ + Location.prototype.cpeUri = ""; + + /** + * Location version. + * @member {grafeas.v1.IVersion|null|undefined} version + * @memberof grafeas.v1.Location + * @instance + */ + Location.prototype.version = null; + + /** + * Location path. + * @member {string} path + * @memberof grafeas.v1.Location + * @instance + */ + Location.prototype.path = ""; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof grafeas.v1.Location + * @static + * @param {grafeas.v1.ILocation=} [properties] Properties to set + * @returns {grafeas.v1.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link grafeas.v1.Location.verify|verify} messages. + * @function encode + * @memberof grafeas.v1.Location + * @static + * @param {grafeas.v1.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cpeUri != null && Object.hasOwnProperty.call(message, "cpeUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cpeUri); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + $root.grafeas.v1.Version.encode(message.version, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.path); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link grafeas.v1.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof grafeas.v1.Location + * @static + * @param {grafeas.v1.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof grafeas.v1.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {grafeas.v1.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cpeUri = reader.string(); + break; + case 2: + message.version = $root.grafeas.v1.Version.decode(reader, reader.uint32()); + break; + case 3: + message.path = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof grafeas.v1.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {grafeas.v1.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof grafeas.v1.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cpeUri != null && message.hasOwnProperty("cpeUri")) + if (!$util.isString(message.cpeUri)) + return "cpeUri: string expected"; + if (message.version != null && message.hasOwnProperty("version")) { + var error = $root.grafeas.v1.Version.verify(message.version); + if (error) + return "version." + error; + } + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof grafeas.v1.Location + * @static + * @param {Object.} object Plain object + * @returns {grafeas.v1.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.Location) + return object; + var message = new $root.grafeas.v1.Location(); + if (object.cpeUri != null) + message.cpeUri = String(object.cpeUri); + if (object.version != null) { + if (typeof object.version !== "object") + throw TypeError(".grafeas.v1.Location.version: object expected"); + message.version = $root.grafeas.v1.Version.fromObject(object.version); + } + if (object.path != null) + message.path = String(object.path); + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof grafeas.v1.Location + * @static + * @param {grafeas.v1.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cpeUri = ""; + object.version = null; + object.path = ""; + } + if (message.cpeUri != null && message.hasOwnProperty("cpeUri")) + object.cpeUri = message.cpeUri; + if (message.version != null && message.hasOwnProperty("version")) + object.version = $root.grafeas.v1.Version.toObject(message.version, options); + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof grafeas.v1.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Location; + })(); + + v1.PackageNote = (function() { + + /** + * Properties of a PackageNote. + * @memberof grafeas.v1 + * @interface IPackageNote + * @property {string|null} [name] PackageNote name + * @property {Array.|null} [distribution] PackageNote distribution + */ + + /** + * Constructs a new PackageNote. + * @memberof grafeas.v1 + * @classdesc Represents a PackageNote. * @implements IPackageNote * @constructor - * @param {grafeas.v1.IPackageNote=} [properties] Properties to set + * @param {grafeas.v1.IPackageNote=} [properties] Properties to set + */ + function PackageNote(properties) { + this.distribution = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PackageNote name. + * @member {string} name + * @memberof grafeas.v1.PackageNote + * @instance + */ + PackageNote.prototype.name = ""; + + /** + * PackageNote distribution. + * @member {Array.} distribution + * @memberof grafeas.v1.PackageNote + * @instance + */ + PackageNote.prototype.distribution = $util.emptyArray; + + /** + * Creates a new PackageNote instance using the specified properties. + * @function create + * @memberof grafeas.v1.PackageNote + * @static + * @param {grafeas.v1.IPackageNote=} [properties] Properties to set + * @returns {grafeas.v1.PackageNote} PackageNote instance + */ + PackageNote.create = function create(properties) { + return new PackageNote(properties); + }; + + /** + * Encodes the specified PackageNote message. Does not implicitly {@link grafeas.v1.PackageNote.verify|verify} messages. + * @function encode + * @memberof grafeas.v1.PackageNote + * @static + * @param {grafeas.v1.IPackageNote} message PackageNote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PackageNote.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.distribution != null && message.distribution.length) + for (var i = 0; i < message.distribution.length; ++i) + $root.grafeas.v1.Distribution.encode(message.distribution[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PackageNote message, length delimited. Does not implicitly {@link grafeas.v1.PackageNote.verify|verify} messages. + * @function encodeDelimited + * @memberof grafeas.v1.PackageNote + * @static + * @param {grafeas.v1.IPackageNote} message PackageNote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PackageNote.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PackageNote message from the specified reader or buffer. + * @function decode + * @memberof grafeas.v1.PackageNote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {grafeas.v1.PackageNote} PackageNote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PackageNote.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.PackageNote(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 10: + if (!(message.distribution && message.distribution.length)) + message.distribution = []; + message.distribution.push($root.grafeas.v1.Distribution.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PackageNote message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof grafeas.v1.PackageNote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {grafeas.v1.PackageNote} PackageNote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PackageNote.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PackageNote message. + * @function verify + * @memberof grafeas.v1.PackageNote + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PackageNote.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.distribution != null && message.hasOwnProperty("distribution")) { + if (!Array.isArray(message.distribution)) + return "distribution: array expected"; + for (var i = 0; i < message.distribution.length; ++i) { + var error = $root.grafeas.v1.Distribution.verify(message.distribution[i]); + if (error) + return "distribution." + error; + } + } + return null; + }; + + /** + * Creates a PackageNote message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof grafeas.v1.PackageNote + * @static + * @param {Object.} object Plain object + * @returns {grafeas.v1.PackageNote} PackageNote + */ + PackageNote.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.PackageNote) + return object; + var message = new $root.grafeas.v1.PackageNote(); + if (object.name != null) + message.name = String(object.name); + if (object.distribution) { + if (!Array.isArray(object.distribution)) + throw TypeError(".grafeas.v1.PackageNote.distribution: array expected"); + message.distribution = []; + for (var i = 0; i < object.distribution.length; ++i) { + if (typeof object.distribution[i] !== "object") + throw TypeError(".grafeas.v1.PackageNote.distribution: object expected"); + message.distribution[i] = $root.grafeas.v1.Distribution.fromObject(object.distribution[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PackageNote message. Also converts values to other types if specified. + * @function toObject + * @memberof grafeas.v1.PackageNote + * @static + * @param {grafeas.v1.PackageNote} message PackageNote + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PackageNote.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.distribution = []; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.distribution && message.distribution.length) { + object.distribution = []; + for (var j = 0; j < message.distribution.length; ++j) + object.distribution[j] = $root.grafeas.v1.Distribution.toObject(message.distribution[j], options); + } + return object; + }; + + /** + * Converts this PackageNote to JSON. + * @function toJSON + * @memberof grafeas.v1.PackageNote + * @instance + * @returns {Object.} JSON object + */ + PackageNote.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PackageNote; + })(); + + v1.PackageOccurrence = (function() { + + /** + * Properties of a PackageOccurrence. + * @memberof grafeas.v1 + * @interface IPackageOccurrence + * @property {string|null} [name] PackageOccurrence name + * @property {Array.|null} [location] PackageOccurrence location + */ + + /** + * Constructs a new PackageOccurrence. + * @memberof grafeas.v1 + * @classdesc Represents a PackageOccurrence. + * @implements IPackageOccurrence + * @constructor + * @param {grafeas.v1.IPackageOccurrence=} [properties] Properties to set + */ + function PackageOccurrence(properties) { + this.location = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PackageOccurrence name. + * @member {string} name + * @memberof grafeas.v1.PackageOccurrence + * @instance + */ + PackageOccurrence.prototype.name = ""; + + /** + * PackageOccurrence location. + * @member {Array.} location + * @memberof grafeas.v1.PackageOccurrence + * @instance + */ + PackageOccurrence.prototype.location = $util.emptyArray; + + /** + * Creates a new PackageOccurrence instance using the specified properties. + * @function create + * @memberof grafeas.v1.PackageOccurrence + * @static + * @param {grafeas.v1.IPackageOccurrence=} [properties] Properties to set + * @returns {grafeas.v1.PackageOccurrence} PackageOccurrence instance + */ + PackageOccurrence.create = function create(properties) { + return new PackageOccurrence(properties); + }; + + /** + * Encodes the specified PackageOccurrence message. Does not implicitly {@link grafeas.v1.PackageOccurrence.verify|verify} messages. + * @function encode + * @memberof grafeas.v1.PackageOccurrence + * @static + * @param {grafeas.v1.IPackageOccurrence} message PackageOccurrence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PackageOccurrence.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.grafeas.v1.Location.encode(message.location[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PackageOccurrence message, length delimited. Does not implicitly {@link grafeas.v1.PackageOccurrence.verify|verify} messages. + * @function encodeDelimited + * @memberof grafeas.v1.PackageOccurrence + * @static + * @param {grafeas.v1.IPackageOccurrence} message PackageOccurrence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PackageOccurrence.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PackageOccurrence message from the specified reader or buffer. + * @function decode + * @memberof grafeas.v1.PackageOccurrence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {grafeas.v1.PackageOccurrence} PackageOccurrence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PackageOccurrence.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.PackageOccurrence(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.grafeas.v1.Location.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PackageOccurrence message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof grafeas.v1.PackageOccurrence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {grafeas.v1.PackageOccurrence} PackageOccurrence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PackageOccurrence.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PackageOccurrence message. + * @function verify + * @memberof grafeas.v1.PackageOccurrence + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PackageOccurrence.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.grafeas.v1.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a PackageOccurrence message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof grafeas.v1.PackageOccurrence + * @static + * @param {Object.} object Plain object + * @returns {grafeas.v1.PackageOccurrence} PackageOccurrence + */ + PackageOccurrence.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.PackageOccurrence) + return object; + var message = new $root.grafeas.v1.PackageOccurrence(); + if (object.name != null) + message.name = String(object.name); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".grafeas.v1.PackageOccurrence.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".grafeas.v1.PackageOccurrence.location: object expected"); + message.location[i] = $root.grafeas.v1.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PackageOccurrence message. Also converts values to other types if specified. + * @function toObject + * @memberof grafeas.v1.PackageOccurrence + * @static + * @param {grafeas.v1.PackageOccurrence} message PackageOccurrence + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PackageOccurrence.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.grafeas.v1.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this PackageOccurrence to JSON. + * @function toJSON + * @memberof grafeas.v1.PackageOccurrence + * @instance + * @returns {Object.} JSON object + */ + PackageOccurrence.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PackageOccurrence; + })(); + + v1.Version = (function() { + + /** + * Properties of a Version. + * @memberof grafeas.v1 + * @interface IVersion + * @property {number|null} [epoch] Version epoch + * @property {string|null} [name] Version name + * @property {string|null} [revision] Version revision + * @property {boolean|null} [inclusive] Version inclusive + * @property {grafeas.v1.Version.VersionKind|null} [kind] Version kind + * @property {string|null} [fullName] Version fullName + */ + + /** + * Constructs a new Version. + * @memberof grafeas.v1 + * @classdesc Represents a Version. + * @implements IVersion + * @constructor + * @param {grafeas.v1.IVersion=} [properties] Properties to set + */ + function Version(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Version epoch. + * @member {number} epoch + * @memberof grafeas.v1.Version + * @instance + */ + Version.prototype.epoch = 0; + + /** + * Version name. + * @member {string} name + * @memberof grafeas.v1.Version + * @instance + */ + Version.prototype.name = ""; + + /** + * Version revision. + * @member {string} revision + * @memberof grafeas.v1.Version + * @instance + */ + Version.prototype.revision = ""; + + /** + * Version inclusive. + * @member {boolean} inclusive + * @memberof grafeas.v1.Version + * @instance + */ + Version.prototype.inclusive = false; + + /** + * Version kind. + * @member {grafeas.v1.Version.VersionKind} kind + * @memberof grafeas.v1.Version + * @instance + */ + Version.prototype.kind = 0; + + /** + * Version fullName. + * @member {string} fullName + * @memberof grafeas.v1.Version + * @instance + */ + Version.prototype.fullName = ""; + + /** + * Creates a new Version instance using the specified properties. + * @function create + * @memberof grafeas.v1.Version + * @static + * @param {grafeas.v1.IVersion=} [properties] Properties to set + * @returns {grafeas.v1.Version} Version instance + */ + Version.create = function create(properties) { + return new Version(properties); + }; + + /** + * Encodes the specified Version message. Does not implicitly {@link grafeas.v1.Version.verify|verify} messages. + * @function encode + * @memberof grafeas.v1.Version + * @static + * @param {grafeas.v1.IVersion} message Version message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Version.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.epoch != null && Object.hasOwnProperty.call(message, "epoch")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.epoch); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.revision != null && Object.hasOwnProperty.call(message, "revision")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.revision); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.kind); + if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.fullName); + if (message.inclusive != null && Object.hasOwnProperty.call(message, "inclusive")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.inclusive); + return writer; + }; + + /** + * Encodes the specified Version message, length delimited. Does not implicitly {@link grafeas.v1.Version.verify|verify} messages. + * @function encodeDelimited + * @memberof grafeas.v1.Version + * @static + * @param {grafeas.v1.IVersion} message Version message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Version.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Version message from the specified reader or buffer. + * @function decode + * @memberof grafeas.v1.Version + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {grafeas.v1.Version} Version + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Version.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.Version(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.epoch = reader.int32(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.revision = reader.string(); + break; + case 6: + message.inclusive = reader.bool(); + break; + case 4: + message.kind = reader.int32(); + break; + case 5: + message.fullName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Version message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof grafeas.v1.Version + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {grafeas.v1.Version} Version + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Version.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Version message. + * @function verify + * @memberof grafeas.v1.Version + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Version.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.epoch != null && message.hasOwnProperty("epoch")) + if (!$util.isInteger(message.epoch)) + return "epoch: integer expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.revision != null && message.hasOwnProperty("revision")) + if (!$util.isString(message.revision)) + return "revision: string expected"; + if (message.inclusive != null && message.hasOwnProperty("inclusive")) + if (typeof message.inclusive !== "boolean") + return "inclusive: boolean expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + switch (message.kind) { + default: + return "kind: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.fullName != null && message.hasOwnProperty("fullName")) + if (!$util.isString(message.fullName)) + return "fullName: string expected"; + return null; + }; + + /** + * Creates a Version message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof grafeas.v1.Version + * @static + * @param {Object.} object Plain object + * @returns {grafeas.v1.Version} Version + */ + Version.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.Version) + return object; + var message = new $root.grafeas.v1.Version(); + if (object.epoch != null) + message.epoch = object.epoch | 0; + if (object.name != null) + message.name = String(object.name); + if (object.revision != null) + message.revision = String(object.revision); + if (object.inclusive != null) + message.inclusive = Boolean(object.inclusive); + switch (object.kind) { + case "VERSION_KIND_UNSPECIFIED": + case 0: + message.kind = 0; + break; + case "NORMAL": + case 1: + message.kind = 1; + break; + case "MINIMUM": + case 2: + message.kind = 2; + break; + case "MAXIMUM": + case 3: + message.kind = 3; + break; + } + if (object.fullName != null) + message.fullName = String(object.fullName); + return message; + }; + + /** + * Creates a plain object from a Version message. Also converts values to other types if specified. + * @function toObject + * @memberof grafeas.v1.Version + * @static + * @param {grafeas.v1.Version} message Version + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Version.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.epoch = 0; + object.name = ""; + object.revision = ""; + object.kind = options.enums === String ? "VERSION_KIND_UNSPECIFIED" : 0; + object.fullName = ""; + object.inclusive = false; + } + if (message.epoch != null && message.hasOwnProperty("epoch")) + object.epoch = message.epoch; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.revision != null && message.hasOwnProperty("revision")) + object.revision = message.revision; + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = options.enums === String ? $root.grafeas.v1.Version.VersionKind[message.kind] : message.kind; + if (message.fullName != null && message.hasOwnProperty("fullName")) + object.fullName = message.fullName; + if (message.inclusive != null && message.hasOwnProperty("inclusive")) + object.inclusive = message.inclusive; + return object; + }; + + /** + * Converts this Version to JSON. + * @function toJSON + * @memberof grafeas.v1.Version + * @instance + * @returns {Object.} JSON object + */ + Version.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * VersionKind enum. + * @name grafeas.v1.Version.VersionKind + * @enum {number} + * @property {number} VERSION_KIND_UNSPECIFIED=0 VERSION_KIND_UNSPECIFIED value + * @property {number} NORMAL=1 NORMAL value + * @property {number} MINIMUM=2 MINIMUM value + * @property {number} MAXIMUM=3 MAXIMUM value + */ + Version.VersionKind = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "VERSION_KIND_UNSPECIFIED"] = 0; + values[valuesById[1] = "NORMAL"] = 1; + values[valuesById[2] = "MINIMUM"] = 2; + values[valuesById[3] = "MAXIMUM"] = 3; + return values; + })(); + + return Version; + })(); + + v1.AttestationNote = (function() { + + /** + * Properties of an AttestationNote. + * @memberof grafeas.v1 + * @interface IAttestationNote + * @property {grafeas.v1.AttestationNote.IHint|null} [hint] AttestationNote hint + */ + + /** + * Constructs a new AttestationNote. + * @memberof grafeas.v1 + * @classdesc Represents an AttestationNote. + * @implements IAttestationNote + * @constructor + * @param {grafeas.v1.IAttestationNote=} [properties] Properties to set + */ + function AttestationNote(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AttestationNote hint. + * @member {grafeas.v1.AttestationNote.IHint|null|undefined} hint + * @memberof grafeas.v1.AttestationNote + * @instance + */ + AttestationNote.prototype.hint = null; + + /** + * Creates a new AttestationNote instance using the specified properties. + * @function create + * @memberof grafeas.v1.AttestationNote + * @static + * @param {grafeas.v1.IAttestationNote=} [properties] Properties to set + * @returns {grafeas.v1.AttestationNote} AttestationNote instance + */ + AttestationNote.create = function create(properties) { + return new AttestationNote(properties); + }; + + /** + * Encodes the specified AttestationNote message. Does not implicitly {@link grafeas.v1.AttestationNote.verify|verify} messages. + * @function encode + * @memberof grafeas.v1.AttestationNote + * @static + * @param {grafeas.v1.IAttestationNote} message AttestationNote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttestationNote.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hint != null && Object.hasOwnProperty.call(message, "hint")) + $root.grafeas.v1.AttestationNote.Hint.encode(message.hint, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AttestationNote message, length delimited. Does not implicitly {@link grafeas.v1.AttestationNote.verify|verify} messages. + * @function encodeDelimited + * @memberof grafeas.v1.AttestationNote + * @static + * @param {grafeas.v1.IAttestationNote} message AttestationNote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttestationNote.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttestationNote message from the specified reader or buffer. + * @function decode + * @memberof grafeas.v1.AttestationNote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {grafeas.v1.AttestationNote} AttestationNote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttestationNote.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.AttestationNote(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.hint = $root.grafeas.v1.AttestationNote.Hint.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttestationNote message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof grafeas.v1.AttestationNote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {grafeas.v1.AttestationNote} AttestationNote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttestationNote.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttestationNote message. + * @function verify + * @memberof grafeas.v1.AttestationNote + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttestationNote.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hint != null && message.hasOwnProperty("hint")) { + var error = $root.grafeas.v1.AttestationNote.Hint.verify(message.hint); + if (error) + return "hint." + error; + } + return null; + }; + + /** + * Creates an AttestationNote message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof grafeas.v1.AttestationNote + * @static + * @param {Object.} object Plain object + * @returns {grafeas.v1.AttestationNote} AttestationNote + */ + AttestationNote.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.AttestationNote) + return object; + var message = new $root.grafeas.v1.AttestationNote(); + if (object.hint != null) { + if (typeof object.hint !== "object") + throw TypeError(".grafeas.v1.AttestationNote.hint: object expected"); + message.hint = $root.grafeas.v1.AttestationNote.Hint.fromObject(object.hint); + } + return message; + }; + + /** + * Creates a plain object from an AttestationNote message. Also converts values to other types if specified. + * @function toObject + * @memberof grafeas.v1.AttestationNote + * @static + * @param {grafeas.v1.AttestationNote} message AttestationNote + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttestationNote.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.hint = null; + if (message.hint != null && message.hasOwnProperty("hint")) + object.hint = $root.grafeas.v1.AttestationNote.Hint.toObject(message.hint, options); + return object; + }; + + /** + * Converts this AttestationNote to JSON. + * @function toJSON + * @memberof grafeas.v1.AttestationNote + * @instance + * @returns {Object.} JSON object + */ + AttestationNote.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + AttestationNote.Hint = (function() { + + /** + * Properties of a Hint. + * @memberof grafeas.v1.AttestationNote + * @interface IHint + * @property {string|null} [humanReadableName] Hint humanReadableName + */ + + /** + * Constructs a new Hint. + * @memberof grafeas.v1.AttestationNote + * @classdesc Represents a Hint. + * @implements IHint + * @constructor + * @param {grafeas.v1.AttestationNote.IHint=} [properties] Properties to set + */ + function Hint(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Hint humanReadableName. + * @member {string} humanReadableName + * @memberof grafeas.v1.AttestationNote.Hint + * @instance + */ + Hint.prototype.humanReadableName = ""; + + /** + * Creates a new Hint instance using the specified properties. + * @function create + * @memberof grafeas.v1.AttestationNote.Hint + * @static + * @param {grafeas.v1.AttestationNote.IHint=} [properties] Properties to set + * @returns {grafeas.v1.AttestationNote.Hint} Hint instance + */ + Hint.create = function create(properties) { + return new Hint(properties); + }; + + /** + * Encodes the specified Hint message. Does not implicitly {@link grafeas.v1.AttestationNote.Hint.verify|verify} messages. + * @function encode + * @memberof grafeas.v1.AttestationNote.Hint + * @static + * @param {grafeas.v1.AttestationNote.IHint} message Hint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Hint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.humanReadableName != null && Object.hasOwnProperty.call(message, "humanReadableName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.humanReadableName); + return writer; + }; + + /** + * Encodes the specified Hint message, length delimited. Does not implicitly {@link grafeas.v1.AttestationNote.Hint.verify|verify} messages. + * @function encodeDelimited + * @memberof grafeas.v1.AttestationNote.Hint + * @static + * @param {grafeas.v1.AttestationNote.IHint} message Hint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Hint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Hint message from the specified reader or buffer. + * @function decode + * @memberof grafeas.v1.AttestationNote.Hint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {grafeas.v1.AttestationNote.Hint} Hint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Hint.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.AttestationNote.Hint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.humanReadableName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Hint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof grafeas.v1.AttestationNote.Hint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {grafeas.v1.AttestationNote.Hint} Hint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Hint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Hint message. + * @function verify + * @memberof grafeas.v1.AttestationNote.Hint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Hint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.humanReadableName != null && message.hasOwnProperty("humanReadableName")) + if (!$util.isString(message.humanReadableName)) + return "humanReadableName: string expected"; + return null; + }; + + /** + * Creates a Hint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof grafeas.v1.AttestationNote.Hint + * @static + * @param {Object.} object Plain object + * @returns {grafeas.v1.AttestationNote.Hint} Hint + */ + Hint.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.AttestationNote.Hint) + return object; + var message = new $root.grafeas.v1.AttestationNote.Hint(); + if (object.humanReadableName != null) + message.humanReadableName = String(object.humanReadableName); + return message; + }; + + /** + * Creates a plain object from a Hint message. Also converts values to other types if specified. + * @function toObject + * @memberof grafeas.v1.AttestationNote.Hint + * @static + * @param {grafeas.v1.AttestationNote.Hint} message Hint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Hint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.humanReadableName = ""; + if (message.humanReadableName != null && message.hasOwnProperty("humanReadableName")) + object.humanReadableName = message.humanReadableName; + return object; + }; + + /** + * Converts this Hint to JSON. + * @function toJSON + * @memberof grafeas.v1.AttestationNote.Hint + * @instance + * @returns {Object.} JSON object + */ + Hint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Hint; + })(); + + return AttestationNote; + })(); + + v1.Jwt = (function() { + + /** + * Properties of a Jwt. + * @memberof grafeas.v1 + * @interface IJwt + * @property {string|null} [compactJwt] Jwt compactJwt + */ + + /** + * Constructs a new Jwt. + * @memberof grafeas.v1 + * @classdesc Represents a Jwt. + * @implements IJwt + * @constructor + * @param {grafeas.v1.IJwt=} [properties] Properties to set + */ + function Jwt(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Jwt compactJwt. + * @member {string} compactJwt + * @memberof grafeas.v1.Jwt + * @instance + */ + Jwt.prototype.compactJwt = ""; + + /** + * Creates a new Jwt instance using the specified properties. + * @function create + * @memberof grafeas.v1.Jwt + * @static + * @param {grafeas.v1.IJwt=} [properties] Properties to set + * @returns {grafeas.v1.Jwt} Jwt instance + */ + Jwt.create = function create(properties) { + return new Jwt(properties); + }; + + /** + * Encodes the specified Jwt message. Does not implicitly {@link grafeas.v1.Jwt.verify|verify} messages. + * @function encode + * @memberof grafeas.v1.Jwt + * @static + * @param {grafeas.v1.IJwt} message Jwt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Jwt.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.compactJwt != null && Object.hasOwnProperty.call(message, "compactJwt")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.compactJwt); + return writer; + }; + + /** + * Encodes the specified Jwt message, length delimited. Does not implicitly {@link grafeas.v1.Jwt.verify|verify} messages. + * @function encodeDelimited + * @memberof grafeas.v1.Jwt + * @static + * @param {grafeas.v1.IJwt} message Jwt message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Jwt.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Jwt message from the specified reader or buffer. + * @function decode + * @memberof grafeas.v1.Jwt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {grafeas.v1.Jwt} Jwt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Jwt.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.Jwt(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.compactJwt = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Jwt message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof grafeas.v1.Jwt + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {grafeas.v1.Jwt} Jwt + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Jwt.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Jwt message. + * @function verify + * @memberof grafeas.v1.Jwt + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Jwt.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.compactJwt != null && message.hasOwnProperty("compactJwt")) + if (!$util.isString(message.compactJwt)) + return "compactJwt: string expected"; + return null; + }; + + /** + * Creates a Jwt message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof grafeas.v1.Jwt + * @static + * @param {Object.} object Plain object + * @returns {grafeas.v1.Jwt} Jwt + */ + Jwt.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.Jwt) + return object; + var message = new $root.grafeas.v1.Jwt(); + if (object.compactJwt != null) + message.compactJwt = String(object.compactJwt); + return message; + }; + + /** + * Creates a plain object from a Jwt message. Also converts values to other types if specified. + * @function toObject + * @memberof grafeas.v1.Jwt + * @static + * @param {grafeas.v1.Jwt} message Jwt + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Jwt.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.compactJwt = ""; + if (message.compactJwt != null && message.hasOwnProperty("compactJwt")) + object.compactJwt = message.compactJwt; + return object; + }; + + /** + * Converts this Jwt to JSON. + * @function toJSON + * @memberof grafeas.v1.Jwt + * @instance + * @returns {Object.} JSON object + */ + Jwt.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Jwt; + })(); + + v1.AttestationOccurrence = (function() { + + /** + * Properties of an AttestationOccurrence. + * @memberof grafeas.v1 + * @interface IAttestationOccurrence + * @property {Uint8Array|null} [serializedPayload] AttestationOccurrence serializedPayload + * @property {Array.|null} [signatures] AttestationOccurrence signatures + * @property {Array.|null} [jwts] AttestationOccurrence jwts + */ + + /** + * Constructs a new AttestationOccurrence. + * @memberof grafeas.v1 + * @classdesc Represents an AttestationOccurrence. + * @implements IAttestationOccurrence + * @constructor + * @param {grafeas.v1.IAttestationOccurrence=} [properties] Properties to set + */ + function AttestationOccurrence(properties) { + this.signatures = []; + this.jwts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AttestationOccurrence serializedPayload. + * @member {Uint8Array} serializedPayload + * @memberof grafeas.v1.AttestationOccurrence + * @instance + */ + AttestationOccurrence.prototype.serializedPayload = $util.newBuffer([]); + + /** + * AttestationOccurrence signatures. + * @member {Array.} signatures + * @memberof grafeas.v1.AttestationOccurrence + * @instance + */ + AttestationOccurrence.prototype.signatures = $util.emptyArray; + + /** + * AttestationOccurrence jwts. + * @member {Array.} jwts + * @memberof grafeas.v1.AttestationOccurrence + * @instance + */ + AttestationOccurrence.prototype.jwts = $util.emptyArray; + + /** + * Creates a new AttestationOccurrence instance using the specified properties. + * @function create + * @memberof grafeas.v1.AttestationOccurrence + * @static + * @param {grafeas.v1.IAttestationOccurrence=} [properties] Properties to set + * @returns {grafeas.v1.AttestationOccurrence} AttestationOccurrence instance + */ + AttestationOccurrence.create = function create(properties) { + return new AttestationOccurrence(properties); + }; + + /** + * Encodes the specified AttestationOccurrence message. Does not implicitly {@link grafeas.v1.AttestationOccurrence.verify|verify} messages. + * @function encode + * @memberof grafeas.v1.AttestationOccurrence + * @static + * @param {grafeas.v1.IAttestationOccurrence} message AttestationOccurrence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttestationOccurrence.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.serializedPayload != null && Object.hasOwnProperty.call(message, "serializedPayload")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.serializedPayload); + if (message.signatures != null && message.signatures.length) + for (var i = 0; i < message.signatures.length; ++i) + $root.grafeas.v1.Signature.encode(message.signatures[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.jwts != null && message.jwts.length) + for (var i = 0; i < message.jwts.length; ++i) + $root.grafeas.v1.Jwt.encode(message.jwts[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AttestationOccurrence message, length delimited. Does not implicitly {@link grafeas.v1.AttestationOccurrence.verify|verify} messages. + * @function encodeDelimited + * @memberof grafeas.v1.AttestationOccurrence + * @static + * @param {grafeas.v1.IAttestationOccurrence} message AttestationOccurrence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttestationOccurrence.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttestationOccurrence message from the specified reader or buffer. + * @function decode + * @memberof grafeas.v1.AttestationOccurrence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {grafeas.v1.AttestationOccurrence} AttestationOccurrence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttestationOccurrence.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.AttestationOccurrence(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.serializedPayload = reader.bytes(); + break; + case 2: + if (!(message.signatures && message.signatures.length)) + message.signatures = []; + message.signatures.push($root.grafeas.v1.Signature.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.jwts && message.jwts.length)) + message.jwts = []; + message.jwts.push($root.grafeas.v1.Jwt.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttestationOccurrence message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof grafeas.v1.AttestationOccurrence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {grafeas.v1.AttestationOccurrence} AttestationOccurrence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttestationOccurrence.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttestationOccurrence message. + * @function verify + * @memberof grafeas.v1.AttestationOccurrence + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttestationOccurrence.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.serializedPayload != null && message.hasOwnProperty("serializedPayload")) + if (!(message.serializedPayload && typeof message.serializedPayload.length === "number" || $util.isString(message.serializedPayload))) + return "serializedPayload: buffer expected"; + if (message.signatures != null && message.hasOwnProperty("signatures")) { + if (!Array.isArray(message.signatures)) + return "signatures: array expected"; + for (var i = 0; i < message.signatures.length; ++i) { + var error = $root.grafeas.v1.Signature.verify(message.signatures[i]); + if (error) + return "signatures." + error; + } + } + if (message.jwts != null && message.hasOwnProperty("jwts")) { + if (!Array.isArray(message.jwts)) + return "jwts: array expected"; + for (var i = 0; i < message.jwts.length; ++i) { + var error = $root.grafeas.v1.Jwt.verify(message.jwts[i]); + if (error) + return "jwts." + error; + } + } + return null; + }; + + /** + * Creates an AttestationOccurrence message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof grafeas.v1.AttestationOccurrence + * @static + * @param {Object.} object Plain object + * @returns {grafeas.v1.AttestationOccurrence} AttestationOccurrence + */ + AttestationOccurrence.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.AttestationOccurrence) + return object; + var message = new $root.grafeas.v1.AttestationOccurrence(); + if (object.serializedPayload != null) + if (typeof object.serializedPayload === "string") + $util.base64.decode(object.serializedPayload, message.serializedPayload = $util.newBuffer($util.base64.length(object.serializedPayload)), 0); + else if (object.serializedPayload.length) + message.serializedPayload = object.serializedPayload; + if (object.signatures) { + if (!Array.isArray(object.signatures)) + throw TypeError(".grafeas.v1.AttestationOccurrence.signatures: array expected"); + message.signatures = []; + for (var i = 0; i < object.signatures.length; ++i) { + if (typeof object.signatures[i] !== "object") + throw TypeError(".grafeas.v1.AttestationOccurrence.signatures: object expected"); + message.signatures[i] = $root.grafeas.v1.Signature.fromObject(object.signatures[i]); + } + } + if (object.jwts) { + if (!Array.isArray(object.jwts)) + throw TypeError(".grafeas.v1.AttestationOccurrence.jwts: array expected"); + message.jwts = []; + for (var i = 0; i < object.jwts.length; ++i) { + if (typeof object.jwts[i] !== "object") + throw TypeError(".grafeas.v1.AttestationOccurrence.jwts: object expected"); + message.jwts[i] = $root.grafeas.v1.Jwt.fromObject(object.jwts[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AttestationOccurrence message. Also converts values to other types if specified. + * @function toObject + * @memberof grafeas.v1.AttestationOccurrence + * @static + * @param {grafeas.v1.AttestationOccurrence} message AttestationOccurrence + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttestationOccurrence.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.signatures = []; + object.jwts = []; + } + if (options.defaults) + if (options.bytes === String) + object.serializedPayload = ""; + else { + object.serializedPayload = []; + if (options.bytes !== Array) + object.serializedPayload = $util.newBuffer(object.serializedPayload); + } + if (message.serializedPayload != null && message.hasOwnProperty("serializedPayload")) + object.serializedPayload = options.bytes === String ? $util.base64.encode(message.serializedPayload, 0, message.serializedPayload.length) : options.bytes === Array ? Array.prototype.slice.call(message.serializedPayload) : message.serializedPayload; + if (message.signatures && message.signatures.length) { + object.signatures = []; + for (var j = 0; j < message.signatures.length; ++j) + object.signatures[j] = $root.grafeas.v1.Signature.toObject(message.signatures[j], options); + } + if (message.jwts && message.jwts.length) { + object.jwts = []; + for (var j = 0; j < message.jwts.length; ++j) + object.jwts[j] = $root.grafeas.v1.Jwt.toObject(message.jwts[j], options); + } + return object; + }; + + /** + * Converts this AttestationOccurrence to JSON. + * @function toJSON + * @memberof grafeas.v1.AttestationOccurrence + * @instance + * @returns {Object.} JSON object + */ + AttestationOccurrence.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AttestationOccurrence; + })(); + + v1.BuildNote = (function() { + + /** + * Properties of a BuildNote. + * @memberof grafeas.v1 + * @interface IBuildNote + * @property {string|null} [builderVersion] BuildNote builderVersion + */ + + /** + * Constructs a new BuildNote. + * @memberof grafeas.v1 + * @classdesc Represents a BuildNote. + * @implements IBuildNote + * @constructor + * @param {grafeas.v1.IBuildNote=} [properties] Properties to set + */ + function BuildNote(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BuildNote builderVersion. + * @member {string} builderVersion + * @memberof grafeas.v1.BuildNote + * @instance + */ + BuildNote.prototype.builderVersion = ""; + + /** + * Creates a new BuildNote instance using the specified properties. + * @function create + * @memberof grafeas.v1.BuildNote + * @static + * @param {grafeas.v1.IBuildNote=} [properties] Properties to set + * @returns {grafeas.v1.BuildNote} BuildNote instance + */ + BuildNote.create = function create(properties) { + return new BuildNote(properties); + }; + + /** + * Encodes the specified BuildNote message. Does not implicitly {@link grafeas.v1.BuildNote.verify|verify} messages. + * @function encode + * @memberof grafeas.v1.BuildNote + * @static + * @param {grafeas.v1.IBuildNote} message BuildNote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BuildNote.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.builderVersion != null && Object.hasOwnProperty.call(message, "builderVersion")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.builderVersion); + return writer; + }; + + /** + * Encodes the specified BuildNote message, length delimited. Does not implicitly {@link grafeas.v1.BuildNote.verify|verify} messages. + * @function encodeDelimited + * @memberof grafeas.v1.BuildNote + * @static + * @param {grafeas.v1.IBuildNote} message BuildNote message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BuildNote.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BuildNote message from the specified reader or buffer. + * @function decode + * @memberof grafeas.v1.BuildNote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {grafeas.v1.BuildNote} BuildNote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BuildNote.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.BuildNote(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.builderVersion = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BuildNote message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof grafeas.v1.BuildNote + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {grafeas.v1.BuildNote} BuildNote + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BuildNote.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BuildNote message. + * @function verify + * @memberof grafeas.v1.BuildNote + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BuildNote.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.builderVersion != null && message.hasOwnProperty("builderVersion")) + if (!$util.isString(message.builderVersion)) + return "builderVersion: string expected"; + return null; + }; + + /** + * Creates a BuildNote message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof grafeas.v1.BuildNote + * @static + * @param {Object.} object Plain object + * @returns {grafeas.v1.BuildNote} BuildNote + */ + BuildNote.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.BuildNote) + return object; + var message = new $root.grafeas.v1.BuildNote(); + if (object.builderVersion != null) + message.builderVersion = String(object.builderVersion); + return message; + }; + + /** + * Creates a plain object from a BuildNote message. Also converts values to other types if specified. + * @function toObject + * @memberof grafeas.v1.BuildNote + * @static + * @param {grafeas.v1.BuildNote} message BuildNote + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BuildNote.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.builderVersion = ""; + if (message.builderVersion != null && message.hasOwnProperty("builderVersion")) + object.builderVersion = message.builderVersion; + return object; + }; + + /** + * Converts this BuildNote to JSON. + * @function toJSON + * @memberof grafeas.v1.BuildNote + * @instance + * @returns {Object.} JSON object + */ + BuildNote.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BuildNote; + })(); + + v1.BuildOccurrence = (function() { + + /** + * Properties of a BuildOccurrence. + * @memberof grafeas.v1 + * @interface IBuildOccurrence + * @property {grafeas.v1.IBuildProvenance|null} [provenance] BuildOccurrence provenance + * @property {string|null} [provenanceBytes] BuildOccurrence provenanceBytes + * @property {grafeas.v1.IInTotoProvenance|null} [intotoProvenance] BuildOccurrence intotoProvenance + * @property {grafeas.v1.IInTotoStatement|null} [intotoStatement] BuildOccurrence intotoStatement + */ + + /** + * Constructs a new BuildOccurrence. + * @memberof grafeas.v1 + * @classdesc Represents a BuildOccurrence. + * @implements IBuildOccurrence + * @constructor + * @param {grafeas.v1.IBuildOccurrence=} [properties] Properties to set + */ + function BuildOccurrence(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BuildOccurrence provenance. + * @member {grafeas.v1.IBuildProvenance|null|undefined} provenance + * @memberof grafeas.v1.BuildOccurrence + * @instance + */ + BuildOccurrence.prototype.provenance = null; + + /** + * BuildOccurrence provenanceBytes. + * @member {string} provenanceBytes + * @memberof grafeas.v1.BuildOccurrence + * @instance + */ + BuildOccurrence.prototype.provenanceBytes = ""; + + /** + * BuildOccurrence intotoProvenance. + * @member {grafeas.v1.IInTotoProvenance|null|undefined} intotoProvenance + * @memberof grafeas.v1.BuildOccurrence + * @instance + */ + BuildOccurrence.prototype.intotoProvenance = null; + + /** + * BuildOccurrence intotoStatement. + * @member {grafeas.v1.IInTotoStatement|null|undefined} intotoStatement + * @memberof grafeas.v1.BuildOccurrence + * @instance + */ + BuildOccurrence.prototype.intotoStatement = null; + + /** + * Creates a new BuildOccurrence instance using the specified properties. + * @function create + * @memberof grafeas.v1.BuildOccurrence + * @static + * @param {grafeas.v1.IBuildOccurrence=} [properties] Properties to set + * @returns {grafeas.v1.BuildOccurrence} BuildOccurrence instance + */ + BuildOccurrence.create = function create(properties) { + return new BuildOccurrence(properties); + }; + + /** + * Encodes the specified BuildOccurrence message. Does not implicitly {@link grafeas.v1.BuildOccurrence.verify|verify} messages. + * @function encode + * @memberof grafeas.v1.BuildOccurrence + * @static + * @param {grafeas.v1.IBuildOccurrence} message BuildOccurrence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BuildOccurrence.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.provenance != null && Object.hasOwnProperty.call(message, "provenance")) + $root.grafeas.v1.BuildProvenance.encode(message.provenance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.provenanceBytes != null && Object.hasOwnProperty.call(message, "provenanceBytes")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.provenanceBytes); + if (message.intotoProvenance != null && Object.hasOwnProperty.call(message, "intotoProvenance")) + $root.grafeas.v1.InTotoProvenance.encode(message.intotoProvenance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.intotoStatement != null && Object.hasOwnProperty.call(message, "intotoStatement")) + $root.grafeas.v1.InTotoStatement.encode(message.intotoStatement, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BuildOccurrence message, length delimited. Does not implicitly {@link grafeas.v1.BuildOccurrence.verify|verify} messages. + * @function encodeDelimited + * @memberof grafeas.v1.BuildOccurrence + * @static + * @param {grafeas.v1.IBuildOccurrence} message BuildOccurrence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BuildOccurrence.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BuildOccurrence message from the specified reader or buffer. + * @function decode + * @memberof grafeas.v1.BuildOccurrence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {grafeas.v1.BuildOccurrence} BuildOccurrence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BuildOccurrence.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.BuildOccurrence(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.provenance = $root.grafeas.v1.BuildProvenance.decode(reader, reader.uint32()); + break; + case 2: + message.provenanceBytes = reader.string(); + break; + case 3: + message.intotoProvenance = $root.grafeas.v1.InTotoProvenance.decode(reader, reader.uint32()); + break; + case 4: + message.intotoStatement = $root.grafeas.v1.InTotoStatement.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BuildOccurrence message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof grafeas.v1.BuildOccurrence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {grafeas.v1.BuildOccurrence} BuildOccurrence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BuildOccurrence.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BuildOccurrence message. + * @function verify + * @memberof grafeas.v1.BuildOccurrence + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BuildOccurrence.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.provenance != null && message.hasOwnProperty("provenance")) { + var error = $root.grafeas.v1.BuildProvenance.verify(message.provenance); + if (error) + return "provenance." + error; + } + if (message.provenanceBytes != null && message.hasOwnProperty("provenanceBytes")) + if (!$util.isString(message.provenanceBytes)) + return "provenanceBytes: string expected"; + if (message.intotoProvenance != null && message.hasOwnProperty("intotoProvenance")) { + var error = $root.grafeas.v1.InTotoProvenance.verify(message.intotoProvenance); + if (error) + return "intotoProvenance." + error; + } + if (message.intotoStatement != null && message.hasOwnProperty("intotoStatement")) { + var error = $root.grafeas.v1.InTotoStatement.verify(message.intotoStatement); + if (error) + return "intotoStatement." + error; + } + return null; + }; + + /** + * Creates a BuildOccurrence message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof grafeas.v1.BuildOccurrence + * @static + * @param {Object.} object Plain object + * @returns {grafeas.v1.BuildOccurrence} BuildOccurrence + */ + BuildOccurrence.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.BuildOccurrence) + return object; + var message = new $root.grafeas.v1.BuildOccurrence(); + if (object.provenance != null) { + if (typeof object.provenance !== "object") + throw TypeError(".grafeas.v1.BuildOccurrence.provenance: object expected"); + message.provenance = $root.grafeas.v1.BuildProvenance.fromObject(object.provenance); + } + if (object.provenanceBytes != null) + message.provenanceBytes = String(object.provenanceBytes); + if (object.intotoProvenance != null) { + if (typeof object.intotoProvenance !== "object") + throw TypeError(".grafeas.v1.BuildOccurrence.intotoProvenance: object expected"); + message.intotoProvenance = $root.grafeas.v1.InTotoProvenance.fromObject(object.intotoProvenance); + } + if (object.intotoStatement != null) { + if (typeof object.intotoStatement !== "object") + throw TypeError(".grafeas.v1.BuildOccurrence.intotoStatement: object expected"); + message.intotoStatement = $root.grafeas.v1.InTotoStatement.fromObject(object.intotoStatement); + } + return message; + }; + + /** + * Creates a plain object from a BuildOccurrence message. Also converts values to other types if specified. + * @function toObject + * @memberof grafeas.v1.BuildOccurrence + * @static + * @param {grafeas.v1.BuildOccurrence} message BuildOccurrence + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BuildOccurrence.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.provenance = null; + object.provenanceBytes = ""; + object.intotoProvenance = null; + object.intotoStatement = null; + } + if (message.provenance != null && message.hasOwnProperty("provenance")) + object.provenance = $root.grafeas.v1.BuildProvenance.toObject(message.provenance, options); + if (message.provenanceBytes != null && message.hasOwnProperty("provenanceBytes")) + object.provenanceBytes = message.provenanceBytes; + if (message.intotoProvenance != null && message.hasOwnProperty("intotoProvenance")) + object.intotoProvenance = $root.grafeas.v1.InTotoProvenance.toObject(message.intotoProvenance, options); + if (message.intotoStatement != null && message.hasOwnProperty("intotoStatement")) + object.intotoStatement = $root.grafeas.v1.InTotoStatement.toObject(message.intotoStatement, options); + return object; + }; + + /** + * Converts this BuildOccurrence to JSON. + * @function toJSON + * @memberof grafeas.v1.BuildOccurrence + * @instance + * @returns {Object.} JSON object + */ + BuildOccurrence.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BuildOccurrence; + })(); + + v1.Recipe = (function() { + + /** + * Properties of a Recipe. + * @memberof grafeas.v1 + * @interface IRecipe + * @property {string|null} [type] Recipe type + * @property {number|Long|null} [definedInMaterial] Recipe definedInMaterial + * @property {string|null} [entryPoint] Recipe entryPoint + * @property {Array.|null} ["arguments"] Recipe arguments + * @property {Array.|null} [environment] Recipe environment + */ + + /** + * Constructs a new Recipe. + * @memberof grafeas.v1 + * @classdesc Represents a Recipe. + * @implements IRecipe + * @constructor + * @param {grafeas.v1.IRecipe=} [properties] Properties to set + */ + function Recipe(properties) { + this["arguments"] = []; + this.environment = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Recipe type. + * @member {string} type + * @memberof grafeas.v1.Recipe + * @instance + */ + Recipe.prototype.type = ""; + + /** + * Recipe definedInMaterial. + * @member {number|Long} definedInMaterial + * @memberof grafeas.v1.Recipe + * @instance + */ + Recipe.prototype.definedInMaterial = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Recipe entryPoint. + * @member {string} entryPoint + * @memberof grafeas.v1.Recipe + * @instance + */ + Recipe.prototype.entryPoint = ""; + + /** + * Recipe arguments. + * @member {Array.} arguments + * @memberof grafeas.v1.Recipe + * @instance + */ + Recipe.prototype["arguments"] = $util.emptyArray; + + /** + * Recipe environment. + * @member {Array.} environment + * @memberof grafeas.v1.Recipe + * @instance + */ + Recipe.prototype.environment = $util.emptyArray; + + /** + * Creates a new Recipe instance using the specified properties. + * @function create + * @memberof grafeas.v1.Recipe + * @static + * @param {grafeas.v1.IRecipe=} [properties] Properties to set + * @returns {grafeas.v1.Recipe} Recipe instance + */ + Recipe.create = function create(properties) { + return new Recipe(properties); + }; + + /** + * Encodes the specified Recipe message. Does not implicitly {@link grafeas.v1.Recipe.verify|verify} messages. + * @function encode + * @memberof grafeas.v1.Recipe + * @static + * @param {grafeas.v1.IRecipe} message Recipe message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Recipe.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.definedInMaterial != null && Object.hasOwnProperty.call(message, "definedInMaterial")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.definedInMaterial); + if (message.entryPoint != null && Object.hasOwnProperty.call(message, "entryPoint")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.entryPoint); + if (message["arguments"] != null && message["arguments"].length) + for (var i = 0; i < message["arguments"].length; ++i) + $root.google.protobuf.Any.encode(message["arguments"][i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.environment != null && message.environment.length) + for (var i = 0; i < message.environment.length; ++i) + $root.google.protobuf.Any.encode(message.environment[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Recipe message, length delimited. Does not implicitly {@link grafeas.v1.Recipe.verify|verify} messages. + * @function encodeDelimited + * @memberof grafeas.v1.Recipe + * @static + * @param {grafeas.v1.IRecipe} message Recipe message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Recipe.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Recipe message from the specified reader or buffer. + * @function decode + * @memberof grafeas.v1.Recipe + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {grafeas.v1.Recipe} Recipe + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Recipe.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.Recipe(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + message.definedInMaterial = reader.int64(); + break; + case 3: + message.entryPoint = reader.string(); + break; + case 4: + if (!(message["arguments"] && message["arguments"].length)) + message["arguments"] = []; + message["arguments"].push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.environment && message.environment.length)) + message.environment = []; + message.environment.push($root.google.protobuf.Any.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Recipe message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof grafeas.v1.Recipe + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {grafeas.v1.Recipe} Recipe + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Recipe.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Recipe message. + * @function verify + * @memberof grafeas.v1.Recipe + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Recipe.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.definedInMaterial != null && message.hasOwnProperty("definedInMaterial")) + if (!$util.isInteger(message.definedInMaterial) && !(message.definedInMaterial && $util.isInteger(message.definedInMaterial.low) && $util.isInteger(message.definedInMaterial.high))) + return "definedInMaterial: integer|Long expected"; + if (message.entryPoint != null && message.hasOwnProperty("entryPoint")) + if (!$util.isString(message.entryPoint)) + return "entryPoint: string expected"; + if (message["arguments"] != null && message.hasOwnProperty("arguments")) { + if (!Array.isArray(message["arguments"])) + return "arguments: array expected"; + for (var i = 0; i < message["arguments"].length; ++i) { + var error = $root.google.protobuf.Any.verify(message["arguments"][i]); + if (error) + return "arguments." + error; + } + } + if (message.environment != null && message.hasOwnProperty("environment")) { + if (!Array.isArray(message.environment)) + return "environment: array expected"; + for (var i = 0; i < message.environment.length; ++i) { + var error = $root.google.protobuf.Any.verify(message.environment[i]); + if (error) + return "environment." + error; + } + } + return null; + }; + + /** + * Creates a Recipe message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof grafeas.v1.Recipe + * @static + * @param {Object.} object Plain object + * @returns {grafeas.v1.Recipe} Recipe + */ + Recipe.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.Recipe) + return object; + var message = new $root.grafeas.v1.Recipe(); + if (object.type != null) + message.type = String(object.type); + if (object.definedInMaterial != null) + if ($util.Long) + (message.definedInMaterial = $util.Long.fromValue(object.definedInMaterial)).unsigned = false; + else if (typeof object.definedInMaterial === "string") + message.definedInMaterial = parseInt(object.definedInMaterial, 10); + else if (typeof object.definedInMaterial === "number") + message.definedInMaterial = object.definedInMaterial; + else if (typeof object.definedInMaterial === "object") + message.definedInMaterial = new $util.LongBits(object.definedInMaterial.low >>> 0, object.definedInMaterial.high >>> 0).toNumber(); + if (object.entryPoint != null) + message.entryPoint = String(object.entryPoint); + if (object["arguments"]) { + if (!Array.isArray(object["arguments"])) + throw TypeError(".grafeas.v1.Recipe.arguments: array expected"); + message["arguments"] = []; + for (var i = 0; i < object["arguments"].length; ++i) { + if (typeof object["arguments"][i] !== "object") + throw TypeError(".grafeas.v1.Recipe.arguments: object expected"); + message["arguments"][i] = $root.google.protobuf.Any.fromObject(object["arguments"][i]); + } + } + if (object.environment) { + if (!Array.isArray(object.environment)) + throw TypeError(".grafeas.v1.Recipe.environment: array expected"); + message.environment = []; + for (var i = 0; i < object.environment.length; ++i) { + if (typeof object.environment[i] !== "object") + throw TypeError(".grafeas.v1.Recipe.environment: object expected"); + message.environment[i] = $root.google.protobuf.Any.fromObject(object.environment[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Recipe message. Also converts values to other types if specified. + * @function toObject + * @memberof grafeas.v1.Recipe + * @static + * @param {grafeas.v1.Recipe} message Recipe + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Recipe.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object["arguments"] = []; + object.environment = []; + } + if (options.defaults) { + object.type = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.definedInMaterial = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.definedInMaterial = options.longs === String ? "0" : 0; + object.entryPoint = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.definedInMaterial != null && message.hasOwnProperty("definedInMaterial")) + if (typeof message.definedInMaterial === "number") + object.definedInMaterial = options.longs === String ? String(message.definedInMaterial) : message.definedInMaterial; + else + object.definedInMaterial = options.longs === String ? $util.Long.prototype.toString.call(message.definedInMaterial) : options.longs === Number ? new $util.LongBits(message.definedInMaterial.low >>> 0, message.definedInMaterial.high >>> 0).toNumber() : message.definedInMaterial; + if (message.entryPoint != null && message.hasOwnProperty("entryPoint")) + object.entryPoint = message.entryPoint; + if (message["arguments"] && message["arguments"].length) { + object["arguments"] = []; + for (var j = 0; j < message["arguments"].length; ++j) + object["arguments"][j] = $root.google.protobuf.Any.toObject(message["arguments"][j], options); + } + if (message.environment && message.environment.length) { + object.environment = []; + for (var j = 0; j < message.environment.length; ++j) + object.environment[j] = $root.google.protobuf.Any.toObject(message.environment[j], options); + } + return object; + }; + + /** + * Converts this Recipe to JSON. + * @function toJSON + * @memberof grafeas.v1.Recipe + * @instance + * @returns {Object.} JSON object + */ + Recipe.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Recipe; + })(); + + v1.Completeness = (function() { + + /** + * Properties of a Completeness. + * @memberof grafeas.v1 + * @interface ICompleteness + * @property {boolean|null} ["arguments"] Completeness arguments + * @property {boolean|null} [environment] Completeness environment + * @property {boolean|null} [materials] Completeness materials + */ + + /** + * Constructs a new Completeness. + * @memberof grafeas.v1 + * @classdesc Represents a Completeness. + * @implements ICompleteness + * @constructor + * @param {grafeas.v1.ICompleteness=} [properties] Properties to set + */ + function Completeness(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Completeness arguments. + * @member {boolean} arguments + * @memberof grafeas.v1.Completeness + * @instance + */ + Completeness.prototype["arguments"] = false; + + /** + * Completeness environment. + * @member {boolean} environment + * @memberof grafeas.v1.Completeness + * @instance + */ + Completeness.prototype.environment = false; + + /** + * Completeness materials. + * @member {boolean} materials + * @memberof grafeas.v1.Completeness + * @instance + */ + Completeness.prototype.materials = false; + + /** + * Creates a new Completeness instance using the specified properties. + * @function create + * @memberof grafeas.v1.Completeness + * @static + * @param {grafeas.v1.ICompleteness=} [properties] Properties to set + * @returns {grafeas.v1.Completeness} Completeness instance + */ + Completeness.create = function create(properties) { + return new Completeness(properties); + }; + + /** + * Encodes the specified Completeness message. Does not implicitly {@link grafeas.v1.Completeness.verify|verify} messages. + * @function encode + * @memberof grafeas.v1.Completeness + * @static + * @param {grafeas.v1.ICompleteness} message Completeness message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Completeness.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message["arguments"] != null && Object.hasOwnProperty.call(message, "arguments")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message["arguments"]); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.environment); + if (message.materials != null && Object.hasOwnProperty.call(message, "materials")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.materials); + return writer; + }; + + /** + * Encodes the specified Completeness message, length delimited. Does not implicitly {@link grafeas.v1.Completeness.verify|verify} messages. + * @function encodeDelimited + * @memberof grafeas.v1.Completeness + * @static + * @param {grafeas.v1.ICompleteness} message Completeness message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Completeness.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Completeness message from the specified reader or buffer. + * @function decode + * @memberof grafeas.v1.Completeness + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {grafeas.v1.Completeness} Completeness + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Completeness.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.Completeness(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message["arguments"] = reader.bool(); + break; + case 2: + message.environment = reader.bool(); + break; + case 3: + message.materials = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Completeness message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof grafeas.v1.Completeness + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {grafeas.v1.Completeness} Completeness + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Completeness.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Completeness message. + * @function verify + * @memberof grafeas.v1.Completeness + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Completeness.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message["arguments"] != null && message.hasOwnProperty("arguments")) + if (typeof message["arguments"] !== "boolean") + return "arguments: boolean expected"; + if (message.environment != null && message.hasOwnProperty("environment")) + if (typeof message.environment !== "boolean") + return "environment: boolean expected"; + if (message.materials != null && message.hasOwnProperty("materials")) + if (typeof message.materials !== "boolean") + return "materials: boolean expected"; + return null; + }; + + /** + * Creates a Completeness message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof grafeas.v1.Completeness + * @static + * @param {Object.} object Plain object + * @returns {grafeas.v1.Completeness} Completeness + */ + Completeness.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.Completeness) + return object; + var message = new $root.grafeas.v1.Completeness(); + if (object["arguments"] != null) + message["arguments"] = Boolean(object["arguments"]); + if (object.environment != null) + message.environment = Boolean(object.environment); + if (object.materials != null) + message.materials = Boolean(object.materials); + return message; + }; + + /** + * Creates a plain object from a Completeness message. Also converts values to other types if specified. + * @function toObject + * @memberof grafeas.v1.Completeness + * @static + * @param {grafeas.v1.Completeness} message Completeness + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Completeness.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object["arguments"] = false; + object.environment = false; + object.materials = false; + } + if (message["arguments"] != null && message.hasOwnProperty("arguments")) + object["arguments"] = message["arguments"]; + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = message.environment; + if (message.materials != null && message.hasOwnProperty("materials")) + object.materials = message.materials; + return object; + }; + + /** + * Converts this Completeness to JSON. + * @function toJSON + * @memberof grafeas.v1.Completeness + * @instance + * @returns {Object.} JSON object + */ + Completeness.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Completeness; + })(); + + v1.Metadata = (function() { + + /** + * Properties of a Metadata. + * @memberof grafeas.v1 + * @interface IMetadata + * @property {string|null} [buildInvocationId] Metadata buildInvocationId + * @property {google.protobuf.ITimestamp|null} [buildStartedOn] Metadata buildStartedOn + * @property {google.protobuf.ITimestamp|null} [buildFinishedOn] Metadata buildFinishedOn + * @property {grafeas.v1.ICompleteness|null} [completeness] Metadata completeness + * @property {boolean|null} [reproducible] Metadata reproducible + */ + + /** + * Constructs a new Metadata. + * @memberof grafeas.v1 + * @classdesc Represents a Metadata. + * @implements IMetadata + * @constructor + * @param {grafeas.v1.IMetadata=} [properties] Properties to set + */ + function Metadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Metadata buildInvocationId. + * @member {string} buildInvocationId + * @memberof grafeas.v1.Metadata + * @instance + */ + Metadata.prototype.buildInvocationId = ""; + + /** + * Metadata buildStartedOn. + * @member {google.protobuf.ITimestamp|null|undefined} buildStartedOn + * @memberof grafeas.v1.Metadata + * @instance + */ + Metadata.prototype.buildStartedOn = null; + + /** + * Metadata buildFinishedOn. + * @member {google.protobuf.ITimestamp|null|undefined} buildFinishedOn + * @memberof grafeas.v1.Metadata + * @instance + */ + Metadata.prototype.buildFinishedOn = null; + + /** + * Metadata completeness. + * @member {grafeas.v1.ICompleteness|null|undefined} completeness + * @memberof grafeas.v1.Metadata + * @instance + */ + Metadata.prototype.completeness = null; + + /** + * Metadata reproducible. + * @member {boolean} reproducible + * @memberof grafeas.v1.Metadata + * @instance + */ + Metadata.prototype.reproducible = false; + + /** + * Creates a new Metadata instance using the specified properties. + * @function create + * @memberof grafeas.v1.Metadata + * @static + * @param {grafeas.v1.IMetadata=} [properties] Properties to set + * @returns {grafeas.v1.Metadata} Metadata instance + */ + Metadata.create = function create(properties) { + return new Metadata(properties); + }; + + /** + * Encodes the specified Metadata message. Does not implicitly {@link grafeas.v1.Metadata.verify|verify} messages. + * @function encode + * @memberof grafeas.v1.Metadata + * @static + * @param {grafeas.v1.IMetadata} message Metadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.buildInvocationId != null && Object.hasOwnProperty.call(message, "buildInvocationId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.buildInvocationId); + if (message.buildStartedOn != null && Object.hasOwnProperty.call(message, "buildStartedOn")) + $root.google.protobuf.Timestamp.encode(message.buildStartedOn, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.buildFinishedOn != null && Object.hasOwnProperty.call(message, "buildFinishedOn")) + $root.google.protobuf.Timestamp.encode(message.buildFinishedOn, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.completeness != null && Object.hasOwnProperty.call(message, "completeness")) + $root.grafeas.v1.Completeness.encode(message.completeness, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reproducible != null && Object.hasOwnProperty.call(message, "reproducible")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reproducible); + return writer; + }; + + /** + * Encodes the specified Metadata message, length delimited. Does not implicitly {@link grafeas.v1.Metadata.verify|verify} messages. + * @function encodeDelimited + * @memberof grafeas.v1.Metadata + * @static + * @param {grafeas.v1.IMetadata} message Metadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Metadata message from the specified reader or buffer. + * @function decode + * @memberof grafeas.v1.Metadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {grafeas.v1.Metadata} Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.Metadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.buildInvocationId = reader.string(); + break; + case 2: + message.buildStartedOn = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.buildFinishedOn = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 4: + message.completeness = $root.grafeas.v1.Completeness.decode(reader, reader.uint32()); + break; + case 5: + message.reproducible = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Metadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof grafeas.v1.Metadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {grafeas.v1.Metadata} Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Metadata message. + * @function verify + * @memberof grafeas.v1.Metadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Metadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.buildInvocationId != null && message.hasOwnProperty("buildInvocationId")) + if (!$util.isString(message.buildInvocationId)) + return "buildInvocationId: string expected"; + if (message.buildStartedOn != null && message.hasOwnProperty("buildStartedOn")) { + var error = $root.google.protobuf.Timestamp.verify(message.buildStartedOn); + if (error) + return "buildStartedOn." + error; + } + if (message.buildFinishedOn != null && message.hasOwnProperty("buildFinishedOn")) { + var error = $root.google.protobuf.Timestamp.verify(message.buildFinishedOn); + if (error) + return "buildFinishedOn." + error; + } + if (message.completeness != null && message.hasOwnProperty("completeness")) { + var error = $root.grafeas.v1.Completeness.verify(message.completeness); + if (error) + return "completeness." + error; + } + if (message.reproducible != null && message.hasOwnProperty("reproducible")) + if (typeof message.reproducible !== "boolean") + return "reproducible: boolean expected"; + return null; + }; + + /** + * Creates a Metadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof grafeas.v1.Metadata + * @static + * @param {Object.} object Plain object + * @returns {grafeas.v1.Metadata} Metadata + */ + Metadata.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.Metadata) + return object; + var message = new $root.grafeas.v1.Metadata(); + if (object.buildInvocationId != null) + message.buildInvocationId = String(object.buildInvocationId); + if (object.buildStartedOn != null) { + if (typeof object.buildStartedOn !== "object") + throw TypeError(".grafeas.v1.Metadata.buildStartedOn: object expected"); + message.buildStartedOn = $root.google.protobuf.Timestamp.fromObject(object.buildStartedOn); + } + if (object.buildFinishedOn != null) { + if (typeof object.buildFinishedOn !== "object") + throw TypeError(".grafeas.v1.Metadata.buildFinishedOn: object expected"); + message.buildFinishedOn = $root.google.protobuf.Timestamp.fromObject(object.buildFinishedOn); + } + if (object.completeness != null) { + if (typeof object.completeness !== "object") + throw TypeError(".grafeas.v1.Metadata.completeness: object expected"); + message.completeness = $root.grafeas.v1.Completeness.fromObject(object.completeness); + } + if (object.reproducible != null) + message.reproducible = Boolean(object.reproducible); + return message; + }; + + /** + * Creates a plain object from a Metadata message. Also converts values to other types if specified. + * @function toObject + * @memberof grafeas.v1.Metadata + * @static + * @param {grafeas.v1.Metadata} message Metadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Metadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.buildInvocationId = ""; + object.buildStartedOn = null; + object.buildFinishedOn = null; + object.completeness = null; + object.reproducible = false; + } + if (message.buildInvocationId != null && message.hasOwnProperty("buildInvocationId")) + object.buildInvocationId = message.buildInvocationId; + if (message.buildStartedOn != null && message.hasOwnProperty("buildStartedOn")) + object.buildStartedOn = $root.google.protobuf.Timestamp.toObject(message.buildStartedOn, options); + if (message.buildFinishedOn != null && message.hasOwnProperty("buildFinishedOn")) + object.buildFinishedOn = $root.google.protobuf.Timestamp.toObject(message.buildFinishedOn, options); + if (message.completeness != null && message.hasOwnProperty("completeness")) + object.completeness = $root.grafeas.v1.Completeness.toObject(message.completeness, options); + if (message.reproducible != null && message.hasOwnProperty("reproducible")) + object.reproducible = message.reproducible; + return object; + }; + + /** + * Converts this Metadata to JSON. + * @function toJSON + * @memberof grafeas.v1.Metadata + * @instance + * @returns {Object.} JSON object + */ + Metadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Metadata; + })(); + + v1.BuilderConfig = (function() { + + /** + * Properties of a BuilderConfig. + * @memberof grafeas.v1 + * @interface IBuilderConfig + * @property {string|null} [id] BuilderConfig id + */ + + /** + * Constructs a new BuilderConfig. + * @memberof grafeas.v1 + * @classdesc Represents a BuilderConfig. + * @implements IBuilderConfig + * @constructor + * @param {grafeas.v1.IBuilderConfig=} [properties] Properties to set + */ + function BuilderConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BuilderConfig id. + * @member {string} id + * @memberof grafeas.v1.BuilderConfig + * @instance + */ + BuilderConfig.prototype.id = ""; + + /** + * Creates a new BuilderConfig instance using the specified properties. + * @function create + * @memberof grafeas.v1.BuilderConfig + * @static + * @param {grafeas.v1.IBuilderConfig=} [properties] Properties to set + * @returns {grafeas.v1.BuilderConfig} BuilderConfig instance + */ + BuilderConfig.create = function create(properties) { + return new BuilderConfig(properties); + }; + + /** + * Encodes the specified BuilderConfig message. Does not implicitly {@link grafeas.v1.BuilderConfig.verify|verify} messages. + * @function encode + * @memberof grafeas.v1.BuilderConfig + * @static + * @param {grafeas.v1.IBuilderConfig} message BuilderConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BuilderConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + return writer; + }; + + /** + * Encodes the specified BuilderConfig message, length delimited. Does not implicitly {@link grafeas.v1.BuilderConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof grafeas.v1.BuilderConfig + * @static + * @param {grafeas.v1.IBuilderConfig} message BuilderConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BuilderConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BuilderConfig message from the specified reader or buffer. + * @function decode + * @memberof grafeas.v1.BuilderConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {grafeas.v1.BuilderConfig} BuilderConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BuilderConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.BuilderConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BuilderConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof grafeas.v1.BuilderConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {grafeas.v1.BuilderConfig} BuilderConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BuilderConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BuilderConfig message. + * @function verify + * @memberof grafeas.v1.BuilderConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BuilderConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + return null; + }; + + /** + * Creates a BuilderConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof grafeas.v1.BuilderConfig + * @static + * @param {Object.} object Plain object + * @returns {grafeas.v1.BuilderConfig} BuilderConfig + */ + BuilderConfig.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.BuilderConfig) + return object; + var message = new $root.grafeas.v1.BuilderConfig(); + if (object.id != null) + message.id = String(object.id); + return message; + }; + + /** + * Creates a plain object from a BuilderConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof grafeas.v1.BuilderConfig + * @static + * @param {grafeas.v1.BuilderConfig} message BuilderConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BuilderConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.id = ""; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + return object; + }; + + /** + * Converts this BuilderConfig to JSON. + * @function toJSON + * @memberof grafeas.v1.BuilderConfig + * @instance + * @returns {Object.} JSON object + */ + BuilderConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BuilderConfig; + })(); + + v1.InTotoProvenance = (function() { + + /** + * Properties of an InTotoProvenance. + * @memberof grafeas.v1 + * @interface IInTotoProvenance + * @property {grafeas.v1.IBuilderConfig|null} [builderConfig] InTotoProvenance builderConfig + * @property {grafeas.v1.IRecipe|null} [recipe] InTotoProvenance recipe + * @property {grafeas.v1.IMetadata|null} [metadata] InTotoProvenance metadata + * @property {Array.|null} [materials] InTotoProvenance materials + */ + + /** + * Constructs a new InTotoProvenance. + * @memberof grafeas.v1 + * @classdesc Represents an InTotoProvenance. + * @implements IInTotoProvenance + * @constructor + * @param {grafeas.v1.IInTotoProvenance=} [properties] Properties to set + */ + function InTotoProvenance(properties) { + this.materials = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InTotoProvenance builderConfig. + * @member {grafeas.v1.IBuilderConfig|null|undefined} builderConfig + * @memberof grafeas.v1.InTotoProvenance + * @instance + */ + InTotoProvenance.prototype.builderConfig = null; + + /** + * InTotoProvenance recipe. + * @member {grafeas.v1.IRecipe|null|undefined} recipe + * @memberof grafeas.v1.InTotoProvenance + * @instance + */ + InTotoProvenance.prototype.recipe = null; + + /** + * InTotoProvenance metadata. + * @member {grafeas.v1.IMetadata|null|undefined} metadata + * @memberof grafeas.v1.InTotoProvenance + * @instance + */ + InTotoProvenance.prototype.metadata = null; + + /** + * InTotoProvenance materials. + * @member {Array.} materials + * @memberof grafeas.v1.InTotoProvenance + * @instance + */ + InTotoProvenance.prototype.materials = $util.emptyArray; + + /** + * Creates a new InTotoProvenance instance using the specified properties. + * @function create + * @memberof grafeas.v1.InTotoProvenance + * @static + * @param {grafeas.v1.IInTotoProvenance=} [properties] Properties to set + * @returns {grafeas.v1.InTotoProvenance} InTotoProvenance instance + */ + InTotoProvenance.create = function create(properties) { + return new InTotoProvenance(properties); + }; + + /** + * Encodes the specified InTotoProvenance message. Does not implicitly {@link grafeas.v1.InTotoProvenance.verify|verify} messages. + * @function encode + * @memberof grafeas.v1.InTotoProvenance + * @static + * @param {grafeas.v1.IInTotoProvenance} message InTotoProvenance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InTotoProvenance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.builderConfig != null && Object.hasOwnProperty.call(message, "builderConfig")) + $root.grafeas.v1.BuilderConfig.encode(message.builderConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.recipe != null && Object.hasOwnProperty.call(message, "recipe")) + $root.grafeas.v1.Recipe.encode(message.recipe, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.grafeas.v1.Metadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.materials != null && message.materials.length) + for (var i = 0; i < message.materials.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.materials[i]); + return writer; + }; + + /** + * Encodes the specified InTotoProvenance message, length delimited. Does not implicitly {@link grafeas.v1.InTotoProvenance.verify|verify} messages. + * @function encodeDelimited + * @memberof grafeas.v1.InTotoProvenance + * @static + * @param {grafeas.v1.IInTotoProvenance} message InTotoProvenance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InTotoProvenance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InTotoProvenance message from the specified reader or buffer. + * @function decode + * @memberof grafeas.v1.InTotoProvenance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {grafeas.v1.InTotoProvenance} InTotoProvenance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InTotoProvenance.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.InTotoProvenance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.builderConfig = $root.grafeas.v1.BuilderConfig.decode(reader, reader.uint32()); + break; + case 2: + message.recipe = $root.grafeas.v1.Recipe.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.grafeas.v1.Metadata.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.materials && message.materials.length)) + message.materials = []; + message.materials.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InTotoProvenance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof grafeas.v1.InTotoProvenance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {grafeas.v1.InTotoProvenance} InTotoProvenance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InTotoProvenance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InTotoProvenance message. + * @function verify + * @memberof grafeas.v1.InTotoProvenance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InTotoProvenance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.builderConfig != null && message.hasOwnProperty("builderConfig")) { + var error = $root.grafeas.v1.BuilderConfig.verify(message.builderConfig); + if (error) + return "builderConfig." + error; + } + if (message.recipe != null && message.hasOwnProperty("recipe")) { + var error = $root.grafeas.v1.Recipe.verify(message.recipe); + if (error) + return "recipe." + error; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.grafeas.v1.Metadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.materials != null && message.hasOwnProperty("materials")) { + if (!Array.isArray(message.materials)) + return "materials: array expected"; + for (var i = 0; i < message.materials.length; ++i) + if (!$util.isString(message.materials[i])) + return "materials: string[] expected"; + } + return null; + }; + + /** + * Creates an InTotoProvenance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof grafeas.v1.InTotoProvenance + * @static + * @param {Object.} object Plain object + * @returns {grafeas.v1.InTotoProvenance} InTotoProvenance + */ + InTotoProvenance.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.InTotoProvenance) + return object; + var message = new $root.grafeas.v1.InTotoProvenance(); + if (object.builderConfig != null) { + if (typeof object.builderConfig !== "object") + throw TypeError(".grafeas.v1.InTotoProvenance.builderConfig: object expected"); + message.builderConfig = $root.grafeas.v1.BuilderConfig.fromObject(object.builderConfig); + } + if (object.recipe != null) { + if (typeof object.recipe !== "object") + throw TypeError(".grafeas.v1.InTotoProvenance.recipe: object expected"); + message.recipe = $root.grafeas.v1.Recipe.fromObject(object.recipe); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".grafeas.v1.InTotoProvenance.metadata: object expected"); + message.metadata = $root.grafeas.v1.Metadata.fromObject(object.metadata); + } + if (object.materials) { + if (!Array.isArray(object.materials)) + throw TypeError(".grafeas.v1.InTotoProvenance.materials: array expected"); + message.materials = []; + for (var i = 0; i < object.materials.length; ++i) + message.materials[i] = String(object.materials[i]); + } + return message; + }; + + /** + * Creates a plain object from an InTotoProvenance message. Also converts values to other types if specified. + * @function toObject + * @memberof grafeas.v1.InTotoProvenance + * @static + * @param {grafeas.v1.InTotoProvenance} message InTotoProvenance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InTotoProvenance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.materials = []; + if (options.defaults) { + object.builderConfig = null; + object.recipe = null; + object.metadata = null; + } + if (message.builderConfig != null && message.hasOwnProperty("builderConfig")) + object.builderConfig = $root.grafeas.v1.BuilderConfig.toObject(message.builderConfig, options); + if (message.recipe != null && message.hasOwnProperty("recipe")) + object.recipe = $root.grafeas.v1.Recipe.toObject(message.recipe, options); + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.grafeas.v1.Metadata.toObject(message.metadata, options); + if (message.materials && message.materials.length) { + object.materials = []; + for (var j = 0; j < message.materials.length; ++j) + object.materials[j] = message.materials[j]; + } + return object; + }; + + /** + * Converts this InTotoProvenance to JSON. + * @function toJSON + * @memberof grafeas.v1.InTotoProvenance + * @instance + * @returns {Object.} JSON object + */ + InTotoProvenance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InTotoProvenance; + })(); + + v1.InTotoStatement = (function() { + + /** + * Properties of an InTotoStatement. + * @memberof grafeas.v1 + * @interface IInTotoStatement + * @property {string|null} [type] InTotoStatement type + * @property {Array.|null} [subject] InTotoStatement subject + * @property {string|null} [predicateType] InTotoStatement predicateType + * @property {grafeas.v1.IInTotoProvenance|null} [provenance] InTotoStatement provenance + * @property {grafeas.v1.ISlsaProvenance|null} [slsaProvenance] InTotoStatement slsaProvenance + */ + + /** + * Constructs a new InTotoStatement. + * @memberof grafeas.v1 + * @classdesc Represents an InTotoStatement. + * @implements IInTotoStatement + * @constructor + * @param {grafeas.v1.IInTotoStatement=} [properties] Properties to set + */ + function InTotoStatement(properties) { + this.subject = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InTotoStatement type. + * @member {string} type + * @memberof grafeas.v1.InTotoStatement + * @instance + */ + InTotoStatement.prototype.type = ""; + + /** + * InTotoStatement subject. + * @member {Array.} subject + * @memberof grafeas.v1.InTotoStatement + * @instance + */ + InTotoStatement.prototype.subject = $util.emptyArray; + + /** + * InTotoStatement predicateType. + * @member {string} predicateType + * @memberof grafeas.v1.InTotoStatement + * @instance + */ + InTotoStatement.prototype.predicateType = ""; + + /** + * InTotoStatement provenance. + * @member {grafeas.v1.IInTotoProvenance|null|undefined} provenance + * @memberof grafeas.v1.InTotoStatement + * @instance + */ + InTotoStatement.prototype.provenance = null; + + /** + * InTotoStatement slsaProvenance. + * @member {grafeas.v1.ISlsaProvenance|null|undefined} slsaProvenance + * @memberof grafeas.v1.InTotoStatement + * @instance + */ + InTotoStatement.prototype.slsaProvenance = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InTotoStatement predicate. + * @member {"provenance"|"slsaProvenance"|undefined} predicate + * @memberof grafeas.v1.InTotoStatement + * @instance + */ + Object.defineProperty(InTotoStatement.prototype, "predicate", { + get: $util.oneOfGetter($oneOfFields = ["provenance", "slsaProvenance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InTotoStatement instance using the specified properties. + * @function create + * @memberof grafeas.v1.InTotoStatement + * @static + * @param {grafeas.v1.IInTotoStatement=} [properties] Properties to set + * @returns {grafeas.v1.InTotoStatement} InTotoStatement instance + */ + InTotoStatement.create = function create(properties) { + return new InTotoStatement(properties); + }; + + /** + * Encodes the specified InTotoStatement message. Does not implicitly {@link grafeas.v1.InTotoStatement.verify|verify} messages. + * @function encode + * @memberof grafeas.v1.InTotoStatement + * @static + * @param {grafeas.v1.IInTotoStatement} message InTotoStatement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InTotoStatement.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.subject != null && message.subject.length) + for (var i = 0; i < message.subject.length; ++i) + $root.grafeas.v1.Subject.encode(message.subject[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.predicateType != null && Object.hasOwnProperty.call(message, "predicateType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.predicateType); + if (message.provenance != null && Object.hasOwnProperty.call(message, "provenance")) + $root.grafeas.v1.InTotoProvenance.encode(message.provenance, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.slsaProvenance != null && Object.hasOwnProperty.call(message, "slsaProvenance")) + $root.grafeas.v1.SlsaProvenance.encode(message.slsaProvenance, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InTotoStatement message, length delimited. Does not implicitly {@link grafeas.v1.InTotoStatement.verify|verify} messages. + * @function encodeDelimited + * @memberof grafeas.v1.InTotoStatement + * @static + * @param {grafeas.v1.IInTotoStatement} message InTotoStatement message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InTotoStatement.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InTotoStatement message from the specified reader or buffer. + * @function decode + * @memberof grafeas.v1.InTotoStatement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {grafeas.v1.InTotoStatement} InTotoStatement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InTotoStatement.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.InTotoStatement(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + if (!(message.subject && message.subject.length)) + message.subject = []; + message.subject.push($root.grafeas.v1.Subject.decode(reader, reader.uint32())); + break; + case 3: + message.predicateType = reader.string(); + break; + case 4: + message.provenance = $root.grafeas.v1.InTotoProvenance.decode(reader, reader.uint32()); + break; + case 5: + message.slsaProvenance = $root.grafeas.v1.SlsaProvenance.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InTotoStatement message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof grafeas.v1.InTotoStatement + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {grafeas.v1.InTotoStatement} InTotoStatement + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InTotoStatement.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InTotoStatement message. + * @function verify + * @memberof grafeas.v1.InTotoStatement + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InTotoStatement.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.subject != null && message.hasOwnProperty("subject")) { + if (!Array.isArray(message.subject)) + return "subject: array expected"; + for (var i = 0; i < message.subject.length; ++i) { + var error = $root.grafeas.v1.Subject.verify(message.subject[i]); + if (error) + return "subject." + error; + } + } + if (message.predicateType != null && message.hasOwnProperty("predicateType")) + if (!$util.isString(message.predicateType)) + return "predicateType: string expected"; + if (message.provenance != null && message.hasOwnProperty("provenance")) { + properties.predicate = 1; + { + var error = $root.grafeas.v1.InTotoProvenance.verify(message.provenance); + if (error) + return "provenance." + error; + } + } + if (message.slsaProvenance != null && message.hasOwnProperty("slsaProvenance")) { + if (properties.predicate === 1) + return "predicate: multiple values"; + properties.predicate = 1; + { + var error = $root.grafeas.v1.SlsaProvenance.verify(message.slsaProvenance); + if (error) + return "slsaProvenance." + error; + } + } + return null; + }; + + /** + * Creates an InTotoStatement message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof grafeas.v1.InTotoStatement + * @static + * @param {Object.} object Plain object + * @returns {grafeas.v1.InTotoStatement} InTotoStatement + */ + InTotoStatement.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.InTotoStatement) + return object; + var message = new $root.grafeas.v1.InTotoStatement(); + if (object.type != null) + message.type = String(object.type); + if (object.subject) { + if (!Array.isArray(object.subject)) + throw TypeError(".grafeas.v1.InTotoStatement.subject: array expected"); + message.subject = []; + for (var i = 0; i < object.subject.length; ++i) { + if (typeof object.subject[i] !== "object") + throw TypeError(".grafeas.v1.InTotoStatement.subject: object expected"); + message.subject[i] = $root.grafeas.v1.Subject.fromObject(object.subject[i]); + } + } + if (object.predicateType != null) + message.predicateType = String(object.predicateType); + if (object.provenance != null) { + if (typeof object.provenance !== "object") + throw TypeError(".grafeas.v1.InTotoStatement.provenance: object expected"); + message.provenance = $root.grafeas.v1.InTotoProvenance.fromObject(object.provenance); + } + if (object.slsaProvenance != null) { + if (typeof object.slsaProvenance !== "object") + throw TypeError(".grafeas.v1.InTotoStatement.slsaProvenance: object expected"); + message.slsaProvenance = $root.grafeas.v1.SlsaProvenance.fromObject(object.slsaProvenance); + } + return message; + }; + + /** + * Creates a plain object from an InTotoStatement message. Also converts values to other types if specified. + * @function toObject + * @memberof grafeas.v1.InTotoStatement + * @static + * @param {grafeas.v1.InTotoStatement} message InTotoStatement + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InTotoStatement.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.subject = []; + if (options.defaults) { + object.type = ""; + object.predicateType = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.subject && message.subject.length) { + object.subject = []; + for (var j = 0; j < message.subject.length; ++j) + object.subject[j] = $root.grafeas.v1.Subject.toObject(message.subject[j], options); + } + if (message.predicateType != null && message.hasOwnProperty("predicateType")) + object.predicateType = message.predicateType; + if (message.provenance != null && message.hasOwnProperty("provenance")) { + object.provenance = $root.grafeas.v1.InTotoProvenance.toObject(message.provenance, options); + if (options.oneofs) + object.predicate = "provenance"; + } + if (message.slsaProvenance != null && message.hasOwnProperty("slsaProvenance")) { + object.slsaProvenance = $root.grafeas.v1.SlsaProvenance.toObject(message.slsaProvenance, options); + if (options.oneofs) + object.predicate = "slsaProvenance"; + } + return object; + }; + + /** + * Converts this InTotoStatement to JSON. + * @function toJSON + * @memberof grafeas.v1.InTotoStatement + * @instance + * @returns {Object.} JSON object + */ + InTotoStatement.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InTotoStatement; + })(); + + v1.Subject = (function() { + + /** + * Properties of a Subject. + * @memberof grafeas.v1 + * @interface ISubject + * @property {string|null} [name] Subject name + * @property {Object.|null} [digest] Subject digest + */ + + /** + * Constructs a new Subject. + * @memberof grafeas.v1 + * @classdesc Represents a Subject. + * @implements ISubject + * @constructor + * @param {grafeas.v1.ISubject=} [properties] Properties to set + */ + function Subject(properties) { + this.digest = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Subject name. + * @member {string} name + * @memberof grafeas.v1.Subject + * @instance + */ + Subject.prototype.name = ""; + + /** + * Subject digest. + * @member {Object.} digest + * @memberof grafeas.v1.Subject + * @instance + */ + Subject.prototype.digest = $util.emptyObject; + + /** + * Creates a new Subject instance using the specified properties. + * @function create + * @memberof grafeas.v1.Subject + * @static + * @param {grafeas.v1.ISubject=} [properties] Properties to set + * @returns {grafeas.v1.Subject} Subject instance + */ + Subject.create = function create(properties) { + return new Subject(properties); + }; + + /** + * Encodes the specified Subject message. Does not implicitly {@link grafeas.v1.Subject.verify|verify} messages. + * @function encode + * @memberof grafeas.v1.Subject + * @static + * @param {grafeas.v1.ISubject} message Subject message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Subject.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.digest != null && Object.hasOwnProperty.call(message, "digest")) + for (var keys = Object.keys(message.digest), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.digest[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified Subject message, length delimited. Does not implicitly {@link grafeas.v1.Subject.verify|verify} messages. + * @function encodeDelimited + * @memberof grafeas.v1.Subject + * @static + * @param {grafeas.v1.ISubject} message Subject message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Subject.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Subject message from the specified reader or buffer. + * @function decode + * @memberof grafeas.v1.Subject + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {grafeas.v1.Subject} Subject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Subject.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.Subject(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (message.digest === $util.emptyObject) + message.digest = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.digest[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Subject message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof grafeas.v1.Subject + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {grafeas.v1.Subject} Subject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Subject.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Subject message. + * @function verify + * @memberof grafeas.v1.Subject + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Subject.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.digest != null && message.hasOwnProperty("digest")) { + if (!$util.isObject(message.digest)) + return "digest: object expected"; + var key = Object.keys(message.digest); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.digest[key[i]])) + return "digest: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a Subject message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof grafeas.v1.Subject + * @static + * @param {Object.} object Plain object + * @returns {grafeas.v1.Subject} Subject + */ + Subject.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.Subject) + return object; + var message = new $root.grafeas.v1.Subject(); + if (object.name != null) + message.name = String(object.name); + if (object.digest) { + if (typeof object.digest !== "object") + throw TypeError(".grafeas.v1.Subject.digest: object expected"); + message.digest = {}; + for (var keys = Object.keys(object.digest), i = 0; i < keys.length; ++i) + message.digest[keys[i]] = String(object.digest[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a Subject message. Also converts values to other types if specified. + * @function toObject + * @memberof grafeas.v1.Subject + * @static + * @param {grafeas.v1.Subject} message Subject + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Subject.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.digest = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + var keys2; + if (message.digest && (keys2 = Object.keys(message.digest)).length) { + object.digest = {}; + for (var j = 0; j < keys2.length; ++j) + object.digest[keys2[j]] = message.digest[keys2[j]]; + } + return object; + }; + + /** + * Converts this Subject to JSON. + * @function toJSON + * @memberof grafeas.v1.Subject + * @instance + * @returns {Object.} JSON object + */ + Subject.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Subject; + })(); + + v1.SlsaProvenance = (function() { + + /** + * Properties of a SlsaProvenance. + * @memberof grafeas.v1 + * @interface ISlsaProvenance + * @property {grafeas.v1.SlsaProvenance.ISlsaBuilder|null} [builder] SlsaProvenance builder + * @property {grafeas.v1.SlsaProvenance.ISlsaRecipe|null} [recipe] SlsaProvenance recipe + * @property {grafeas.v1.SlsaProvenance.ISlsaMetadata|null} [metadata] SlsaProvenance metadata + * @property {Array.|null} [materials] SlsaProvenance materials + */ + + /** + * Constructs a new SlsaProvenance. + * @memberof grafeas.v1 + * @classdesc Represents a SlsaProvenance. + * @implements ISlsaProvenance + * @constructor + * @param {grafeas.v1.ISlsaProvenance=} [properties] Properties to set + */ + function SlsaProvenance(properties) { + this.materials = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SlsaProvenance builder. + * @member {grafeas.v1.SlsaProvenance.ISlsaBuilder|null|undefined} builder + * @memberof grafeas.v1.SlsaProvenance + * @instance + */ + SlsaProvenance.prototype.builder = null; + + /** + * SlsaProvenance recipe. + * @member {grafeas.v1.SlsaProvenance.ISlsaRecipe|null|undefined} recipe + * @memberof grafeas.v1.SlsaProvenance + * @instance + */ + SlsaProvenance.prototype.recipe = null; + + /** + * SlsaProvenance metadata. + * @member {grafeas.v1.SlsaProvenance.ISlsaMetadata|null|undefined} metadata + * @memberof grafeas.v1.SlsaProvenance + * @instance + */ + SlsaProvenance.prototype.metadata = null; + + /** + * SlsaProvenance materials. + * @member {Array.} materials + * @memberof grafeas.v1.SlsaProvenance + * @instance + */ + SlsaProvenance.prototype.materials = $util.emptyArray; + + /** + * Creates a new SlsaProvenance instance using the specified properties. + * @function create + * @memberof grafeas.v1.SlsaProvenance + * @static + * @param {grafeas.v1.ISlsaProvenance=} [properties] Properties to set + * @returns {grafeas.v1.SlsaProvenance} SlsaProvenance instance + */ + SlsaProvenance.create = function create(properties) { + return new SlsaProvenance(properties); + }; + + /** + * Encodes the specified SlsaProvenance message. Does not implicitly {@link grafeas.v1.SlsaProvenance.verify|verify} messages. + * @function encode + * @memberof grafeas.v1.SlsaProvenance + * @static + * @param {grafeas.v1.ISlsaProvenance} message SlsaProvenance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SlsaProvenance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.builder != null && Object.hasOwnProperty.call(message, "builder")) + $root.grafeas.v1.SlsaProvenance.SlsaBuilder.encode(message.builder, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.recipe != null && Object.hasOwnProperty.call(message, "recipe")) + $root.grafeas.v1.SlsaProvenance.SlsaRecipe.encode(message.recipe, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.grafeas.v1.SlsaProvenance.SlsaMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.materials != null && message.materials.length) + for (var i = 0; i < message.materials.length; ++i) + $root.grafeas.v1.SlsaProvenance.Material.encode(message.materials[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SlsaProvenance message, length delimited. Does not implicitly {@link grafeas.v1.SlsaProvenance.verify|verify} messages. + * @function encodeDelimited + * @memberof grafeas.v1.SlsaProvenance + * @static + * @param {grafeas.v1.ISlsaProvenance} message SlsaProvenance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SlsaProvenance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SlsaProvenance message from the specified reader or buffer. + * @function decode + * @memberof grafeas.v1.SlsaProvenance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {grafeas.v1.SlsaProvenance} SlsaProvenance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SlsaProvenance.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.SlsaProvenance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.builder = $root.grafeas.v1.SlsaProvenance.SlsaBuilder.decode(reader, reader.uint32()); + break; + case 2: + message.recipe = $root.grafeas.v1.SlsaProvenance.SlsaRecipe.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.grafeas.v1.SlsaProvenance.SlsaMetadata.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.materials && message.materials.length)) + message.materials = []; + message.materials.push($root.grafeas.v1.SlsaProvenance.Material.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SlsaProvenance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof grafeas.v1.SlsaProvenance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {grafeas.v1.SlsaProvenance} SlsaProvenance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SlsaProvenance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SlsaProvenance message. + * @function verify + * @memberof grafeas.v1.SlsaProvenance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SlsaProvenance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.builder != null && message.hasOwnProperty("builder")) { + var error = $root.grafeas.v1.SlsaProvenance.SlsaBuilder.verify(message.builder); + if (error) + return "builder." + error; + } + if (message.recipe != null && message.hasOwnProperty("recipe")) { + var error = $root.grafeas.v1.SlsaProvenance.SlsaRecipe.verify(message.recipe); + if (error) + return "recipe." + error; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.grafeas.v1.SlsaProvenance.SlsaMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + if (message.materials != null && message.hasOwnProperty("materials")) { + if (!Array.isArray(message.materials)) + return "materials: array expected"; + for (var i = 0; i < message.materials.length; ++i) { + var error = $root.grafeas.v1.SlsaProvenance.Material.verify(message.materials[i]); + if (error) + return "materials." + error; + } + } + return null; + }; + + /** + * Creates a SlsaProvenance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof grafeas.v1.SlsaProvenance + * @static + * @param {Object.} object Plain object + * @returns {grafeas.v1.SlsaProvenance} SlsaProvenance + */ + SlsaProvenance.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.SlsaProvenance) + return object; + var message = new $root.grafeas.v1.SlsaProvenance(); + if (object.builder != null) { + if (typeof object.builder !== "object") + throw TypeError(".grafeas.v1.SlsaProvenance.builder: object expected"); + message.builder = $root.grafeas.v1.SlsaProvenance.SlsaBuilder.fromObject(object.builder); + } + if (object.recipe != null) { + if (typeof object.recipe !== "object") + throw TypeError(".grafeas.v1.SlsaProvenance.recipe: object expected"); + message.recipe = $root.grafeas.v1.SlsaProvenance.SlsaRecipe.fromObject(object.recipe); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".grafeas.v1.SlsaProvenance.metadata: object expected"); + message.metadata = $root.grafeas.v1.SlsaProvenance.SlsaMetadata.fromObject(object.metadata); + } + if (object.materials) { + if (!Array.isArray(object.materials)) + throw TypeError(".grafeas.v1.SlsaProvenance.materials: array expected"); + message.materials = []; + for (var i = 0; i < object.materials.length; ++i) { + if (typeof object.materials[i] !== "object") + throw TypeError(".grafeas.v1.SlsaProvenance.materials: object expected"); + message.materials[i] = $root.grafeas.v1.SlsaProvenance.Material.fromObject(object.materials[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SlsaProvenance message. Also converts values to other types if specified. + * @function toObject + * @memberof grafeas.v1.SlsaProvenance + * @static + * @param {grafeas.v1.SlsaProvenance} message SlsaProvenance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SlsaProvenance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.materials = []; + if (options.defaults) { + object.builder = null; + object.recipe = null; + object.metadata = null; + } + if (message.builder != null && message.hasOwnProperty("builder")) + object.builder = $root.grafeas.v1.SlsaProvenance.SlsaBuilder.toObject(message.builder, options); + if (message.recipe != null && message.hasOwnProperty("recipe")) + object.recipe = $root.grafeas.v1.SlsaProvenance.SlsaRecipe.toObject(message.recipe, options); + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.grafeas.v1.SlsaProvenance.SlsaMetadata.toObject(message.metadata, options); + if (message.materials && message.materials.length) { + object.materials = []; + for (var j = 0; j < message.materials.length; ++j) + object.materials[j] = $root.grafeas.v1.SlsaProvenance.Material.toObject(message.materials[j], options); + } + return object; + }; + + /** + * Converts this SlsaProvenance to JSON. + * @function toJSON + * @memberof grafeas.v1.SlsaProvenance + * @instance + * @returns {Object.} JSON object + */ + SlsaProvenance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + SlsaProvenance.SlsaRecipe = (function() { + + /** + * Properties of a SlsaRecipe. + * @memberof grafeas.v1.SlsaProvenance + * @interface ISlsaRecipe + * @property {string|null} [type] SlsaRecipe type + * @property {number|Long|null} [definedInMaterial] SlsaRecipe definedInMaterial + * @property {string|null} [entryPoint] SlsaRecipe entryPoint + * @property {google.protobuf.IAny|null} ["arguments"] SlsaRecipe arguments + * @property {google.protobuf.IAny|null} [environment] SlsaRecipe environment + */ + + /** + * Constructs a new SlsaRecipe. + * @memberof grafeas.v1.SlsaProvenance + * @classdesc Represents a SlsaRecipe. + * @implements ISlsaRecipe + * @constructor + * @param {grafeas.v1.SlsaProvenance.ISlsaRecipe=} [properties] Properties to set + */ + function SlsaRecipe(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SlsaRecipe type. + * @member {string} type + * @memberof grafeas.v1.SlsaProvenance.SlsaRecipe + * @instance + */ + SlsaRecipe.prototype.type = ""; + + /** + * SlsaRecipe definedInMaterial. + * @member {number|Long} definedInMaterial + * @memberof grafeas.v1.SlsaProvenance.SlsaRecipe + * @instance + */ + SlsaRecipe.prototype.definedInMaterial = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * SlsaRecipe entryPoint. + * @member {string} entryPoint + * @memberof grafeas.v1.SlsaProvenance.SlsaRecipe + * @instance + */ + SlsaRecipe.prototype.entryPoint = ""; + + /** + * SlsaRecipe arguments. + * @member {google.protobuf.IAny|null|undefined} arguments + * @memberof grafeas.v1.SlsaProvenance.SlsaRecipe + * @instance + */ + SlsaRecipe.prototype["arguments"] = null; + + /** + * SlsaRecipe environment. + * @member {google.protobuf.IAny|null|undefined} environment + * @memberof grafeas.v1.SlsaProvenance.SlsaRecipe + * @instance + */ + SlsaRecipe.prototype.environment = null; + + /** + * Creates a new SlsaRecipe instance using the specified properties. + * @function create + * @memberof grafeas.v1.SlsaProvenance.SlsaRecipe + * @static + * @param {grafeas.v1.SlsaProvenance.ISlsaRecipe=} [properties] Properties to set + * @returns {grafeas.v1.SlsaProvenance.SlsaRecipe} SlsaRecipe instance + */ + SlsaRecipe.create = function create(properties) { + return new SlsaRecipe(properties); + }; + + /** + * Encodes the specified SlsaRecipe message. Does not implicitly {@link grafeas.v1.SlsaProvenance.SlsaRecipe.verify|verify} messages. + * @function encode + * @memberof grafeas.v1.SlsaProvenance.SlsaRecipe + * @static + * @param {grafeas.v1.SlsaProvenance.ISlsaRecipe} message SlsaRecipe message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SlsaRecipe.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.definedInMaterial != null && Object.hasOwnProperty.call(message, "definedInMaterial")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.definedInMaterial); + if (message.entryPoint != null && Object.hasOwnProperty.call(message, "entryPoint")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.entryPoint); + if (message["arguments"] != null && Object.hasOwnProperty.call(message, "arguments")) + $root.google.protobuf.Any.encode(message["arguments"], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + $root.google.protobuf.Any.encode(message.environment, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SlsaRecipe message, length delimited. Does not implicitly {@link grafeas.v1.SlsaProvenance.SlsaRecipe.verify|verify} messages. + * @function encodeDelimited + * @memberof grafeas.v1.SlsaProvenance.SlsaRecipe + * @static + * @param {grafeas.v1.SlsaProvenance.ISlsaRecipe} message SlsaRecipe message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SlsaRecipe.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SlsaRecipe message from the specified reader or buffer. + * @function decode + * @memberof grafeas.v1.SlsaProvenance.SlsaRecipe + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {grafeas.v1.SlsaProvenance.SlsaRecipe} SlsaRecipe + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SlsaRecipe.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.SlsaProvenance.SlsaRecipe(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.string(); + break; + case 2: + message.definedInMaterial = reader.int64(); + break; + case 3: + message.entryPoint = reader.string(); + break; + case 4: + message["arguments"] = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + case 5: + message.environment = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SlsaRecipe message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof grafeas.v1.SlsaProvenance.SlsaRecipe + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {grafeas.v1.SlsaProvenance.SlsaRecipe} SlsaRecipe + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SlsaRecipe.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SlsaRecipe message. + * @function verify + * @memberof grafeas.v1.SlsaProvenance.SlsaRecipe + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SlsaRecipe.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.definedInMaterial != null && message.hasOwnProperty("definedInMaterial")) + if (!$util.isInteger(message.definedInMaterial) && !(message.definedInMaterial && $util.isInteger(message.definedInMaterial.low) && $util.isInteger(message.definedInMaterial.high))) + return "definedInMaterial: integer|Long expected"; + if (message.entryPoint != null && message.hasOwnProperty("entryPoint")) + if (!$util.isString(message.entryPoint)) + return "entryPoint: string expected"; + if (message["arguments"] != null && message.hasOwnProperty("arguments")) { + var error = $root.google.protobuf.Any.verify(message["arguments"]); + if (error) + return "arguments." + error; + } + if (message.environment != null && message.hasOwnProperty("environment")) { + var error = $root.google.protobuf.Any.verify(message.environment); + if (error) + return "environment." + error; + } + return null; + }; + + /** + * Creates a SlsaRecipe message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof grafeas.v1.SlsaProvenance.SlsaRecipe + * @static + * @param {Object.} object Plain object + * @returns {grafeas.v1.SlsaProvenance.SlsaRecipe} SlsaRecipe + */ + SlsaRecipe.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.SlsaProvenance.SlsaRecipe) + return object; + var message = new $root.grafeas.v1.SlsaProvenance.SlsaRecipe(); + if (object.type != null) + message.type = String(object.type); + if (object.definedInMaterial != null) + if ($util.Long) + (message.definedInMaterial = $util.Long.fromValue(object.definedInMaterial)).unsigned = false; + else if (typeof object.definedInMaterial === "string") + message.definedInMaterial = parseInt(object.definedInMaterial, 10); + else if (typeof object.definedInMaterial === "number") + message.definedInMaterial = object.definedInMaterial; + else if (typeof object.definedInMaterial === "object") + message.definedInMaterial = new $util.LongBits(object.definedInMaterial.low >>> 0, object.definedInMaterial.high >>> 0).toNumber(); + if (object.entryPoint != null) + message.entryPoint = String(object.entryPoint); + if (object["arguments"] != null) { + if (typeof object["arguments"] !== "object") + throw TypeError(".grafeas.v1.SlsaProvenance.SlsaRecipe.arguments: object expected"); + message["arguments"] = $root.google.protobuf.Any.fromObject(object["arguments"]); + } + if (object.environment != null) { + if (typeof object.environment !== "object") + throw TypeError(".grafeas.v1.SlsaProvenance.SlsaRecipe.environment: object expected"); + message.environment = $root.google.protobuf.Any.fromObject(object.environment); + } + return message; + }; + + /** + * Creates a plain object from a SlsaRecipe message. Also converts values to other types if specified. + * @function toObject + * @memberof grafeas.v1.SlsaProvenance.SlsaRecipe + * @static + * @param {grafeas.v1.SlsaProvenance.SlsaRecipe} message SlsaRecipe + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SlsaRecipe.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.definedInMaterial = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.definedInMaterial = options.longs === String ? "0" : 0; + object.entryPoint = ""; + object["arguments"] = null; + object.environment = null; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.definedInMaterial != null && message.hasOwnProperty("definedInMaterial")) + if (typeof message.definedInMaterial === "number") + object.definedInMaterial = options.longs === String ? String(message.definedInMaterial) : message.definedInMaterial; + else + object.definedInMaterial = options.longs === String ? $util.Long.prototype.toString.call(message.definedInMaterial) : options.longs === Number ? new $util.LongBits(message.definedInMaterial.low >>> 0, message.definedInMaterial.high >>> 0).toNumber() : message.definedInMaterial; + if (message.entryPoint != null && message.hasOwnProperty("entryPoint")) + object.entryPoint = message.entryPoint; + if (message["arguments"] != null && message.hasOwnProperty("arguments")) + object["arguments"] = $root.google.protobuf.Any.toObject(message["arguments"], options); + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = $root.google.protobuf.Any.toObject(message.environment, options); + return object; + }; + + /** + * Converts this SlsaRecipe to JSON. + * @function toJSON + * @memberof grafeas.v1.SlsaProvenance.SlsaRecipe + * @instance + * @returns {Object.} JSON object + */ + SlsaRecipe.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SlsaRecipe; + })(); + + SlsaProvenance.SlsaCompleteness = (function() { + + /** + * Properties of a SlsaCompleteness. + * @memberof grafeas.v1.SlsaProvenance + * @interface ISlsaCompleteness + * @property {boolean|null} ["arguments"] SlsaCompleteness arguments + * @property {boolean|null} [environment] SlsaCompleteness environment + * @property {boolean|null} [materials] SlsaCompleteness materials + */ + + /** + * Constructs a new SlsaCompleteness. + * @memberof grafeas.v1.SlsaProvenance + * @classdesc Represents a SlsaCompleteness. + * @implements ISlsaCompleteness + * @constructor + * @param {grafeas.v1.SlsaProvenance.ISlsaCompleteness=} [properties] Properties to set + */ + function SlsaCompleteness(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SlsaCompleteness arguments. + * @member {boolean} arguments + * @memberof grafeas.v1.SlsaProvenance.SlsaCompleteness + * @instance + */ + SlsaCompleteness.prototype["arguments"] = false; + + /** + * SlsaCompleteness environment. + * @member {boolean} environment + * @memberof grafeas.v1.SlsaProvenance.SlsaCompleteness + * @instance + */ + SlsaCompleteness.prototype.environment = false; + + /** + * SlsaCompleteness materials. + * @member {boolean} materials + * @memberof grafeas.v1.SlsaProvenance.SlsaCompleteness + * @instance + */ + SlsaCompleteness.prototype.materials = false; + + /** + * Creates a new SlsaCompleteness instance using the specified properties. + * @function create + * @memberof grafeas.v1.SlsaProvenance.SlsaCompleteness + * @static + * @param {grafeas.v1.SlsaProvenance.ISlsaCompleteness=} [properties] Properties to set + * @returns {grafeas.v1.SlsaProvenance.SlsaCompleteness} SlsaCompleteness instance + */ + SlsaCompleteness.create = function create(properties) { + return new SlsaCompleteness(properties); + }; + + /** + * Encodes the specified SlsaCompleteness message. Does not implicitly {@link grafeas.v1.SlsaProvenance.SlsaCompleteness.verify|verify} messages. + * @function encode + * @memberof grafeas.v1.SlsaProvenance.SlsaCompleteness + * @static + * @param {grafeas.v1.SlsaProvenance.ISlsaCompleteness} message SlsaCompleteness message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SlsaCompleteness.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message["arguments"] != null && Object.hasOwnProperty.call(message, "arguments")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message["arguments"]); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.environment); + if (message.materials != null && Object.hasOwnProperty.call(message, "materials")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.materials); + return writer; + }; + + /** + * Encodes the specified SlsaCompleteness message, length delimited. Does not implicitly {@link grafeas.v1.SlsaProvenance.SlsaCompleteness.verify|verify} messages. + * @function encodeDelimited + * @memberof grafeas.v1.SlsaProvenance.SlsaCompleteness + * @static + * @param {grafeas.v1.SlsaProvenance.ISlsaCompleteness} message SlsaCompleteness message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SlsaCompleteness.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SlsaCompleteness message from the specified reader or buffer. + * @function decode + * @memberof grafeas.v1.SlsaProvenance.SlsaCompleteness + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {grafeas.v1.SlsaProvenance.SlsaCompleteness} SlsaCompleteness + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SlsaCompleteness.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.SlsaProvenance.SlsaCompleteness(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message["arguments"] = reader.bool(); + break; + case 2: + message.environment = reader.bool(); + break; + case 3: + message.materials = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SlsaCompleteness message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof grafeas.v1.SlsaProvenance.SlsaCompleteness + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {grafeas.v1.SlsaProvenance.SlsaCompleteness} SlsaCompleteness + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SlsaCompleteness.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SlsaCompleteness message. + * @function verify + * @memberof grafeas.v1.SlsaProvenance.SlsaCompleteness + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SlsaCompleteness.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message["arguments"] != null && message.hasOwnProperty("arguments")) + if (typeof message["arguments"] !== "boolean") + return "arguments: boolean expected"; + if (message.environment != null && message.hasOwnProperty("environment")) + if (typeof message.environment !== "boolean") + return "environment: boolean expected"; + if (message.materials != null && message.hasOwnProperty("materials")) + if (typeof message.materials !== "boolean") + return "materials: boolean expected"; + return null; + }; + + /** + * Creates a SlsaCompleteness message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof grafeas.v1.SlsaProvenance.SlsaCompleteness + * @static + * @param {Object.} object Plain object + * @returns {grafeas.v1.SlsaProvenance.SlsaCompleteness} SlsaCompleteness + */ + SlsaCompleteness.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.SlsaProvenance.SlsaCompleteness) + return object; + var message = new $root.grafeas.v1.SlsaProvenance.SlsaCompleteness(); + if (object["arguments"] != null) + message["arguments"] = Boolean(object["arguments"]); + if (object.environment != null) + message.environment = Boolean(object.environment); + if (object.materials != null) + message.materials = Boolean(object.materials); + return message; + }; + + /** + * Creates a plain object from a SlsaCompleteness message. Also converts values to other types if specified. + * @function toObject + * @memberof grafeas.v1.SlsaProvenance.SlsaCompleteness + * @static + * @param {grafeas.v1.SlsaProvenance.SlsaCompleteness} message SlsaCompleteness + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SlsaCompleteness.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object["arguments"] = false; + object.environment = false; + object.materials = false; + } + if (message["arguments"] != null && message.hasOwnProperty("arguments")) + object["arguments"] = message["arguments"]; + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = message.environment; + if (message.materials != null && message.hasOwnProperty("materials")) + object.materials = message.materials; + return object; + }; + + /** + * Converts this SlsaCompleteness to JSON. + * @function toJSON + * @memberof grafeas.v1.SlsaProvenance.SlsaCompleteness + * @instance + * @returns {Object.} JSON object + */ + SlsaCompleteness.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SlsaCompleteness; + })(); + + SlsaProvenance.SlsaMetadata = (function() { + + /** + * Properties of a SlsaMetadata. + * @memberof grafeas.v1.SlsaProvenance + * @interface ISlsaMetadata + * @property {string|null} [buildInvocationId] SlsaMetadata buildInvocationId + * @property {google.protobuf.ITimestamp|null} [buildStartedOn] SlsaMetadata buildStartedOn + * @property {google.protobuf.ITimestamp|null} [buildFinishedOn] SlsaMetadata buildFinishedOn + * @property {grafeas.v1.SlsaProvenance.ISlsaCompleteness|null} [completeness] SlsaMetadata completeness + * @property {boolean|null} [reproducible] SlsaMetadata reproducible + */ + + /** + * Constructs a new SlsaMetadata. + * @memberof grafeas.v1.SlsaProvenance + * @classdesc Represents a SlsaMetadata. + * @implements ISlsaMetadata + * @constructor + * @param {grafeas.v1.SlsaProvenance.ISlsaMetadata=} [properties] Properties to set + */ + function SlsaMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SlsaMetadata buildInvocationId. + * @member {string} buildInvocationId + * @memberof grafeas.v1.SlsaProvenance.SlsaMetadata + * @instance + */ + SlsaMetadata.prototype.buildInvocationId = ""; + + /** + * SlsaMetadata buildStartedOn. + * @member {google.protobuf.ITimestamp|null|undefined} buildStartedOn + * @memberof grafeas.v1.SlsaProvenance.SlsaMetadata + * @instance + */ + SlsaMetadata.prototype.buildStartedOn = null; + + /** + * SlsaMetadata buildFinishedOn. + * @member {google.protobuf.ITimestamp|null|undefined} buildFinishedOn + * @memberof grafeas.v1.SlsaProvenance.SlsaMetadata + * @instance + */ + SlsaMetadata.prototype.buildFinishedOn = null; + + /** + * SlsaMetadata completeness. + * @member {grafeas.v1.SlsaProvenance.ISlsaCompleteness|null|undefined} completeness + * @memberof grafeas.v1.SlsaProvenance.SlsaMetadata + * @instance + */ + SlsaMetadata.prototype.completeness = null; + + /** + * SlsaMetadata reproducible. + * @member {boolean} reproducible + * @memberof grafeas.v1.SlsaProvenance.SlsaMetadata + * @instance + */ + SlsaMetadata.prototype.reproducible = false; + + /** + * Creates a new SlsaMetadata instance using the specified properties. + * @function create + * @memberof grafeas.v1.SlsaProvenance.SlsaMetadata + * @static + * @param {grafeas.v1.SlsaProvenance.ISlsaMetadata=} [properties] Properties to set + * @returns {grafeas.v1.SlsaProvenance.SlsaMetadata} SlsaMetadata instance + */ + SlsaMetadata.create = function create(properties) { + return new SlsaMetadata(properties); + }; + + /** + * Encodes the specified SlsaMetadata message. Does not implicitly {@link grafeas.v1.SlsaProvenance.SlsaMetadata.verify|verify} messages. + * @function encode + * @memberof grafeas.v1.SlsaProvenance.SlsaMetadata + * @static + * @param {grafeas.v1.SlsaProvenance.ISlsaMetadata} message SlsaMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SlsaMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.buildInvocationId != null && Object.hasOwnProperty.call(message, "buildInvocationId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.buildInvocationId); + if (message.buildStartedOn != null && Object.hasOwnProperty.call(message, "buildStartedOn")) + $root.google.protobuf.Timestamp.encode(message.buildStartedOn, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.buildFinishedOn != null && Object.hasOwnProperty.call(message, "buildFinishedOn")) + $root.google.protobuf.Timestamp.encode(message.buildFinishedOn, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.completeness != null && Object.hasOwnProperty.call(message, "completeness")) + $root.grafeas.v1.SlsaProvenance.SlsaCompleteness.encode(message.completeness, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reproducible != null && Object.hasOwnProperty.call(message, "reproducible")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.reproducible); + return writer; + }; + + /** + * Encodes the specified SlsaMetadata message, length delimited. Does not implicitly {@link grafeas.v1.SlsaProvenance.SlsaMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof grafeas.v1.SlsaProvenance.SlsaMetadata + * @static + * @param {grafeas.v1.SlsaProvenance.ISlsaMetadata} message SlsaMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SlsaMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SlsaMetadata message from the specified reader or buffer. + * @function decode + * @memberof grafeas.v1.SlsaProvenance.SlsaMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {grafeas.v1.SlsaProvenance.SlsaMetadata} SlsaMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SlsaMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.SlsaProvenance.SlsaMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.buildInvocationId = reader.string(); + break; + case 2: + message.buildStartedOn = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.buildFinishedOn = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 4: + message.completeness = $root.grafeas.v1.SlsaProvenance.SlsaCompleteness.decode(reader, reader.uint32()); + break; + case 5: + message.reproducible = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SlsaMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof grafeas.v1.SlsaProvenance.SlsaMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {grafeas.v1.SlsaProvenance.SlsaMetadata} SlsaMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SlsaMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SlsaMetadata message. + * @function verify + * @memberof grafeas.v1.SlsaProvenance.SlsaMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SlsaMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.buildInvocationId != null && message.hasOwnProperty("buildInvocationId")) + if (!$util.isString(message.buildInvocationId)) + return "buildInvocationId: string expected"; + if (message.buildStartedOn != null && message.hasOwnProperty("buildStartedOn")) { + var error = $root.google.protobuf.Timestamp.verify(message.buildStartedOn); + if (error) + return "buildStartedOn." + error; + } + if (message.buildFinishedOn != null && message.hasOwnProperty("buildFinishedOn")) { + var error = $root.google.protobuf.Timestamp.verify(message.buildFinishedOn); + if (error) + return "buildFinishedOn." + error; + } + if (message.completeness != null && message.hasOwnProperty("completeness")) { + var error = $root.grafeas.v1.SlsaProvenance.SlsaCompleteness.verify(message.completeness); + if (error) + return "completeness." + error; + } + if (message.reproducible != null && message.hasOwnProperty("reproducible")) + if (typeof message.reproducible !== "boolean") + return "reproducible: boolean expected"; + return null; + }; + + /** + * Creates a SlsaMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof grafeas.v1.SlsaProvenance.SlsaMetadata + * @static + * @param {Object.} object Plain object + * @returns {grafeas.v1.SlsaProvenance.SlsaMetadata} SlsaMetadata + */ + SlsaMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.SlsaProvenance.SlsaMetadata) + return object; + var message = new $root.grafeas.v1.SlsaProvenance.SlsaMetadata(); + if (object.buildInvocationId != null) + message.buildInvocationId = String(object.buildInvocationId); + if (object.buildStartedOn != null) { + if (typeof object.buildStartedOn !== "object") + throw TypeError(".grafeas.v1.SlsaProvenance.SlsaMetadata.buildStartedOn: object expected"); + message.buildStartedOn = $root.google.protobuf.Timestamp.fromObject(object.buildStartedOn); + } + if (object.buildFinishedOn != null) { + if (typeof object.buildFinishedOn !== "object") + throw TypeError(".grafeas.v1.SlsaProvenance.SlsaMetadata.buildFinishedOn: object expected"); + message.buildFinishedOn = $root.google.protobuf.Timestamp.fromObject(object.buildFinishedOn); + } + if (object.completeness != null) { + if (typeof object.completeness !== "object") + throw TypeError(".grafeas.v1.SlsaProvenance.SlsaMetadata.completeness: object expected"); + message.completeness = $root.grafeas.v1.SlsaProvenance.SlsaCompleteness.fromObject(object.completeness); + } + if (object.reproducible != null) + message.reproducible = Boolean(object.reproducible); + return message; + }; + + /** + * Creates a plain object from a SlsaMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof grafeas.v1.SlsaProvenance.SlsaMetadata + * @static + * @param {grafeas.v1.SlsaProvenance.SlsaMetadata} message SlsaMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SlsaMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.buildInvocationId = ""; + object.buildStartedOn = null; + object.buildFinishedOn = null; + object.completeness = null; + object.reproducible = false; + } + if (message.buildInvocationId != null && message.hasOwnProperty("buildInvocationId")) + object.buildInvocationId = message.buildInvocationId; + if (message.buildStartedOn != null && message.hasOwnProperty("buildStartedOn")) + object.buildStartedOn = $root.google.protobuf.Timestamp.toObject(message.buildStartedOn, options); + if (message.buildFinishedOn != null && message.hasOwnProperty("buildFinishedOn")) + object.buildFinishedOn = $root.google.protobuf.Timestamp.toObject(message.buildFinishedOn, options); + if (message.completeness != null && message.hasOwnProperty("completeness")) + object.completeness = $root.grafeas.v1.SlsaProvenance.SlsaCompleteness.toObject(message.completeness, options); + if (message.reproducible != null && message.hasOwnProperty("reproducible")) + object.reproducible = message.reproducible; + return object; + }; + + /** + * Converts this SlsaMetadata to JSON. + * @function toJSON + * @memberof grafeas.v1.SlsaProvenance.SlsaMetadata + * @instance + * @returns {Object.} JSON object + */ + SlsaMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SlsaMetadata; + })(); + + SlsaProvenance.SlsaBuilder = (function() { + + /** + * Properties of a SlsaBuilder. + * @memberof grafeas.v1.SlsaProvenance + * @interface ISlsaBuilder + * @property {string|null} [id] SlsaBuilder id + */ + + /** + * Constructs a new SlsaBuilder. + * @memberof grafeas.v1.SlsaProvenance + * @classdesc Represents a SlsaBuilder. + * @implements ISlsaBuilder + * @constructor + * @param {grafeas.v1.SlsaProvenance.ISlsaBuilder=} [properties] Properties to set + */ + function SlsaBuilder(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SlsaBuilder id. + * @member {string} id + * @memberof grafeas.v1.SlsaProvenance.SlsaBuilder + * @instance + */ + SlsaBuilder.prototype.id = ""; + + /** + * Creates a new SlsaBuilder instance using the specified properties. + * @function create + * @memberof grafeas.v1.SlsaProvenance.SlsaBuilder + * @static + * @param {grafeas.v1.SlsaProvenance.ISlsaBuilder=} [properties] Properties to set + * @returns {grafeas.v1.SlsaProvenance.SlsaBuilder} SlsaBuilder instance + */ + SlsaBuilder.create = function create(properties) { + return new SlsaBuilder(properties); + }; + + /** + * Encodes the specified SlsaBuilder message. Does not implicitly {@link grafeas.v1.SlsaProvenance.SlsaBuilder.verify|verify} messages. + * @function encode + * @memberof grafeas.v1.SlsaProvenance.SlsaBuilder + * @static + * @param {grafeas.v1.SlsaProvenance.ISlsaBuilder} message SlsaBuilder message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SlsaBuilder.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + return writer; + }; + + /** + * Encodes the specified SlsaBuilder message, length delimited. Does not implicitly {@link grafeas.v1.SlsaProvenance.SlsaBuilder.verify|verify} messages. + * @function encodeDelimited + * @memberof grafeas.v1.SlsaProvenance.SlsaBuilder + * @static + * @param {grafeas.v1.SlsaProvenance.ISlsaBuilder} message SlsaBuilder message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SlsaBuilder.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SlsaBuilder message from the specified reader or buffer. + * @function decode + * @memberof grafeas.v1.SlsaProvenance.SlsaBuilder + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {grafeas.v1.SlsaProvenance.SlsaBuilder} SlsaBuilder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SlsaBuilder.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.SlsaProvenance.SlsaBuilder(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SlsaBuilder message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof grafeas.v1.SlsaProvenance.SlsaBuilder + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {grafeas.v1.SlsaProvenance.SlsaBuilder} SlsaBuilder + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SlsaBuilder.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SlsaBuilder message. + * @function verify + * @memberof grafeas.v1.SlsaProvenance.SlsaBuilder + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SlsaBuilder.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + return null; + }; + + /** + * Creates a SlsaBuilder message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof grafeas.v1.SlsaProvenance.SlsaBuilder + * @static + * @param {Object.} object Plain object + * @returns {grafeas.v1.SlsaProvenance.SlsaBuilder} SlsaBuilder + */ + SlsaBuilder.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.SlsaProvenance.SlsaBuilder) + return object; + var message = new $root.grafeas.v1.SlsaProvenance.SlsaBuilder(); + if (object.id != null) + message.id = String(object.id); + return message; + }; + + /** + * Creates a plain object from a SlsaBuilder message. Also converts values to other types if specified. + * @function toObject + * @memberof grafeas.v1.SlsaProvenance.SlsaBuilder + * @static + * @param {grafeas.v1.SlsaProvenance.SlsaBuilder} message SlsaBuilder + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SlsaBuilder.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.id = ""; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + return object; + }; + + /** + * Converts this SlsaBuilder to JSON. + * @function toJSON + * @memberof grafeas.v1.SlsaProvenance.SlsaBuilder + * @instance + * @returns {Object.} JSON object + */ + SlsaBuilder.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SlsaBuilder; + })(); + + SlsaProvenance.Material = (function() { + + /** + * Properties of a Material. + * @memberof grafeas.v1.SlsaProvenance + * @interface IMaterial + * @property {string|null} [uri] Material uri + * @property {Object.|null} [digest] Material digest + */ + + /** + * Constructs a new Material. + * @memberof grafeas.v1.SlsaProvenance + * @classdesc Represents a Material. + * @implements IMaterial + * @constructor + * @param {grafeas.v1.SlsaProvenance.IMaterial=} [properties] Properties to set + */ + function Material(properties) { + this.digest = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Material uri. + * @member {string} uri + * @memberof grafeas.v1.SlsaProvenance.Material + * @instance + */ + Material.prototype.uri = ""; + + /** + * Material digest. + * @member {Object.} digest + * @memberof grafeas.v1.SlsaProvenance.Material + * @instance + */ + Material.prototype.digest = $util.emptyObject; + + /** + * Creates a new Material instance using the specified properties. + * @function create + * @memberof grafeas.v1.SlsaProvenance.Material + * @static + * @param {grafeas.v1.SlsaProvenance.IMaterial=} [properties] Properties to set + * @returns {grafeas.v1.SlsaProvenance.Material} Material instance + */ + Material.create = function create(properties) { + return new Material(properties); + }; + + /** + * Encodes the specified Material message. Does not implicitly {@link grafeas.v1.SlsaProvenance.Material.verify|verify} messages. + * @function encode + * @memberof grafeas.v1.SlsaProvenance.Material + * @static + * @param {grafeas.v1.SlsaProvenance.IMaterial} message Material message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Material.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.digest != null && Object.hasOwnProperty.call(message, "digest")) + for (var keys = Object.keys(message.digest), i = 0; i < keys.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.digest[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified Material message, length delimited. Does not implicitly {@link grafeas.v1.SlsaProvenance.Material.verify|verify} messages. + * @function encodeDelimited + * @memberof grafeas.v1.SlsaProvenance.Material + * @static + * @param {grafeas.v1.SlsaProvenance.IMaterial} message Material message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Material.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Material message from the specified reader or buffer. + * @function decode + * @memberof grafeas.v1.SlsaProvenance.Material + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {grafeas.v1.SlsaProvenance.Material} Material + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Material.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.SlsaProvenance.Material(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uri = reader.string(); + break; + case 2: + if (message.digest === $util.emptyObject) + message.digest = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.digest[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Material message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof grafeas.v1.SlsaProvenance.Material + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {grafeas.v1.SlsaProvenance.Material} Material + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Material.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Material message. + * @function verify + * @memberof grafeas.v1.SlsaProvenance.Material + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Material.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.digest != null && message.hasOwnProperty("digest")) { + if (!$util.isObject(message.digest)) + return "digest: object expected"; + var key = Object.keys(message.digest); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.digest[key[i]])) + return "digest: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a Material message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof grafeas.v1.SlsaProvenance.Material + * @static + * @param {Object.} object Plain object + * @returns {grafeas.v1.SlsaProvenance.Material} Material + */ + Material.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.SlsaProvenance.Material) + return object; + var message = new $root.grafeas.v1.SlsaProvenance.Material(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.digest) { + if (typeof object.digest !== "object") + throw TypeError(".grafeas.v1.SlsaProvenance.Material.digest: object expected"); + message.digest = {}; + for (var keys = Object.keys(object.digest), i = 0; i < keys.length; ++i) + message.digest[keys[i]] = String(object.digest[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a Material message. Also converts values to other types if specified. + * @function toObject + * @memberof grafeas.v1.SlsaProvenance.Material + * @static + * @param {grafeas.v1.SlsaProvenance.Material} message Material + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Material.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.digest = {}; + if (options.defaults) + object.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + var keys2; + if (message.digest && (keys2 = Object.keys(message.digest)).length) { + object.digest = {}; + for (var j = 0; j < keys2.length; ++j) + object.digest[keys2[j]] = message.digest[keys2[j]]; + } + return object; + }; + + /** + * Converts this Material to JSON. + * @function toJSON + * @memberof grafeas.v1.SlsaProvenance.Material + * @instance + * @returns {Object.} JSON object + */ + Material.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Material; + })(); + + return SlsaProvenance; + })(); + + v1.BuildProvenance = (function() { + + /** + * Properties of a BuildProvenance. + * @memberof grafeas.v1 + * @interface IBuildProvenance + * @property {string|null} [id] BuildProvenance id + * @property {string|null} [projectId] BuildProvenance projectId + * @property {Array.|null} [commands] BuildProvenance commands + * @property {Array.|null} [builtArtifacts] BuildProvenance builtArtifacts + * @property {google.protobuf.ITimestamp|null} [createTime] BuildProvenance createTime + * @property {google.protobuf.ITimestamp|null} [startTime] BuildProvenance startTime + * @property {google.protobuf.ITimestamp|null} [endTime] BuildProvenance endTime + * @property {string|null} [creator] BuildProvenance creator + * @property {string|null} [logsUri] BuildProvenance logsUri + * @property {grafeas.v1.ISource|null} [sourceProvenance] BuildProvenance sourceProvenance + * @property {string|null} [triggerId] BuildProvenance triggerId + * @property {Object.|null} [buildOptions] BuildProvenance buildOptions + * @property {string|null} [builderVersion] BuildProvenance builderVersion + */ + + /** + * Constructs a new BuildProvenance. + * @memberof grafeas.v1 + * @classdesc Represents a BuildProvenance. + * @implements IBuildProvenance + * @constructor + * @param {grafeas.v1.IBuildProvenance=} [properties] Properties to set */ - function PackageNote(properties) { - this.distribution = []; + function BuildProvenance(properties) { + this.commands = []; + this.builtArtifacts = []; + this.buildOptions = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3939,322 +10392,257 @@ } /** - * PackageNote name. - * @member {string} name - * @memberof grafeas.v1.PackageNote + * BuildProvenance id. + * @member {string} id + * @memberof grafeas.v1.BuildProvenance * @instance */ - PackageNote.prototype.name = ""; + BuildProvenance.prototype.id = ""; /** - * PackageNote distribution. - * @member {Array.} distribution - * @memberof grafeas.v1.PackageNote + * BuildProvenance projectId. + * @member {string} projectId + * @memberof grafeas.v1.BuildProvenance * @instance */ - PackageNote.prototype.distribution = $util.emptyArray; - - /** - * Creates a new PackageNote instance using the specified properties. - * @function create - * @memberof grafeas.v1.PackageNote - * @static - * @param {grafeas.v1.IPackageNote=} [properties] Properties to set - * @returns {grafeas.v1.PackageNote} PackageNote instance - */ - PackageNote.create = function create(properties) { - return new PackageNote(properties); - }; - - /** - * Encodes the specified PackageNote message. Does not implicitly {@link grafeas.v1.PackageNote.verify|verify} messages. - * @function encode - * @memberof grafeas.v1.PackageNote - * @static - * @param {grafeas.v1.IPackageNote} message PackageNote message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PackageNote.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.distribution != null && message.distribution.length) - for (var i = 0; i < message.distribution.length; ++i) - $root.grafeas.v1.Distribution.encode(message.distribution[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - return writer; - }; + BuildProvenance.prototype.projectId = ""; /** - * Encodes the specified PackageNote message, length delimited. Does not implicitly {@link grafeas.v1.PackageNote.verify|verify} messages. - * @function encodeDelimited - * @memberof grafeas.v1.PackageNote - * @static - * @param {grafeas.v1.IPackageNote} message PackageNote message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * BuildProvenance commands. + * @member {Array.} commands + * @memberof grafeas.v1.BuildProvenance + * @instance */ - PackageNote.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + BuildProvenance.prototype.commands = $util.emptyArray; /** - * Decodes a PackageNote message from the specified reader or buffer. - * @function decode - * @memberof grafeas.v1.PackageNote - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {grafeas.v1.PackageNote} PackageNote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * BuildProvenance builtArtifacts. + * @member {Array.} builtArtifacts + * @memberof grafeas.v1.BuildProvenance + * @instance */ - PackageNote.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.PackageNote(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 10: - if (!(message.distribution && message.distribution.length)) - message.distribution = []; - message.distribution.push($root.grafeas.v1.Distribution.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + BuildProvenance.prototype.builtArtifacts = $util.emptyArray; /** - * Decodes a PackageNote message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof grafeas.v1.PackageNote - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {grafeas.v1.PackageNote} PackageNote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * BuildProvenance createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof grafeas.v1.BuildProvenance + * @instance */ - PackageNote.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + BuildProvenance.prototype.createTime = null; /** - * Verifies a PackageNote message. - * @function verify - * @memberof grafeas.v1.PackageNote - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * BuildProvenance startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof grafeas.v1.BuildProvenance + * @instance */ - PackageNote.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.distribution != null && message.hasOwnProperty("distribution")) { - if (!Array.isArray(message.distribution)) - return "distribution: array expected"; - for (var i = 0; i < message.distribution.length; ++i) { - var error = $root.grafeas.v1.Distribution.verify(message.distribution[i]); - if (error) - return "distribution." + error; - } - } - return null; - }; + BuildProvenance.prototype.startTime = null; /** - * Creates a PackageNote message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof grafeas.v1.PackageNote - * @static - * @param {Object.} object Plain object - * @returns {grafeas.v1.PackageNote} PackageNote + * BuildProvenance endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof grafeas.v1.BuildProvenance + * @instance */ - PackageNote.fromObject = function fromObject(object) { - if (object instanceof $root.grafeas.v1.PackageNote) - return object; - var message = new $root.grafeas.v1.PackageNote(); - if (object.name != null) - message.name = String(object.name); - if (object.distribution) { - if (!Array.isArray(object.distribution)) - throw TypeError(".grafeas.v1.PackageNote.distribution: array expected"); - message.distribution = []; - for (var i = 0; i < object.distribution.length; ++i) { - if (typeof object.distribution[i] !== "object") - throw TypeError(".grafeas.v1.PackageNote.distribution: object expected"); - message.distribution[i] = $root.grafeas.v1.Distribution.fromObject(object.distribution[i]); - } - } - return message; - }; + BuildProvenance.prototype.endTime = null; /** - * Creates a plain object from a PackageNote message. Also converts values to other types if specified. - * @function toObject - * @memberof grafeas.v1.PackageNote - * @static - * @param {grafeas.v1.PackageNote} message PackageNote - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * BuildProvenance creator. + * @member {string} creator + * @memberof grafeas.v1.BuildProvenance + * @instance */ - PackageNote.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.distribution = []; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.distribution && message.distribution.length) { - object.distribution = []; - for (var j = 0; j < message.distribution.length; ++j) - object.distribution[j] = $root.grafeas.v1.Distribution.toObject(message.distribution[j], options); - } - return object; - }; + BuildProvenance.prototype.creator = ""; /** - * Converts this PackageNote to JSON. - * @function toJSON - * @memberof grafeas.v1.PackageNote + * BuildProvenance logsUri. + * @member {string} logsUri + * @memberof grafeas.v1.BuildProvenance * @instance - * @returns {Object.} JSON object */ - PackageNote.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PackageNote; - })(); - - v1.PackageOccurrence = (function() { + BuildProvenance.prototype.logsUri = ""; /** - * Properties of a PackageOccurrence. - * @memberof grafeas.v1 - * @interface IPackageOccurrence - * @property {string|null} [name] PackageOccurrence name - * @property {Array.|null} [location] PackageOccurrence location + * BuildProvenance sourceProvenance. + * @member {grafeas.v1.ISource|null|undefined} sourceProvenance + * @memberof grafeas.v1.BuildProvenance + * @instance */ + BuildProvenance.prototype.sourceProvenance = null; /** - * Constructs a new PackageOccurrence. - * @memberof grafeas.v1 - * @classdesc Represents a PackageOccurrence. - * @implements IPackageOccurrence - * @constructor - * @param {grafeas.v1.IPackageOccurrence=} [properties] Properties to set + * BuildProvenance triggerId. + * @member {string} triggerId + * @memberof grafeas.v1.BuildProvenance + * @instance */ - function PackageOccurrence(properties) { - this.location = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + BuildProvenance.prototype.triggerId = ""; /** - * PackageOccurrence name. - * @member {string} name - * @memberof grafeas.v1.PackageOccurrence + * BuildProvenance buildOptions. + * @member {Object.} buildOptions + * @memberof grafeas.v1.BuildProvenance * @instance */ - PackageOccurrence.prototype.name = ""; + BuildProvenance.prototype.buildOptions = $util.emptyObject; /** - * PackageOccurrence location. - * @member {Array.} location - * @memberof grafeas.v1.PackageOccurrence + * BuildProvenance builderVersion. + * @member {string} builderVersion + * @memberof grafeas.v1.BuildProvenance * @instance */ - PackageOccurrence.prototype.location = $util.emptyArray; + BuildProvenance.prototype.builderVersion = ""; /** - * Creates a new PackageOccurrence instance using the specified properties. + * Creates a new BuildProvenance instance using the specified properties. * @function create - * @memberof grafeas.v1.PackageOccurrence + * @memberof grafeas.v1.BuildProvenance * @static - * @param {grafeas.v1.IPackageOccurrence=} [properties] Properties to set - * @returns {grafeas.v1.PackageOccurrence} PackageOccurrence instance + * @param {grafeas.v1.IBuildProvenance=} [properties] Properties to set + * @returns {grafeas.v1.BuildProvenance} BuildProvenance instance */ - PackageOccurrence.create = function create(properties) { - return new PackageOccurrence(properties); + BuildProvenance.create = function create(properties) { + return new BuildProvenance(properties); }; /** - * Encodes the specified PackageOccurrence message. Does not implicitly {@link grafeas.v1.PackageOccurrence.verify|verify} messages. + * Encodes the specified BuildProvenance message. Does not implicitly {@link grafeas.v1.BuildProvenance.verify|verify} messages. * @function encode - * @memberof grafeas.v1.PackageOccurrence + * @memberof grafeas.v1.BuildProvenance * @static - * @param {grafeas.v1.IPackageOccurrence} message PackageOccurrence message or plain object to encode + * @param {grafeas.v1.IBuildProvenance} message BuildProvenance message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PackageOccurrence.encode = function encode(message, writer) { + BuildProvenance.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.location != null && message.location.length) - for (var i = 0; i < message.location.length; ++i) - $root.grafeas.v1.Location.encode(message.location[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); + if (message.commands != null && message.commands.length) + for (var i = 0; i < message.commands.length; ++i) + $root.grafeas.v1.Command.encode(message.commands[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.builtArtifacts != null && message.builtArtifacts.length) + for (var i = 0; i < message.builtArtifacts.length; ++i) + $root.grafeas.v1.Artifact.encode(message.builtArtifacts[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.creator); + if (message.logsUri != null && Object.hasOwnProperty.call(message, "logsUri")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.logsUri); + if (message.sourceProvenance != null && Object.hasOwnProperty.call(message, "sourceProvenance")) + $root.grafeas.v1.Source.encode(message.sourceProvenance, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.triggerId != null && Object.hasOwnProperty.call(message, "triggerId")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.triggerId); + if (message.buildOptions != null && Object.hasOwnProperty.call(message, "buildOptions")) + for (var keys = Object.keys(message.buildOptions), i = 0; i < keys.length; ++i) + writer.uint32(/* id 12, wireType 2 =*/98).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.buildOptions[keys[i]]).ldelim(); + if (message.builderVersion != null && Object.hasOwnProperty.call(message, "builderVersion")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.builderVersion); return writer; }; /** - * Encodes the specified PackageOccurrence message, length delimited. Does not implicitly {@link grafeas.v1.PackageOccurrence.verify|verify} messages. + * Encodes the specified BuildProvenance message, length delimited. Does not implicitly {@link grafeas.v1.BuildProvenance.verify|verify} messages. * @function encodeDelimited - * @memberof grafeas.v1.PackageOccurrence + * @memberof grafeas.v1.BuildProvenance * @static - * @param {grafeas.v1.IPackageOccurrence} message PackageOccurrence message or plain object to encode + * @param {grafeas.v1.IBuildProvenance} message BuildProvenance message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PackageOccurrence.encodeDelimited = function encodeDelimited(message, writer) { + BuildProvenance.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PackageOccurrence message from the specified reader or buffer. + * Decodes a BuildProvenance message from the specified reader or buffer. * @function decode - * @memberof grafeas.v1.PackageOccurrence + * @memberof grafeas.v1.BuildProvenance * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {grafeas.v1.PackageOccurrence} PackageOccurrence + * @returns {grafeas.v1.BuildProvenance} BuildProvenance * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PackageOccurrence.decode = function decode(reader, length) { + BuildProvenance.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.PackageOccurrence(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.BuildProvenance(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.id = reader.string(); break; case 2: - if (!(message.location && message.location.length)) - message.location = []; - message.location.push($root.grafeas.v1.Location.decode(reader, reader.uint32())); + message.projectId = reader.string(); + break; + case 3: + if (!(message.commands && message.commands.length)) + message.commands = []; + message.commands.push($root.grafeas.v1.Command.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.builtArtifacts && message.builtArtifacts.length)) + message.builtArtifacts = []; + message.builtArtifacts.push($root.grafeas.v1.Artifact.decode(reader, reader.uint32())); + break; + case 5: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 7: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 8: + message.creator = reader.string(); + break; + case 9: + message.logsUri = reader.string(); + break; + case 10: + message.sourceProvenance = $root.grafeas.v1.Source.decode(reader, reader.uint32()); + break; + case 11: + message.triggerId = reader.string(); + break; + case 12: + if (message.buildOptions === $util.emptyObject) + message.buildOptions = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.buildOptions[key] = value; + break; + case 13: + message.builderVersion = reader.string(); break; default: reader.skipType(tag & 7); @@ -4265,137 +10653,280 @@ }; /** - * Decodes a PackageOccurrence message from the specified reader or buffer, length delimited. + * Decodes a BuildProvenance message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof grafeas.v1.PackageOccurrence + * @memberof grafeas.v1.BuildProvenance * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {grafeas.v1.PackageOccurrence} PackageOccurrence + * @returns {grafeas.v1.BuildProvenance} BuildProvenance * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PackageOccurrence.decodeDelimited = function decodeDelimited(reader) { + BuildProvenance.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PackageOccurrence message. + * Verifies a BuildProvenance message. * @function verify - * @memberof grafeas.v1.PackageOccurrence + * @memberof grafeas.v1.BuildProvenance * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PackageOccurrence.verify = function verify(message) { + BuildProvenance.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.location != null && message.hasOwnProperty("location")) { - if (!Array.isArray(message.location)) - return "location: array expected"; - for (var i = 0; i < message.location.length; ++i) { - var error = $root.grafeas.v1.Location.verify(message.location[i]); + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.commands != null && message.hasOwnProperty("commands")) { + if (!Array.isArray(message.commands)) + return "commands: array expected"; + for (var i = 0; i < message.commands.length; ++i) { + var error = $root.grafeas.v1.Command.verify(message.commands[i]); if (error) - return "location." + error; + return "commands." + error; + } + } + if (message.builtArtifacts != null && message.hasOwnProperty("builtArtifacts")) { + if (!Array.isArray(message.builtArtifacts)) + return "builtArtifacts: array expected"; + for (var i = 0; i < message.builtArtifacts.length; ++i) { + var error = $root.grafeas.v1.Artifact.verify(message.builtArtifacts[i]); + if (error) + return "builtArtifacts." + error; + } + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.creator != null && message.hasOwnProperty("creator")) + if (!$util.isString(message.creator)) + return "creator: string expected"; + if (message.logsUri != null && message.hasOwnProperty("logsUri")) + if (!$util.isString(message.logsUri)) + return "logsUri: string expected"; + if (message.sourceProvenance != null && message.hasOwnProperty("sourceProvenance")) { + var error = $root.grafeas.v1.Source.verify(message.sourceProvenance); + if (error) + return "sourceProvenance." + error; + } + if (message.triggerId != null && message.hasOwnProperty("triggerId")) + if (!$util.isString(message.triggerId)) + return "triggerId: string expected"; + if (message.buildOptions != null && message.hasOwnProperty("buildOptions")) { + if (!$util.isObject(message.buildOptions)) + return "buildOptions: object expected"; + var key = Object.keys(message.buildOptions); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.buildOptions[key[i]])) + return "buildOptions: string{k:string} expected"; + } + if (message.builderVersion != null && message.hasOwnProperty("builderVersion")) + if (!$util.isString(message.builderVersion)) + return "builderVersion: string expected"; + return null; + }; + + /** + * Creates a BuildProvenance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof grafeas.v1.BuildProvenance + * @static + * @param {Object.} object Plain object + * @returns {grafeas.v1.BuildProvenance} BuildProvenance + */ + BuildProvenance.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.BuildProvenance) + return object; + var message = new $root.grafeas.v1.BuildProvenance(); + if (object.id != null) + message.id = String(object.id); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.commands) { + if (!Array.isArray(object.commands)) + throw TypeError(".grafeas.v1.BuildProvenance.commands: array expected"); + message.commands = []; + for (var i = 0; i < object.commands.length; ++i) { + if (typeof object.commands[i] !== "object") + throw TypeError(".grafeas.v1.BuildProvenance.commands: object expected"); + message.commands[i] = $root.grafeas.v1.Command.fromObject(object.commands[i]); } } - return null; - }; - - /** - * Creates a PackageOccurrence message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof grafeas.v1.PackageOccurrence - * @static - * @param {Object.} object Plain object - * @returns {grafeas.v1.PackageOccurrence} PackageOccurrence - */ - PackageOccurrence.fromObject = function fromObject(object) { - if (object instanceof $root.grafeas.v1.PackageOccurrence) - return object; - var message = new $root.grafeas.v1.PackageOccurrence(); - if (object.name != null) - message.name = String(object.name); - if (object.location) { - if (!Array.isArray(object.location)) - throw TypeError(".grafeas.v1.PackageOccurrence.location: array expected"); - message.location = []; - for (var i = 0; i < object.location.length; ++i) { - if (typeof object.location[i] !== "object") - throw TypeError(".grafeas.v1.PackageOccurrence.location: object expected"); - message.location[i] = $root.grafeas.v1.Location.fromObject(object.location[i]); + if (object.builtArtifacts) { + if (!Array.isArray(object.builtArtifacts)) + throw TypeError(".grafeas.v1.BuildProvenance.builtArtifacts: array expected"); + message.builtArtifacts = []; + for (var i = 0; i < object.builtArtifacts.length; ++i) { + if (typeof object.builtArtifacts[i] !== "object") + throw TypeError(".grafeas.v1.BuildProvenance.builtArtifacts: object expected"); + message.builtArtifacts[i] = $root.grafeas.v1.Artifact.fromObject(object.builtArtifacts[i]); } } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".grafeas.v1.BuildProvenance.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".grafeas.v1.BuildProvenance.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".grafeas.v1.BuildProvenance.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.creator != null) + message.creator = String(object.creator); + if (object.logsUri != null) + message.logsUri = String(object.logsUri); + if (object.sourceProvenance != null) { + if (typeof object.sourceProvenance !== "object") + throw TypeError(".grafeas.v1.BuildProvenance.sourceProvenance: object expected"); + message.sourceProvenance = $root.grafeas.v1.Source.fromObject(object.sourceProvenance); + } + if (object.triggerId != null) + message.triggerId = String(object.triggerId); + if (object.buildOptions) { + if (typeof object.buildOptions !== "object") + throw TypeError(".grafeas.v1.BuildProvenance.buildOptions: object expected"); + message.buildOptions = {}; + for (var keys = Object.keys(object.buildOptions), i = 0; i < keys.length; ++i) + message.buildOptions[keys[i]] = String(object.buildOptions[keys[i]]); + } + if (object.builderVersion != null) + message.builderVersion = String(object.builderVersion); return message; }; /** - * Creates a plain object from a PackageOccurrence message. Also converts values to other types if specified. + * Creates a plain object from a BuildProvenance message. Also converts values to other types if specified. * @function toObject - * @memberof grafeas.v1.PackageOccurrence + * @memberof grafeas.v1.BuildProvenance * @static - * @param {grafeas.v1.PackageOccurrence} message PackageOccurrence + * @param {grafeas.v1.BuildProvenance} message BuildProvenance * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PackageOccurrence.toObject = function toObject(message, options) { + BuildProvenance.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.location = []; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.location && message.location.length) { - object.location = []; - for (var j = 0; j < message.location.length; ++j) - object.location[j] = $root.grafeas.v1.Location.toObject(message.location[j], options); + if (options.arrays || options.defaults) { + object.commands = []; + object.builtArtifacts = []; + } + if (options.objects || options.defaults) + object.buildOptions = {}; + if (options.defaults) { + object.id = ""; + object.projectId = ""; + object.createTime = null; + object.startTime = null; + object.endTime = null; + object.creator = ""; + object.logsUri = ""; + object.sourceProvenance = null; + object.triggerId = ""; + object.builderVersion = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.commands && message.commands.length) { + object.commands = []; + for (var j = 0; j < message.commands.length; ++j) + object.commands[j] = $root.grafeas.v1.Command.toObject(message.commands[j], options); + } + if (message.builtArtifacts && message.builtArtifacts.length) { + object.builtArtifacts = []; + for (var j = 0; j < message.builtArtifacts.length; ++j) + object.builtArtifacts[j] = $root.grafeas.v1.Artifact.toObject(message.builtArtifacts[j], options); + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.creator != null && message.hasOwnProperty("creator")) + object.creator = message.creator; + if (message.logsUri != null && message.hasOwnProperty("logsUri")) + object.logsUri = message.logsUri; + if (message.sourceProvenance != null && message.hasOwnProperty("sourceProvenance")) + object.sourceProvenance = $root.grafeas.v1.Source.toObject(message.sourceProvenance, options); + if (message.triggerId != null && message.hasOwnProperty("triggerId")) + object.triggerId = message.triggerId; + var keys2; + if (message.buildOptions && (keys2 = Object.keys(message.buildOptions)).length) { + object.buildOptions = {}; + for (var j = 0; j < keys2.length; ++j) + object.buildOptions[keys2[j]] = message.buildOptions[keys2[j]]; } + if (message.builderVersion != null && message.hasOwnProperty("builderVersion")) + object.builderVersion = message.builderVersion; return object; }; /** - * Converts this PackageOccurrence to JSON. + * Converts this BuildProvenance to JSON. * @function toJSON - * @memberof grafeas.v1.PackageOccurrence + * @memberof grafeas.v1.BuildProvenance * @instance * @returns {Object.} JSON object */ - PackageOccurrence.prototype.toJSON = function toJSON() { + BuildProvenance.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return PackageOccurrence; + return BuildProvenance; })(); - v1.Version = (function() { + v1.Source = (function() { /** - * Properties of a Version. + * Properties of a Source. * @memberof grafeas.v1 - * @interface IVersion - * @property {number|null} [epoch] Version epoch - * @property {string|null} [name] Version name - * @property {string|null} [revision] Version revision - * @property {grafeas.v1.Version.VersionKind|null} [kind] Version kind - * @property {string|null} [fullName] Version fullName + * @interface ISource + * @property {string|null} [artifactStorageSourceUri] Source artifactStorageSourceUri + * @property {Object.|null} [fileHashes] Source fileHashes + * @property {grafeas.v1.ISourceContext|null} [context] Source context + * @property {Array.|null} [additionalContexts] Source additionalContexts */ /** - * Constructs a new Version. + * Constructs a new Source. * @memberof grafeas.v1 - * @classdesc Represents a Version. - * @implements IVersion + * @classdesc Represents a Source. + * @implements ISource * @constructor - * @param {grafeas.v1.IVersion=} [properties] Properties to set + * @param {grafeas.v1.ISource=} [properties] Properties to set */ - function Version(properties) { + function Source(properties) { + this.fileHashes = {}; + this.additionalContexts = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4403,127 +10934,139 @@ } /** - * Version epoch. - * @member {number} epoch - * @memberof grafeas.v1.Version - * @instance - */ - Version.prototype.epoch = 0; - - /** - * Version name. - * @member {string} name - * @memberof grafeas.v1.Version + * Source artifactStorageSourceUri. + * @member {string} artifactStorageSourceUri + * @memberof grafeas.v1.Source * @instance */ - Version.prototype.name = ""; + Source.prototype.artifactStorageSourceUri = ""; /** - * Version revision. - * @member {string} revision - * @memberof grafeas.v1.Version + * Source fileHashes. + * @member {Object.} fileHashes + * @memberof grafeas.v1.Source * @instance */ - Version.prototype.revision = ""; + Source.prototype.fileHashes = $util.emptyObject; /** - * Version kind. - * @member {grafeas.v1.Version.VersionKind} kind - * @memberof grafeas.v1.Version + * Source context. + * @member {grafeas.v1.ISourceContext|null|undefined} context + * @memberof grafeas.v1.Source * @instance */ - Version.prototype.kind = 0; + Source.prototype.context = null; /** - * Version fullName. - * @member {string} fullName - * @memberof grafeas.v1.Version + * Source additionalContexts. + * @member {Array.} additionalContexts + * @memberof grafeas.v1.Source * @instance */ - Version.prototype.fullName = ""; + Source.prototype.additionalContexts = $util.emptyArray; /** - * Creates a new Version instance using the specified properties. + * Creates a new Source instance using the specified properties. * @function create - * @memberof grafeas.v1.Version + * @memberof grafeas.v1.Source * @static - * @param {grafeas.v1.IVersion=} [properties] Properties to set - * @returns {grafeas.v1.Version} Version instance + * @param {grafeas.v1.ISource=} [properties] Properties to set + * @returns {grafeas.v1.Source} Source instance */ - Version.create = function create(properties) { - return new Version(properties); + Source.create = function create(properties) { + return new Source(properties); }; /** - * Encodes the specified Version message. Does not implicitly {@link grafeas.v1.Version.verify|verify} messages. + * Encodes the specified Source message. Does not implicitly {@link grafeas.v1.Source.verify|verify} messages. * @function encode - * @memberof grafeas.v1.Version + * @memberof grafeas.v1.Source * @static - * @param {grafeas.v1.IVersion} message Version message or plain object to encode + * @param {grafeas.v1.ISource} message Source message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Version.encode = function encode(message, writer) { + Source.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.epoch != null && Object.hasOwnProperty.call(message, "epoch")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.epoch); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); - if (message.revision != null && Object.hasOwnProperty.call(message, "revision")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.revision); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.kind); - if (message.fullName != null && Object.hasOwnProperty.call(message, "fullName")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.fullName); + if (message.artifactStorageSourceUri != null && Object.hasOwnProperty.call(message, "artifactStorageSourceUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.artifactStorageSourceUri); + if (message.fileHashes != null && Object.hasOwnProperty.call(message, "fileHashes")) + for (var keys = Object.keys(message.fileHashes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.grafeas.v1.FileHashes.encode(message.fileHashes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.context != null && Object.hasOwnProperty.call(message, "context")) + $root.grafeas.v1.SourceContext.encode(message.context, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.additionalContexts != null && message.additionalContexts.length) + for (var i = 0; i < message.additionalContexts.length; ++i) + $root.grafeas.v1.SourceContext.encode(message.additionalContexts[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified Version message, length delimited. Does not implicitly {@link grafeas.v1.Version.verify|verify} messages. + * Encodes the specified Source message, length delimited. Does not implicitly {@link grafeas.v1.Source.verify|verify} messages. * @function encodeDelimited - * @memberof grafeas.v1.Version + * @memberof grafeas.v1.Source * @static - * @param {grafeas.v1.IVersion} message Version message or plain object to encode + * @param {grafeas.v1.ISource} message Source message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Version.encodeDelimited = function encodeDelimited(message, writer) { + Source.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Version message from the specified reader or buffer. + * Decodes a Source message from the specified reader or buffer. * @function decode - * @memberof grafeas.v1.Version + * @memberof grafeas.v1.Source * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {grafeas.v1.Version} Version + * @returns {grafeas.v1.Source} Source * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Version.decode = function decode(reader, length) { + Source.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.Version(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.Source(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.epoch = reader.int32(); + message.artifactStorageSourceUri = reader.string(); break; case 2: - message.name = reader.string(); + if (message.fileHashes === $util.emptyObject) + message.fileHashes = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.grafeas.v1.FileHashes.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fileHashes[key] = value; break; case 3: - message.revision = reader.string(); + message.context = $root.grafeas.v1.SourceContext.decode(reader, reader.uint32()); break; case 4: - message.kind = reader.int32(); - break; - case 5: - message.fullName = reader.string(); + if (!(message.additionalContexts && message.additionalContexts.length)) + message.additionalContexts = []; + message.additionalContexts.push($root.grafeas.v1.SourceContext.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -4534,181 +11077,176 @@ }; /** - * Decodes a Version message from the specified reader or buffer, length delimited. + * Decodes a Source message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof grafeas.v1.Version + * @memberof grafeas.v1.Source * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {grafeas.v1.Version} Version + * @returns {grafeas.v1.Source} Source * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Version.decodeDelimited = function decodeDelimited(reader) { + Source.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Version message. + * Verifies a Source message. * @function verify - * @memberof grafeas.v1.Version + * @memberof grafeas.v1.Source * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Version.verify = function verify(message) { + Source.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.epoch != null && message.hasOwnProperty("epoch")) - if (!$util.isInteger(message.epoch)) - return "epoch: integer expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.revision != null && message.hasOwnProperty("revision")) - if (!$util.isString(message.revision)) - return "revision: string expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - switch (message.kind) { - default: - return "kind: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; + if (message.artifactStorageSourceUri != null && message.hasOwnProperty("artifactStorageSourceUri")) + if (!$util.isString(message.artifactStorageSourceUri)) + return "artifactStorageSourceUri: string expected"; + if (message.fileHashes != null && message.hasOwnProperty("fileHashes")) { + if (!$util.isObject(message.fileHashes)) + return "fileHashes: object expected"; + var key = Object.keys(message.fileHashes); + for (var i = 0; i < key.length; ++i) { + var error = $root.grafeas.v1.FileHashes.verify(message.fileHashes[key[i]]); + if (error) + return "fileHashes." + error; } - if (message.fullName != null && message.hasOwnProperty("fullName")) - if (!$util.isString(message.fullName)) - return "fullName: string expected"; + } + if (message.context != null && message.hasOwnProperty("context")) { + var error = $root.grafeas.v1.SourceContext.verify(message.context); + if (error) + return "context." + error; + } + if (message.additionalContexts != null && message.hasOwnProperty("additionalContexts")) { + if (!Array.isArray(message.additionalContexts)) + return "additionalContexts: array expected"; + for (var i = 0; i < message.additionalContexts.length; ++i) { + var error = $root.grafeas.v1.SourceContext.verify(message.additionalContexts[i]); + if (error) + return "additionalContexts." + error; + } + } return null; }; /** - * Creates a Version message from a plain object. Also converts values to their respective internal types. + * Creates a Source message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof grafeas.v1.Version + * @memberof grafeas.v1.Source * @static * @param {Object.} object Plain object - * @returns {grafeas.v1.Version} Version + * @returns {grafeas.v1.Source} Source */ - Version.fromObject = function fromObject(object) { - if (object instanceof $root.grafeas.v1.Version) + Source.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.Source) return object; - var message = new $root.grafeas.v1.Version(); - if (object.epoch != null) - message.epoch = object.epoch | 0; - if (object.name != null) - message.name = String(object.name); - if (object.revision != null) - message.revision = String(object.revision); - switch (object.kind) { - case "VERSION_KIND_UNSPECIFIED": - case 0: - message.kind = 0; - break; - case "NORMAL": - case 1: - message.kind = 1; - break; - case "MINIMUM": - case 2: - message.kind = 2; - break; - case "MAXIMUM": - case 3: - message.kind = 3; - break; + var message = new $root.grafeas.v1.Source(); + if (object.artifactStorageSourceUri != null) + message.artifactStorageSourceUri = String(object.artifactStorageSourceUri); + if (object.fileHashes) { + if (typeof object.fileHashes !== "object") + throw TypeError(".grafeas.v1.Source.fileHashes: object expected"); + message.fileHashes = {}; + for (var keys = Object.keys(object.fileHashes), i = 0; i < keys.length; ++i) { + if (typeof object.fileHashes[keys[i]] !== "object") + throw TypeError(".grafeas.v1.Source.fileHashes: object expected"); + message.fileHashes[keys[i]] = $root.grafeas.v1.FileHashes.fromObject(object.fileHashes[keys[i]]); + } + } + if (object.context != null) { + if (typeof object.context !== "object") + throw TypeError(".grafeas.v1.Source.context: object expected"); + message.context = $root.grafeas.v1.SourceContext.fromObject(object.context); + } + if (object.additionalContexts) { + if (!Array.isArray(object.additionalContexts)) + throw TypeError(".grafeas.v1.Source.additionalContexts: array expected"); + message.additionalContexts = []; + for (var i = 0; i < object.additionalContexts.length; ++i) { + if (typeof object.additionalContexts[i] !== "object") + throw TypeError(".grafeas.v1.Source.additionalContexts: object expected"); + message.additionalContexts[i] = $root.grafeas.v1.SourceContext.fromObject(object.additionalContexts[i]); + } } - if (object.fullName != null) - message.fullName = String(object.fullName); return message; }; /** - * Creates a plain object from a Version message. Also converts values to other types if specified. + * Creates a plain object from a Source message. Also converts values to other types if specified. * @function toObject - * @memberof grafeas.v1.Version + * @memberof grafeas.v1.Source * @static - * @param {grafeas.v1.Version} message Version + * @param {grafeas.v1.Source} message Source * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Version.toObject = function toObject(message, options) { + Source.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.additionalContexts = []; + if (options.objects || options.defaults) + object.fileHashes = {}; if (options.defaults) { - object.epoch = 0; - object.name = ""; - object.revision = ""; - object.kind = options.enums === String ? "VERSION_KIND_UNSPECIFIED" : 0; - object.fullName = ""; + object.artifactStorageSourceUri = ""; + object.context = null; + } + if (message.artifactStorageSourceUri != null && message.hasOwnProperty("artifactStorageSourceUri")) + object.artifactStorageSourceUri = message.artifactStorageSourceUri; + var keys2; + if (message.fileHashes && (keys2 = Object.keys(message.fileHashes)).length) { + object.fileHashes = {}; + for (var j = 0; j < keys2.length; ++j) + object.fileHashes[keys2[j]] = $root.grafeas.v1.FileHashes.toObject(message.fileHashes[keys2[j]], options); + } + if (message.context != null && message.hasOwnProperty("context")) + object.context = $root.grafeas.v1.SourceContext.toObject(message.context, options); + if (message.additionalContexts && message.additionalContexts.length) { + object.additionalContexts = []; + for (var j = 0; j < message.additionalContexts.length; ++j) + object.additionalContexts[j] = $root.grafeas.v1.SourceContext.toObject(message.additionalContexts[j], options); } - if (message.epoch != null && message.hasOwnProperty("epoch")) - object.epoch = message.epoch; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.revision != null && message.hasOwnProperty("revision")) - object.revision = message.revision; - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = options.enums === String ? $root.grafeas.v1.Version.VersionKind[message.kind] : message.kind; - if (message.fullName != null && message.hasOwnProperty("fullName")) - object.fullName = message.fullName; return object; }; /** - * Converts this Version to JSON. + * Converts this Source to JSON. * @function toJSON - * @memberof grafeas.v1.Version + * @memberof grafeas.v1.Source * @instance * @returns {Object.} JSON object */ - Version.prototype.toJSON = function toJSON() { + Source.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * VersionKind enum. - * @name grafeas.v1.Version.VersionKind - * @enum {number} - * @property {number} VERSION_KIND_UNSPECIFIED=0 VERSION_KIND_UNSPECIFIED value - * @property {number} NORMAL=1 NORMAL value - * @property {number} MINIMUM=2 MINIMUM value - * @property {number} MAXIMUM=3 MAXIMUM value - */ - Version.VersionKind = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "VERSION_KIND_UNSPECIFIED"] = 0; - values[valuesById[1] = "NORMAL"] = 1; - values[valuesById[2] = "MINIMUM"] = 2; - values[valuesById[3] = "MAXIMUM"] = 3; - return values; - })(); - - return Version; + return Source; })(); - v1.AttestationNote = (function() { + v1.FileHashes = (function() { /** - * Properties of an AttestationNote. + * Properties of a FileHashes. * @memberof grafeas.v1 - * @interface IAttestationNote - * @property {grafeas.v1.AttestationNote.IHint|null} [hint] AttestationNote hint + * @interface IFileHashes + * @property {Array.|null} [fileHash] FileHashes fileHash */ /** - * Constructs a new AttestationNote. + * Constructs a new FileHashes. * @memberof grafeas.v1 - * @classdesc Represents an AttestationNote. - * @implements IAttestationNote + * @classdesc Represents a FileHashes. + * @implements IFileHashes * @constructor - * @param {grafeas.v1.IAttestationNote=} [properties] Properties to set + * @param {grafeas.v1.IFileHashes=} [properties] Properties to set */ - function AttestationNote(properties) { + function FileHashes(properties) { + this.fileHash = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4716,380 +11254,207 @@ } /** - * AttestationNote hint. - * @member {grafeas.v1.AttestationNote.IHint|null|undefined} hint - * @memberof grafeas.v1.AttestationNote + * FileHashes fileHash. + * @member {Array.} fileHash + * @memberof grafeas.v1.FileHashes * @instance */ - AttestationNote.prototype.hint = null; + FileHashes.prototype.fileHash = $util.emptyArray; /** - * Creates a new AttestationNote instance using the specified properties. + * Creates a new FileHashes instance using the specified properties. * @function create - * @memberof grafeas.v1.AttestationNote + * @memberof grafeas.v1.FileHashes * @static - * @param {grafeas.v1.IAttestationNote=} [properties] Properties to set - * @returns {grafeas.v1.AttestationNote} AttestationNote instance + * @param {grafeas.v1.IFileHashes=} [properties] Properties to set + * @returns {grafeas.v1.FileHashes} FileHashes instance */ - AttestationNote.create = function create(properties) { - return new AttestationNote(properties); + FileHashes.create = function create(properties) { + return new FileHashes(properties); }; /** - * Encodes the specified AttestationNote message. Does not implicitly {@link grafeas.v1.AttestationNote.verify|verify} messages. + * Encodes the specified FileHashes message. Does not implicitly {@link grafeas.v1.FileHashes.verify|verify} messages. * @function encode - * @memberof grafeas.v1.AttestationNote + * @memberof grafeas.v1.FileHashes * @static - * @param {grafeas.v1.IAttestationNote} message AttestationNote message or plain object to encode + * @param {grafeas.v1.IFileHashes} message FileHashes message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AttestationNote.encode = function encode(message, writer) { + FileHashes.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.hint != null && Object.hasOwnProperty.call(message, "hint")) - $root.grafeas.v1.AttestationNote.Hint.encode(message.hint, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.fileHash != null && message.fileHash.length) + for (var i = 0; i < message.fileHash.length; ++i) + $root.grafeas.v1.Hash.encode(message.fileHash[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified AttestationNote message, length delimited. Does not implicitly {@link grafeas.v1.AttestationNote.verify|verify} messages. + * Encodes the specified FileHashes message, length delimited. Does not implicitly {@link grafeas.v1.FileHashes.verify|verify} messages. * @function encodeDelimited - * @memberof grafeas.v1.AttestationNote + * @memberof grafeas.v1.FileHashes * @static - * @param {grafeas.v1.IAttestationNote} message AttestationNote message or plain object to encode + * @param {grafeas.v1.IFileHashes} message FileHashes message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AttestationNote.encodeDelimited = function encodeDelimited(message, writer) { + FileHashes.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AttestationNote message from the specified reader or buffer. + * Decodes a FileHashes message from the specified reader or buffer. * @function decode - * @memberof grafeas.v1.AttestationNote + * @memberof grafeas.v1.FileHashes * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {grafeas.v1.AttestationNote} AttestationNote + * @returns {grafeas.v1.FileHashes} FileHashes * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AttestationNote.decode = function decode(reader, length) { + FileHashes.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.AttestationNote(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.FileHashes(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.hint = $root.grafeas.v1.AttestationNote.Hint.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AttestationNote message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof grafeas.v1.AttestationNote - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {grafeas.v1.AttestationNote} AttestationNote - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttestationNote.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AttestationNote message. - * @function verify - * @memberof grafeas.v1.AttestationNote - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AttestationNote.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.hint != null && message.hasOwnProperty("hint")) { - var error = $root.grafeas.v1.AttestationNote.Hint.verify(message.hint); - if (error) - return "hint." + error; - } - return null; - }; - - /** - * Creates an AttestationNote message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof grafeas.v1.AttestationNote - * @static - * @param {Object.} object Plain object - * @returns {grafeas.v1.AttestationNote} AttestationNote - */ - AttestationNote.fromObject = function fromObject(object) { - if (object instanceof $root.grafeas.v1.AttestationNote) - return object; - var message = new $root.grafeas.v1.AttestationNote(); - if (object.hint != null) { - if (typeof object.hint !== "object") - throw TypeError(".grafeas.v1.AttestationNote.hint: object expected"); - message.hint = $root.grafeas.v1.AttestationNote.Hint.fromObject(object.hint); - } - return message; - }; - - /** - * Creates a plain object from an AttestationNote message. Also converts values to other types if specified. - * @function toObject - * @memberof grafeas.v1.AttestationNote - * @static - * @param {grafeas.v1.AttestationNote} message AttestationNote - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AttestationNote.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.hint = null; - if (message.hint != null && message.hasOwnProperty("hint")) - object.hint = $root.grafeas.v1.AttestationNote.Hint.toObject(message.hint, options); - return object; - }; - - /** - * Converts this AttestationNote to JSON. - * @function toJSON - * @memberof grafeas.v1.AttestationNote - * @instance - * @returns {Object.} JSON object - */ - AttestationNote.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - AttestationNote.Hint = (function() { - - /** - * Properties of a Hint. - * @memberof grafeas.v1.AttestationNote - * @interface IHint - * @property {string|null} [humanReadableName] Hint humanReadableName - */ - - /** - * Constructs a new Hint. - * @memberof grafeas.v1.AttestationNote - * @classdesc Represents a Hint. - * @implements IHint - * @constructor - * @param {grafeas.v1.AttestationNote.IHint=} [properties] Properties to set - */ - function Hint(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Hint humanReadableName. - * @member {string} humanReadableName - * @memberof grafeas.v1.AttestationNote.Hint - * @instance - */ - Hint.prototype.humanReadableName = ""; - - /** - * Creates a new Hint instance using the specified properties. - * @function create - * @memberof grafeas.v1.AttestationNote.Hint - * @static - * @param {grafeas.v1.AttestationNote.IHint=} [properties] Properties to set - * @returns {grafeas.v1.AttestationNote.Hint} Hint instance - */ - Hint.create = function create(properties) { - return new Hint(properties); - }; - - /** - * Encodes the specified Hint message. Does not implicitly {@link grafeas.v1.AttestationNote.Hint.verify|verify} messages. - * @function encode - * @memberof grafeas.v1.AttestationNote.Hint - * @static - * @param {grafeas.v1.AttestationNote.IHint} message Hint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Hint.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.humanReadableName != null && Object.hasOwnProperty.call(message, "humanReadableName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.humanReadableName); - return writer; - }; - - /** - * Encodes the specified Hint message, length delimited. Does not implicitly {@link grafeas.v1.AttestationNote.Hint.verify|verify} messages. - * @function encodeDelimited - * @memberof grafeas.v1.AttestationNote.Hint - * @static - * @param {grafeas.v1.AttestationNote.IHint} message Hint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Hint.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Hint message from the specified reader or buffer. - * @function decode - * @memberof grafeas.v1.AttestationNote.Hint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {grafeas.v1.AttestationNote.Hint} Hint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Hint.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.AttestationNote.Hint(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.humanReadableName = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } + if (!(message.fileHash && message.fileHash.length)) + message.fileHash = []; + message.fileHash.push($root.grafeas.v1.Hash.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; } - return message; - }; - - /** - * Decodes a Hint message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof grafeas.v1.AttestationNote.Hint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {grafeas.v1.AttestationNote.Hint} Hint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Hint.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + } + return message; + }; - /** - * Verifies a Hint message. - * @function verify - * @memberof grafeas.v1.AttestationNote.Hint - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Hint.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.humanReadableName != null && message.hasOwnProperty("humanReadableName")) - if (!$util.isString(message.humanReadableName)) - return "humanReadableName: string expected"; - return null; - }; + /** + * Decodes a FileHashes message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof grafeas.v1.FileHashes + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {grafeas.v1.FileHashes} FileHashes + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileHashes.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a Hint message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof grafeas.v1.AttestationNote.Hint - * @static - * @param {Object.} object Plain object - * @returns {grafeas.v1.AttestationNote.Hint} Hint - */ - Hint.fromObject = function fromObject(object) { - if (object instanceof $root.grafeas.v1.AttestationNote.Hint) - return object; - var message = new $root.grafeas.v1.AttestationNote.Hint(); - if (object.humanReadableName != null) - message.humanReadableName = String(object.humanReadableName); - return message; - }; + /** + * Verifies a FileHashes message. + * @function verify + * @memberof grafeas.v1.FileHashes + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileHashes.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fileHash != null && message.hasOwnProperty("fileHash")) { + if (!Array.isArray(message.fileHash)) + return "fileHash: array expected"; + for (var i = 0; i < message.fileHash.length; ++i) { + var error = $root.grafeas.v1.Hash.verify(message.fileHash[i]); + if (error) + return "fileHash." + error; + } + } + return null; + }; - /** - * Creates a plain object from a Hint message. Also converts values to other types if specified. - * @function toObject - * @memberof grafeas.v1.AttestationNote.Hint - * @static - * @param {grafeas.v1.AttestationNote.Hint} message Hint - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Hint.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.humanReadableName = ""; - if (message.humanReadableName != null && message.hasOwnProperty("humanReadableName")) - object.humanReadableName = message.humanReadableName; + /** + * Creates a FileHashes message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof grafeas.v1.FileHashes + * @static + * @param {Object.} object Plain object + * @returns {grafeas.v1.FileHashes} FileHashes + */ + FileHashes.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.FileHashes) return object; - }; + var message = new $root.grafeas.v1.FileHashes(); + if (object.fileHash) { + if (!Array.isArray(object.fileHash)) + throw TypeError(".grafeas.v1.FileHashes.fileHash: array expected"); + message.fileHash = []; + for (var i = 0; i < object.fileHash.length; ++i) { + if (typeof object.fileHash[i] !== "object") + throw TypeError(".grafeas.v1.FileHashes.fileHash: object expected"); + message.fileHash[i] = $root.grafeas.v1.Hash.fromObject(object.fileHash[i]); + } + } + return message; + }; - /** - * Converts this Hint to JSON. - * @function toJSON - * @memberof grafeas.v1.AttestationNote.Hint - * @instance - * @returns {Object.} JSON object - */ - Hint.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a FileHashes message. Also converts values to other types if specified. + * @function toObject + * @memberof grafeas.v1.FileHashes + * @static + * @param {grafeas.v1.FileHashes} message FileHashes + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileHashes.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.fileHash = []; + if (message.fileHash && message.fileHash.length) { + object.fileHash = []; + for (var j = 0; j < message.fileHash.length; ++j) + object.fileHash[j] = $root.grafeas.v1.Hash.toObject(message.fileHash[j], options); + } + return object; + }; - return Hint; - })(); + /** + * Converts this FileHashes to JSON. + * @function toJSON + * @memberof grafeas.v1.FileHashes + * @instance + * @returns {Object.} JSON object + */ + FileHashes.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return AttestationNote; + return FileHashes; })(); - v1.AttestationOccurrence = (function() { + v1.Hash = (function() { /** - * Properties of an AttestationOccurrence. + * Properties of a Hash. * @memberof grafeas.v1 - * @interface IAttestationOccurrence - * @property {Uint8Array|null} [serializedPayload] AttestationOccurrence serializedPayload - * @property {Array.|null} [signatures] AttestationOccurrence signatures + * @interface IHash + * @property {string|null} [type] Hash type + * @property {Uint8Array|null} [value] Hash value */ /** - * Constructs a new AttestationOccurrence. + * Constructs a new Hash. * @memberof grafeas.v1 - * @classdesc Represents an AttestationOccurrence. - * @implements IAttestationOccurrence + * @classdesc Represents a Hash. + * @implements IHash * @constructor - * @param {grafeas.v1.IAttestationOccurrence=} [properties] Properties to set + * @param {grafeas.v1.IHash=} [properties] Properties to set */ - function AttestationOccurrence(properties) { - this.signatures = []; + function Hash(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5097,91 +11462,88 @@ } /** - * AttestationOccurrence serializedPayload. - * @member {Uint8Array} serializedPayload - * @memberof grafeas.v1.AttestationOccurrence + * Hash type. + * @member {string} type + * @memberof grafeas.v1.Hash * @instance */ - AttestationOccurrence.prototype.serializedPayload = $util.newBuffer([]); + Hash.prototype.type = ""; /** - * AttestationOccurrence signatures. - * @member {Array.} signatures - * @memberof grafeas.v1.AttestationOccurrence + * Hash value. + * @member {Uint8Array} value + * @memberof grafeas.v1.Hash * @instance */ - AttestationOccurrence.prototype.signatures = $util.emptyArray; + Hash.prototype.value = $util.newBuffer([]); /** - * Creates a new AttestationOccurrence instance using the specified properties. + * Creates a new Hash instance using the specified properties. * @function create - * @memberof grafeas.v1.AttestationOccurrence + * @memberof grafeas.v1.Hash * @static - * @param {grafeas.v1.IAttestationOccurrence=} [properties] Properties to set - * @returns {grafeas.v1.AttestationOccurrence} AttestationOccurrence instance + * @param {grafeas.v1.IHash=} [properties] Properties to set + * @returns {grafeas.v1.Hash} Hash instance */ - AttestationOccurrence.create = function create(properties) { - return new AttestationOccurrence(properties); + Hash.create = function create(properties) { + return new Hash(properties); }; /** - * Encodes the specified AttestationOccurrence message. Does not implicitly {@link grafeas.v1.AttestationOccurrence.verify|verify} messages. + * Encodes the specified Hash message. Does not implicitly {@link grafeas.v1.Hash.verify|verify} messages. * @function encode - * @memberof grafeas.v1.AttestationOccurrence + * @memberof grafeas.v1.Hash * @static - * @param {grafeas.v1.IAttestationOccurrence} message AttestationOccurrence message or plain object to encode + * @param {grafeas.v1.IHash} message Hash message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AttestationOccurrence.encode = function encode(message, writer) { + Hash.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.serializedPayload != null && Object.hasOwnProperty.call(message, "serializedPayload")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.serializedPayload); - if (message.signatures != null && message.signatures.length) - for (var i = 0; i < message.signatures.length; ++i) - $root.grafeas.v1.Signature.encode(message.signatures[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); return writer; }; /** - * Encodes the specified AttestationOccurrence message, length delimited. Does not implicitly {@link grafeas.v1.AttestationOccurrence.verify|verify} messages. + * Encodes the specified Hash message, length delimited. Does not implicitly {@link grafeas.v1.Hash.verify|verify} messages. * @function encodeDelimited - * @memberof grafeas.v1.AttestationOccurrence + * @memberof grafeas.v1.Hash * @static - * @param {grafeas.v1.IAttestationOccurrence} message AttestationOccurrence message or plain object to encode + * @param {grafeas.v1.IHash} message Hash message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AttestationOccurrence.encodeDelimited = function encodeDelimited(message, writer) { + Hash.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AttestationOccurrence message from the specified reader or buffer. + * Decodes a Hash message from the specified reader or buffer. * @function decode - * @memberof grafeas.v1.AttestationOccurrence + * @memberof grafeas.v1.Hash * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {grafeas.v1.AttestationOccurrence} AttestationOccurrence + * @returns {grafeas.v1.Hash} Hash * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AttestationOccurrence.decode = function decode(reader, length) { + Hash.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.AttestationOccurrence(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.Hash(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.serializedPayload = reader.bytes(); + message.type = reader.string(); break; case 2: - if (!(message.signatures && message.signatures.length)) - message.signatures = []; - message.signatures.push($root.grafeas.v1.Signature.decode(reader, reader.uint32())); + message.value = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -5192,142 +11554,133 @@ }; /** - * Decodes an AttestationOccurrence message from the specified reader or buffer, length delimited. + * Decodes a Hash message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof grafeas.v1.AttestationOccurrence + * @memberof grafeas.v1.Hash * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {grafeas.v1.AttestationOccurrence} AttestationOccurrence + * @returns {grafeas.v1.Hash} Hash * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AttestationOccurrence.decodeDelimited = function decodeDelimited(reader) { + Hash.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AttestationOccurrence message. + * Verifies a Hash message. * @function verify - * @memberof grafeas.v1.AttestationOccurrence + * @memberof grafeas.v1.Hash * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AttestationOccurrence.verify = function verify(message) { + Hash.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.serializedPayload != null && message.hasOwnProperty("serializedPayload")) - if (!(message.serializedPayload && typeof message.serializedPayload.length === "number" || $util.isString(message.serializedPayload))) - return "serializedPayload: buffer expected"; - if (message.signatures != null && message.hasOwnProperty("signatures")) { - if (!Array.isArray(message.signatures)) - return "signatures: array expected"; - for (var i = 0; i < message.signatures.length; ++i) { - var error = $root.grafeas.v1.Signature.verify(message.signatures[i]); - if (error) - return "signatures." + error; - } - } + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; return null; }; /** - * Creates an AttestationOccurrence message from a plain object. Also converts values to their respective internal types. + * Creates a Hash message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof grafeas.v1.AttestationOccurrence + * @memberof grafeas.v1.Hash * @static * @param {Object.} object Plain object - * @returns {grafeas.v1.AttestationOccurrence} AttestationOccurrence + * @returns {grafeas.v1.Hash} Hash */ - AttestationOccurrence.fromObject = function fromObject(object) { - if (object instanceof $root.grafeas.v1.AttestationOccurrence) + Hash.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.Hash) return object; - var message = new $root.grafeas.v1.AttestationOccurrence(); - if (object.serializedPayload != null) - if (typeof object.serializedPayload === "string") - $util.base64.decode(object.serializedPayload, message.serializedPayload = $util.newBuffer($util.base64.length(object.serializedPayload)), 0); - else if (object.serializedPayload.length) - message.serializedPayload = object.serializedPayload; - if (object.signatures) { - if (!Array.isArray(object.signatures)) - throw TypeError(".grafeas.v1.AttestationOccurrence.signatures: array expected"); - message.signatures = []; - for (var i = 0; i < object.signatures.length; ++i) { - if (typeof object.signatures[i] !== "object") - throw TypeError(".grafeas.v1.AttestationOccurrence.signatures: object expected"); - message.signatures[i] = $root.grafeas.v1.Signature.fromObject(object.signatures[i]); - } - } + var message = new $root.grafeas.v1.Hash(); + if (object.type != null) + message.type = String(object.type); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length) + message.value = object.value; return message; }; /** - * Creates a plain object from an AttestationOccurrence message. Also converts values to other types if specified. + * Creates a plain object from a Hash message. Also converts values to other types if specified. * @function toObject - * @memberof grafeas.v1.AttestationOccurrence + * @memberof grafeas.v1.Hash * @static - * @param {grafeas.v1.AttestationOccurrence} message AttestationOccurrence + * @param {grafeas.v1.Hash} message Hash * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - AttestationOccurrence.toObject = function toObject(message, options) { + Hash.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.signatures = []; - if (options.defaults) + if (options.defaults) { + object.type = ""; if (options.bytes === String) - object.serializedPayload = ""; + object.value = ""; else { - object.serializedPayload = []; + object.value = []; if (options.bytes !== Array) - object.serializedPayload = $util.newBuffer(object.serializedPayload); + object.value = $util.newBuffer(object.value); } - if (message.serializedPayload != null && message.hasOwnProperty("serializedPayload")) - object.serializedPayload = options.bytes === String ? $util.base64.encode(message.serializedPayload, 0, message.serializedPayload.length) : options.bytes === Array ? Array.prototype.slice.call(message.serializedPayload) : message.serializedPayload; - if (message.signatures && message.signatures.length) { - object.signatures = []; - for (var j = 0; j < message.signatures.length; ++j) - object.signatures[j] = $root.grafeas.v1.Signature.toObject(message.signatures[j], options); } + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; return object; }; /** - * Converts this AttestationOccurrence to JSON. + * Converts this Hash to JSON. * @function toJSON - * @memberof grafeas.v1.AttestationOccurrence + * @memberof grafeas.v1.Hash * @instance * @returns {Object.} JSON object */ - AttestationOccurrence.prototype.toJSON = function toJSON() { + Hash.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return AttestationOccurrence; + return Hash; })(); - v1.BuildNote = (function() { + v1.Command = (function() { /** - * Properties of a BuildNote. + * Properties of a Command. * @memberof grafeas.v1 - * @interface IBuildNote - * @property {string|null} [builderVersion] BuildNote builderVersion + * @interface ICommand + * @property {string|null} [name] Command name + * @property {Array.|null} [env] Command env + * @property {Array.|null} [args] Command args + * @property {string|null} [dir] Command dir + * @property {string|null} [id] Command id + * @property {Array.|null} [waitFor] Command waitFor */ /** - * Constructs a new BuildNote. + * Constructs a new Command. * @memberof grafeas.v1 - * @classdesc Represents a BuildNote. - * @implements IBuildNote + * @classdesc Represents a Command. + * @implements ICommand * @constructor - * @param {grafeas.v1.IBuildNote=} [properties] Properties to set + * @param {grafeas.v1.ICommand=} [properties] Properties to set */ - function BuildNote(properties) { + function Command(properties) { + this.env = []; + this.args = []; + this.waitFor = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5335,75 +11688,149 @@ } /** - * BuildNote builderVersion. - * @member {string} builderVersion - * @memberof grafeas.v1.BuildNote + * Command name. + * @member {string} name + * @memberof grafeas.v1.Command * @instance */ - BuildNote.prototype.builderVersion = ""; + Command.prototype.name = ""; /** - * Creates a new BuildNote instance using the specified properties. + * Command env. + * @member {Array.} env + * @memberof grafeas.v1.Command + * @instance + */ + Command.prototype.env = $util.emptyArray; + + /** + * Command args. + * @member {Array.} args + * @memberof grafeas.v1.Command + * @instance + */ + Command.prototype.args = $util.emptyArray; + + /** + * Command dir. + * @member {string} dir + * @memberof grafeas.v1.Command + * @instance + */ + Command.prototype.dir = ""; + + /** + * Command id. + * @member {string} id + * @memberof grafeas.v1.Command + * @instance + */ + Command.prototype.id = ""; + + /** + * Command waitFor. + * @member {Array.} waitFor + * @memberof grafeas.v1.Command + * @instance + */ + Command.prototype.waitFor = $util.emptyArray; + + /** + * Creates a new Command instance using the specified properties. * @function create - * @memberof grafeas.v1.BuildNote + * @memberof grafeas.v1.Command * @static - * @param {grafeas.v1.IBuildNote=} [properties] Properties to set - * @returns {grafeas.v1.BuildNote} BuildNote instance + * @param {grafeas.v1.ICommand=} [properties] Properties to set + * @returns {grafeas.v1.Command} Command instance */ - BuildNote.create = function create(properties) { - return new BuildNote(properties); + Command.create = function create(properties) { + return new Command(properties); }; /** - * Encodes the specified BuildNote message. Does not implicitly {@link grafeas.v1.BuildNote.verify|verify} messages. + * Encodes the specified Command message. Does not implicitly {@link grafeas.v1.Command.verify|verify} messages. * @function encode - * @memberof grafeas.v1.BuildNote + * @memberof grafeas.v1.Command * @static - * @param {grafeas.v1.IBuildNote} message BuildNote message or plain object to encode + * @param {grafeas.v1.ICommand} message Command message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BuildNote.encode = function encode(message, writer) { + Command.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.builderVersion != null && Object.hasOwnProperty.call(message, "builderVersion")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.builderVersion); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.env != null && message.env.length) + for (var i = 0; i < message.env.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.env[i]); + if (message.args != null && message.args.length) + for (var i = 0; i < message.args.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.args[i]); + if (message.dir != null && Object.hasOwnProperty.call(message, "dir")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.dir); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.id); + if (message.waitFor != null && message.waitFor.length) + for (var i = 0; i < message.waitFor.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.waitFor[i]); return writer; }; /** - * Encodes the specified BuildNote message, length delimited. Does not implicitly {@link grafeas.v1.BuildNote.verify|verify} messages. + * Encodes the specified Command message, length delimited. Does not implicitly {@link grafeas.v1.Command.verify|verify} messages. * @function encodeDelimited - * @memberof grafeas.v1.BuildNote + * @memberof grafeas.v1.Command * @static - * @param {grafeas.v1.IBuildNote} message BuildNote message or plain object to encode + * @param {grafeas.v1.ICommand} message Command message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BuildNote.encodeDelimited = function encodeDelimited(message, writer) { + Command.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BuildNote message from the specified reader or buffer. + * Decodes a Command message from the specified reader or buffer. * @function decode - * @memberof grafeas.v1.BuildNote + * @memberof grafeas.v1.Command * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {grafeas.v1.BuildNote} BuildNote + * @returns {grafeas.v1.Command} Command * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BuildNote.decode = function decode(reader, length) { + Command.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.BuildNote(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.Command(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.builderVersion = reader.string(); + message.name = reader.string(); + break; + case 2: + if (!(message.env && message.env.length)) + message.env = []; + message.env.push(reader.string()); + break; + case 3: + if (!(message.args && message.args.length)) + message.args = []; + message.args.push(reader.string()); + break; + case 4: + message.dir = reader.string(); + break; + case 5: + message.id = reader.string(); + break; + case 6: + if (!(message.waitFor && message.waitFor.length)) + message.waitFor = []; + message.waitFor.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -5414,108 +11841,189 @@ }; /** - * Decodes a BuildNote message from the specified reader or buffer, length delimited. + * Decodes a Command message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof grafeas.v1.BuildNote + * @memberof grafeas.v1.Command * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {grafeas.v1.BuildNote} BuildNote + * @returns {grafeas.v1.Command} Command * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BuildNote.decodeDelimited = function decodeDelimited(reader) { + Command.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BuildNote message. + * Verifies a Command message. * @function verify - * @memberof grafeas.v1.BuildNote + * @memberof grafeas.v1.Command * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BuildNote.verify = function verify(message) { + Command.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.builderVersion != null && message.hasOwnProperty("builderVersion")) - if (!$util.isString(message.builderVersion)) - return "builderVersion: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.env != null && message.hasOwnProperty("env")) { + if (!Array.isArray(message.env)) + return "env: array expected"; + for (var i = 0; i < message.env.length; ++i) + if (!$util.isString(message.env[i])) + return "env: string[] expected"; + } + if (message.args != null && message.hasOwnProperty("args")) { + if (!Array.isArray(message.args)) + return "args: array expected"; + for (var i = 0; i < message.args.length; ++i) + if (!$util.isString(message.args[i])) + return "args: string[] expected"; + } + if (message.dir != null && message.hasOwnProperty("dir")) + if (!$util.isString(message.dir)) + return "dir: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.waitFor != null && message.hasOwnProperty("waitFor")) { + if (!Array.isArray(message.waitFor)) + return "waitFor: array expected"; + for (var i = 0; i < message.waitFor.length; ++i) + if (!$util.isString(message.waitFor[i])) + return "waitFor: string[] expected"; + } return null; }; /** - * Creates a BuildNote message from a plain object. Also converts values to their respective internal types. + * Creates a Command message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof grafeas.v1.BuildNote + * @memberof grafeas.v1.Command * @static * @param {Object.} object Plain object - * @returns {grafeas.v1.BuildNote} BuildNote + * @returns {grafeas.v1.Command} Command */ - BuildNote.fromObject = function fromObject(object) { - if (object instanceof $root.grafeas.v1.BuildNote) + Command.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.Command) return object; - var message = new $root.grafeas.v1.BuildNote(); - if (object.builderVersion != null) - message.builderVersion = String(object.builderVersion); + var message = new $root.grafeas.v1.Command(); + if (object.name != null) + message.name = String(object.name); + if (object.env) { + if (!Array.isArray(object.env)) + throw TypeError(".grafeas.v1.Command.env: array expected"); + message.env = []; + for (var i = 0; i < object.env.length; ++i) + message.env[i] = String(object.env[i]); + } + if (object.args) { + if (!Array.isArray(object.args)) + throw TypeError(".grafeas.v1.Command.args: array expected"); + message.args = []; + for (var i = 0; i < object.args.length; ++i) + message.args[i] = String(object.args[i]); + } + if (object.dir != null) + message.dir = String(object.dir); + if (object.id != null) + message.id = String(object.id); + if (object.waitFor) { + if (!Array.isArray(object.waitFor)) + throw TypeError(".grafeas.v1.Command.waitFor: array expected"); + message.waitFor = []; + for (var i = 0; i < object.waitFor.length; ++i) + message.waitFor[i] = String(object.waitFor[i]); + } return message; }; /** - * Creates a plain object from a BuildNote message. Also converts values to other types if specified. + * Creates a plain object from a Command message. Also converts values to other types if specified. * @function toObject - * @memberof grafeas.v1.BuildNote + * @memberof grafeas.v1.Command * @static - * @param {grafeas.v1.BuildNote} message BuildNote + * @param {grafeas.v1.Command} message Command * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BuildNote.toObject = function toObject(message, options) { + Command.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.builderVersion = ""; - if (message.builderVersion != null && message.hasOwnProperty("builderVersion")) - object.builderVersion = message.builderVersion; + if (options.arrays || options.defaults) { + object.env = []; + object.args = []; + object.waitFor = []; + } + if (options.defaults) { + object.name = ""; + object.dir = ""; + object.id = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.env && message.env.length) { + object.env = []; + for (var j = 0; j < message.env.length; ++j) + object.env[j] = message.env[j]; + } + if (message.args && message.args.length) { + object.args = []; + for (var j = 0; j < message.args.length; ++j) + object.args[j] = message.args[j]; + } + if (message.dir != null && message.hasOwnProperty("dir")) + object.dir = message.dir; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.waitFor && message.waitFor.length) { + object.waitFor = []; + for (var j = 0; j < message.waitFor.length; ++j) + object.waitFor[j] = message.waitFor[j]; + } return object; }; /** - * Converts this BuildNote to JSON. + * Converts this Command to JSON. * @function toJSON - * @memberof grafeas.v1.BuildNote + * @memberof grafeas.v1.Command * @instance * @returns {Object.} JSON object */ - BuildNote.prototype.toJSON = function toJSON() { + Command.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BuildNote; + return Command; })(); - v1.BuildOccurrence = (function() { + v1.Artifact = (function() { /** - * Properties of a BuildOccurrence. + * Properties of an Artifact. * @memberof grafeas.v1 - * @interface IBuildOccurrence - * @property {grafeas.v1.IBuildProvenance|null} [provenance] BuildOccurrence provenance - * @property {string|null} [provenanceBytes] BuildOccurrence provenanceBytes + * @interface IArtifact + * @property {string|null} [checksum] Artifact checksum + * @property {string|null} [id] Artifact id + * @property {Array.|null} [names] Artifact names */ /** - * Constructs a new BuildOccurrence. + * Constructs a new Artifact. * @memberof grafeas.v1 - * @classdesc Represents a BuildOccurrence. - * @implements IBuildOccurrence + * @classdesc Represents an Artifact. + * @implements IArtifact * @constructor - * @param {grafeas.v1.IBuildOccurrence=} [properties] Properties to set + * @param {grafeas.v1.IArtifact=} [properties] Properties to set */ - function BuildOccurrence(properties) { + function Artifact(properties) { + this.names = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5523,88 +12031,104 @@ } /** - * BuildOccurrence provenance. - * @member {grafeas.v1.IBuildProvenance|null|undefined} provenance - * @memberof grafeas.v1.BuildOccurrence + * Artifact checksum. + * @member {string} checksum + * @memberof grafeas.v1.Artifact * @instance */ - BuildOccurrence.prototype.provenance = null; + Artifact.prototype.checksum = ""; /** - * BuildOccurrence provenanceBytes. - * @member {string} provenanceBytes - * @memberof grafeas.v1.BuildOccurrence + * Artifact id. + * @member {string} id + * @memberof grafeas.v1.Artifact * @instance */ - BuildOccurrence.prototype.provenanceBytes = ""; + Artifact.prototype.id = ""; /** - * Creates a new BuildOccurrence instance using the specified properties. + * Artifact names. + * @member {Array.} names + * @memberof grafeas.v1.Artifact + * @instance + */ + Artifact.prototype.names = $util.emptyArray; + + /** + * Creates a new Artifact instance using the specified properties. * @function create - * @memberof grafeas.v1.BuildOccurrence + * @memberof grafeas.v1.Artifact * @static - * @param {grafeas.v1.IBuildOccurrence=} [properties] Properties to set - * @returns {grafeas.v1.BuildOccurrence} BuildOccurrence instance + * @param {grafeas.v1.IArtifact=} [properties] Properties to set + * @returns {grafeas.v1.Artifact} Artifact instance */ - BuildOccurrence.create = function create(properties) { - return new BuildOccurrence(properties); + Artifact.create = function create(properties) { + return new Artifact(properties); }; /** - * Encodes the specified BuildOccurrence message. Does not implicitly {@link grafeas.v1.BuildOccurrence.verify|verify} messages. + * Encodes the specified Artifact message. Does not implicitly {@link grafeas.v1.Artifact.verify|verify} messages. * @function encode - * @memberof grafeas.v1.BuildOccurrence + * @memberof grafeas.v1.Artifact * @static - * @param {grafeas.v1.IBuildOccurrence} message BuildOccurrence message or plain object to encode + * @param {grafeas.v1.IArtifact} message Artifact message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BuildOccurrence.encode = function encode(message, writer) { + Artifact.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.provenance != null && Object.hasOwnProperty.call(message, "provenance")) - $root.grafeas.v1.BuildProvenance.encode(message.provenance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.provenanceBytes != null && Object.hasOwnProperty.call(message, "provenanceBytes")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.provenanceBytes); + if (message.checksum != null && Object.hasOwnProperty.call(message, "checksum")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.checksum); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); + if (message.names != null && message.names.length) + for (var i = 0; i < message.names.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.names[i]); return writer; }; /** - * Encodes the specified BuildOccurrence message, length delimited. Does not implicitly {@link grafeas.v1.BuildOccurrence.verify|verify} messages. + * Encodes the specified Artifact message, length delimited. Does not implicitly {@link grafeas.v1.Artifact.verify|verify} messages. * @function encodeDelimited - * @memberof grafeas.v1.BuildOccurrence + * @memberof grafeas.v1.Artifact * @static - * @param {grafeas.v1.IBuildOccurrence} message BuildOccurrence message or plain object to encode + * @param {grafeas.v1.IArtifact} message Artifact message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BuildOccurrence.encodeDelimited = function encodeDelimited(message, writer) { + Artifact.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BuildOccurrence message from the specified reader or buffer. + * Decodes an Artifact message from the specified reader or buffer. * @function decode - * @memberof grafeas.v1.BuildOccurrence + * @memberof grafeas.v1.Artifact * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {grafeas.v1.BuildOccurrence} BuildOccurrence + * @returns {grafeas.v1.Artifact} Artifact * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BuildOccurrence.decode = function decode(reader, length) { + Artifact.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.BuildOccurrence(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.Artifact(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.provenance = $root.grafeas.v1.BuildProvenance.decode(reader, reader.uint32()); + message.checksum = reader.string(); break; case 2: - message.provenanceBytes = reader.string(); + message.id = reader.string(); + break; + case 3: + if (!(message.names && message.names.length)) + message.names = []; + message.names.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -5615,136 +12139,141 @@ }; /** - * Decodes a BuildOccurrence message from the specified reader or buffer, length delimited. + * Decodes an Artifact message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof grafeas.v1.BuildOccurrence + * @memberof grafeas.v1.Artifact * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {grafeas.v1.BuildOccurrence} BuildOccurrence + * @returns {grafeas.v1.Artifact} Artifact * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BuildOccurrence.decodeDelimited = function decodeDelimited(reader) { + Artifact.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BuildOccurrence message. + * Verifies an Artifact message. * @function verify - * @memberof grafeas.v1.BuildOccurrence + * @memberof grafeas.v1.Artifact * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BuildOccurrence.verify = function verify(message) { + Artifact.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.provenance != null && message.hasOwnProperty("provenance")) { - var error = $root.grafeas.v1.BuildProvenance.verify(message.provenance); - if (error) - return "provenance." + error; + if (message.checksum != null && message.hasOwnProperty("checksum")) + if (!$util.isString(message.checksum)) + return "checksum: string expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.names != null && message.hasOwnProperty("names")) { + if (!Array.isArray(message.names)) + return "names: array expected"; + for (var i = 0; i < message.names.length; ++i) + if (!$util.isString(message.names[i])) + return "names: string[] expected"; } - if (message.provenanceBytes != null && message.hasOwnProperty("provenanceBytes")) - if (!$util.isString(message.provenanceBytes)) - return "provenanceBytes: string expected"; return null; }; /** - * Creates a BuildOccurrence message from a plain object. Also converts values to their respective internal types. + * Creates an Artifact message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof grafeas.v1.BuildOccurrence + * @memberof grafeas.v1.Artifact * @static * @param {Object.} object Plain object - * @returns {grafeas.v1.BuildOccurrence} BuildOccurrence + * @returns {grafeas.v1.Artifact} Artifact */ - BuildOccurrence.fromObject = function fromObject(object) { - if (object instanceof $root.grafeas.v1.BuildOccurrence) + Artifact.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.Artifact) return object; - var message = new $root.grafeas.v1.BuildOccurrence(); - if (object.provenance != null) { - if (typeof object.provenance !== "object") - throw TypeError(".grafeas.v1.BuildOccurrence.provenance: object expected"); - message.provenance = $root.grafeas.v1.BuildProvenance.fromObject(object.provenance); + var message = new $root.grafeas.v1.Artifact(); + if (object.checksum != null) + message.checksum = String(object.checksum); + if (object.id != null) + message.id = String(object.id); + if (object.names) { + if (!Array.isArray(object.names)) + throw TypeError(".grafeas.v1.Artifact.names: array expected"); + message.names = []; + for (var i = 0; i < object.names.length; ++i) + message.names[i] = String(object.names[i]); } - if (object.provenanceBytes != null) - message.provenanceBytes = String(object.provenanceBytes); return message; }; /** - * Creates a plain object from a BuildOccurrence message. Also converts values to other types if specified. + * Creates a plain object from an Artifact message. Also converts values to other types if specified. * @function toObject - * @memberof grafeas.v1.BuildOccurrence + * @memberof grafeas.v1.Artifact * @static - * @param {grafeas.v1.BuildOccurrence} message BuildOccurrence + * @param {grafeas.v1.Artifact} message Artifact * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BuildOccurrence.toObject = function toObject(message, options) { + Artifact.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.names = []; if (options.defaults) { - object.provenance = null; - object.provenanceBytes = ""; + object.checksum = ""; + object.id = ""; + } + if (message.checksum != null && message.hasOwnProperty("checksum")) + object.checksum = message.checksum; + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.names && message.names.length) { + object.names = []; + for (var j = 0; j < message.names.length; ++j) + object.names[j] = message.names[j]; } - if (message.provenance != null && message.hasOwnProperty("provenance")) - object.provenance = $root.grafeas.v1.BuildProvenance.toObject(message.provenance, options); - if (message.provenanceBytes != null && message.hasOwnProperty("provenanceBytes")) - object.provenanceBytes = message.provenanceBytes; return object; }; /** - * Converts this BuildOccurrence to JSON. + * Converts this Artifact to JSON. * @function toJSON - * @memberof grafeas.v1.BuildOccurrence + * @memberof grafeas.v1.Artifact * @instance * @returns {Object.} JSON object */ - BuildOccurrence.prototype.toJSON = function toJSON() { + Artifact.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BuildOccurrence; + return Artifact; })(); - v1.BuildProvenance = (function() { + v1.SourceContext = (function() { /** - * Properties of a BuildProvenance. + * Properties of a SourceContext. * @memberof grafeas.v1 - * @interface IBuildProvenance - * @property {string|null} [id] BuildProvenance id - * @property {string|null} [projectId] BuildProvenance projectId - * @property {Array.|null} [commands] BuildProvenance commands - * @property {Array.|null} [builtArtifacts] BuildProvenance builtArtifacts - * @property {google.protobuf.ITimestamp|null} [createTime] BuildProvenance createTime - * @property {google.protobuf.ITimestamp|null} [startTime] BuildProvenance startTime - * @property {google.protobuf.ITimestamp|null} [endTime] BuildProvenance endTime - * @property {string|null} [creator] BuildProvenance creator - * @property {string|null} [logsUri] BuildProvenance logsUri - * @property {grafeas.v1.ISource|null} [sourceProvenance] BuildProvenance sourceProvenance - * @property {string|null} [triggerId] BuildProvenance triggerId - * @property {Object.|null} [buildOptions] BuildProvenance buildOptions - * @property {string|null} [builderVersion] BuildProvenance builderVersion + * @interface ISourceContext + * @property {grafeas.v1.ICloudRepoSourceContext|null} [cloudRepo] SourceContext cloudRepo + * @property {grafeas.v1.IGerritSourceContext|null} [gerrit] SourceContext gerrit + * @property {grafeas.v1.IGitSourceContext|null} [git] SourceContext git + * @property {Object.|null} [labels] SourceContext labels */ /** - * Constructs a new BuildProvenance. + * Constructs a new SourceContext. * @memberof grafeas.v1 - * @classdesc Represents a BuildProvenance. - * @implements IBuildProvenance + * @classdesc Represents a SourceContext. + * @implements ISourceContext * @constructor - * @param {grafeas.v1.IBuildProvenance=} [properties] Properties to set + * @param {grafeas.v1.ISourceContext=} [properties] Properties to set */ - function BuildProvenance(properties) { - this.commands = []; - this.builtArtifacts = []; - this.buildOptions = {}; + function SourceContext(properties) { + this.labels = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5752,236 +12281,130 @@ } /** - * BuildProvenance id. - * @member {string} id - * @memberof grafeas.v1.BuildProvenance - * @instance - */ - BuildProvenance.prototype.id = ""; - - /** - * BuildProvenance projectId. - * @member {string} projectId - * @memberof grafeas.v1.BuildProvenance - * @instance - */ - BuildProvenance.prototype.projectId = ""; - - /** - * BuildProvenance commands. - * @member {Array.} commands - * @memberof grafeas.v1.BuildProvenance - * @instance - */ - BuildProvenance.prototype.commands = $util.emptyArray; - - /** - * BuildProvenance builtArtifacts. - * @member {Array.} builtArtifacts - * @memberof grafeas.v1.BuildProvenance - * @instance - */ - BuildProvenance.prototype.builtArtifacts = $util.emptyArray; - - /** - * BuildProvenance createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof grafeas.v1.BuildProvenance - * @instance - */ - BuildProvenance.prototype.createTime = null; - - /** - * BuildProvenance startTime. - * @member {google.protobuf.ITimestamp|null|undefined} startTime - * @memberof grafeas.v1.BuildProvenance - * @instance - */ - BuildProvenance.prototype.startTime = null; - - /** - * BuildProvenance endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof grafeas.v1.BuildProvenance - * @instance - */ - BuildProvenance.prototype.endTime = null; - - /** - * BuildProvenance creator. - * @member {string} creator - * @memberof grafeas.v1.BuildProvenance + * SourceContext cloudRepo. + * @member {grafeas.v1.ICloudRepoSourceContext|null|undefined} cloudRepo + * @memberof grafeas.v1.SourceContext * @instance */ - BuildProvenance.prototype.creator = ""; + SourceContext.prototype.cloudRepo = null; /** - * BuildProvenance logsUri. - * @member {string} logsUri - * @memberof grafeas.v1.BuildProvenance + * SourceContext gerrit. + * @member {grafeas.v1.IGerritSourceContext|null|undefined} gerrit + * @memberof grafeas.v1.SourceContext * @instance */ - BuildProvenance.prototype.logsUri = ""; + SourceContext.prototype.gerrit = null; /** - * BuildProvenance sourceProvenance. - * @member {grafeas.v1.ISource|null|undefined} sourceProvenance - * @memberof grafeas.v1.BuildProvenance + * SourceContext git. + * @member {grafeas.v1.IGitSourceContext|null|undefined} git + * @memberof grafeas.v1.SourceContext * @instance */ - BuildProvenance.prototype.sourceProvenance = null; + SourceContext.prototype.git = null; /** - * BuildProvenance triggerId. - * @member {string} triggerId - * @memberof grafeas.v1.BuildProvenance + * SourceContext labels. + * @member {Object.} labels + * @memberof grafeas.v1.SourceContext * @instance */ - BuildProvenance.prototype.triggerId = ""; + SourceContext.prototype.labels = $util.emptyObject; - /** - * BuildProvenance buildOptions. - * @member {Object.} buildOptions - * @memberof grafeas.v1.BuildProvenance - * @instance - */ - BuildProvenance.prototype.buildOptions = $util.emptyObject; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * BuildProvenance builderVersion. - * @member {string} builderVersion - * @memberof grafeas.v1.BuildProvenance + * SourceContext context. + * @member {"cloudRepo"|"gerrit"|"git"|undefined} context + * @memberof grafeas.v1.SourceContext * @instance */ - BuildProvenance.prototype.builderVersion = ""; + Object.defineProperty(SourceContext.prototype, "context", { + get: $util.oneOfGetter($oneOfFields = ["cloudRepo", "gerrit", "git"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new BuildProvenance instance using the specified properties. + * Creates a new SourceContext instance using the specified properties. * @function create - * @memberof grafeas.v1.BuildProvenance + * @memberof grafeas.v1.SourceContext * @static - * @param {grafeas.v1.IBuildProvenance=} [properties] Properties to set - * @returns {grafeas.v1.BuildProvenance} BuildProvenance instance + * @param {grafeas.v1.ISourceContext=} [properties] Properties to set + * @returns {grafeas.v1.SourceContext} SourceContext instance */ - BuildProvenance.create = function create(properties) { - return new BuildProvenance(properties); + SourceContext.create = function create(properties) { + return new SourceContext(properties); }; /** - * Encodes the specified BuildProvenance message. Does not implicitly {@link grafeas.v1.BuildProvenance.verify|verify} messages. + * Encodes the specified SourceContext message. Does not implicitly {@link grafeas.v1.SourceContext.verify|verify} messages. * @function encode - * @memberof grafeas.v1.BuildProvenance + * @memberof grafeas.v1.SourceContext * @static - * @param {grafeas.v1.IBuildProvenance} message BuildProvenance message or plain object to encode + * @param {grafeas.v1.ISourceContext} message SourceContext message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BuildProvenance.encode = function encode(message, writer) { + SourceContext.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.projectId); - if (message.commands != null && message.commands.length) - for (var i = 0; i < message.commands.length; ++i) - $root.grafeas.v1.Command.encode(message.commands[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.builtArtifacts != null && message.builtArtifacts.length) - for (var i = 0; i < message.builtArtifacts.length; ++i) - $root.grafeas.v1.Artifact.encode(message.builtArtifacts[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) - $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.creator != null && Object.hasOwnProperty.call(message, "creator")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.creator); - if (message.logsUri != null && Object.hasOwnProperty.call(message, "logsUri")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.logsUri); - if (message.sourceProvenance != null && Object.hasOwnProperty.call(message, "sourceProvenance")) - $root.grafeas.v1.Source.encode(message.sourceProvenance, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.triggerId != null && Object.hasOwnProperty.call(message, "triggerId")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.triggerId); - if (message.buildOptions != null && Object.hasOwnProperty.call(message, "buildOptions")) - for (var keys = Object.keys(message.buildOptions), i = 0; i < keys.length; ++i) - writer.uint32(/* id 12, wireType 2 =*/98).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.buildOptions[keys[i]]).ldelim(); - if (message.builderVersion != null && Object.hasOwnProperty.call(message, "builderVersion")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.builderVersion); + if (message.cloudRepo != null && Object.hasOwnProperty.call(message, "cloudRepo")) + $root.grafeas.v1.CloudRepoSourceContext.encode(message.cloudRepo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.gerrit != null && Object.hasOwnProperty.call(message, "gerrit")) + $root.grafeas.v1.GerritSourceContext.encode(message.gerrit, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.git != null && Object.hasOwnProperty.call(message, "git")) + $root.grafeas.v1.GitSourceContext.encode(message.git, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); return writer; }; /** - * Encodes the specified BuildProvenance message, length delimited. Does not implicitly {@link grafeas.v1.BuildProvenance.verify|verify} messages. + * Encodes the specified SourceContext message, length delimited. Does not implicitly {@link grafeas.v1.SourceContext.verify|verify} messages. * @function encodeDelimited - * @memberof grafeas.v1.BuildProvenance + * @memberof grafeas.v1.SourceContext * @static - * @param {grafeas.v1.IBuildProvenance} message BuildProvenance message or plain object to encode + * @param {grafeas.v1.ISourceContext} message SourceContext message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BuildProvenance.encodeDelimited = function encodeDelimited(message, writer) { + SourceContext.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BuildProvenance message from the specified reader or buffer. + * Decodes a SourceContext message from the specified reader or buffer. * @function decode - * @memberof grafeas.v1.BuildProvenance + * @memberof grafeas.v1.SourceContext * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {grafeas.v1.BuildProvenance} BuildProvenance + * @returns {grafeas.v1.SourceContext} SourceContext * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BuildProvenance.decode = function decode(reader, length) { + SourceContext.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.BuildProvenance(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.SourceContext(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = reader.string(); + message.cloudRepo = $root.grafeas.v1.CloudRepoSourceContext.decode(reader, reader.uint32()); break; case 2: - message.projectId = reader.string(); + message.gerrit = $root.grafeas.v1.GerritSourceContext.decode(reader, reader.uint32()); break; case 3: - if (!(message.commands && message.commands.length)) - message.commands = []; - message.commands.push($root.grafeas.v1.Command.decode(reader, reader.uint32())); + message.git = $root.grafeas.v1.GitSourceContext.decode(reader, reader.uint32()); break; case 4: - if (!(message.builtArtifacts && message.builtArtifacts.length)) - message.builtArtifacts = []; - message.builtArtifacts.push($root.grafeas.v1.Artifact.decode(reader, reader.uint32())); - break; - case 5: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 6: - message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 7: - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 8: - message.creator = reader.string(); - break; - case 9: - message.logsUri = reader.string(); - break; - case 10: - message.sourceProvenance = $root.grafeas.v1.Source.decode(reader, reader.uint32()); - break; - case 11: - message.triggerId = reader.string(); - break; - case 12: - if (message.buildOptions === $util.emptyObject) - message.buildOptions = {}; + if (message.labels === $util.emptyObject) + message.labels = {}; var end2 = reader.uint32() + reader.pos; key = ""; value = ""; @@ -5999,10 +12422,7 @@ break; } } - message.buildOptions[key] = value; - break; - case 13: - message.builderVersion = reader.string(); + message.labels[key] = value; break; default: reader.skipType(tag & 7); @@ -6013,280 +12433,181 @@ }; /** - * Decodes a BuildProvenance message from the specified reader or buffer, length delimited. + * Decodes a SourceContext message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof grafeas.v1.BuildProvenance + * @memberof grafeas.v1.SourceContext * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {grafeas.v1.BuildProvenance} BuildProvenance + * @returns {grafeas.v1.SourceContext} SourceContext * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BuildProvenance.decodeDelimited = function decodeDelimited(reader) { + SourceContext.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BuildProvenance message. + * Verifies a SourceContext message. * @function verify - * @memberof grafeas.v1.BuildProvenance + * @memberof grafeas.v1.SourceContext * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BuildProvenance.verify = function verify(message) { + SourceContext.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.commands != null && message.hasOwnProperty("commands")) { - if (!Array.isArray(message.commands)) - return "commands: array expected"; - for (var i = 0; i < message.commands.length; ++i) { - var error = $root.grafeas.v1.Command.verify(message.commands[i]); + var properties = {}; + if (message.cloudRepo != null && message.hasOwnProperty("cloudRepo")) { + properties.context = 1; + { + var error = $root.grafeas.v1.CloudRepoSourceContext.verify(message.cloudRepo); if (error) - return "commands." + error; + return "cloudRepo." + error; } } - if (message.builtArtifacts != null && message.hasOwnProperty("builtArtifacts")) { - if (!Array.isArray(message.builtArtifacts)) - return "builtArtifacts: array expected"; - for (var i = 0; i < message.builtArtifacts.length; ++i) { - var error = $root.grafeas.v1.Artifact.verify(message.builtArtifacts[i]); + if (message.gerrit != null && message.hasOwnProperty("gerrit")) { + if (properties.context === 1) + return "context: multiple values"; + properties.context = 1; + { + var error = $root.grafeas.v1.GerritSourceContext.verify(message.gerrit); if (error) - return "builtArtifacts." + error; + return "gerrit." + error; } } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.startTime != null && message.hasOwnProperty("startTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.startTime); - if (error) - return "startTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - if (message.creator != null && message.hasOwnProperty("creator")) - if (!$util.isString(message.creator)) - return "creator: string expected"; - if (message.logsUri != null && message.hasOwnProperty("logsUri")) - if (!$util.isString(message.logsUri)) - return "logsUri: string expected"; - if (message.sourceProvenance != null && message.hasOwnProperty("sourceProvenance")) { - var error = $root.grafeas.v1.Source.verify(message.sourceProvenance); - if (error) - return "sourceProvenance." + error; + if (message.git != null && message.hasOwnProperty("git")) { + if (properties.context === 1) + return "context: multiple values"; + properties.context = 1; + { + var error = $root.grafeas.v1.GitSourceContext.verify(message.git); + if (error) + return "git." + error; + } } - if (message.triggerId != null && message.hasOwnProperty("triggerId")) - if (!$util.isString(message.triggerId)) - return "triggerId: string expected"; - if (message.buildOptions != null && message.hasOwnProperty("buildOptions")) { - if (!$util.isObject(message.buildOptions)) - return "buildOptions: object expected"; - var key = Object.keys(message.buildOptions); + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.buildOptions[key[i]])) - return "buildOptions: string{k:string} expected"; + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; } - if (message.builderVersion != null && message.hasOwnProperty("builderVersion")) - if (!$util.isString(message.builderVersion)) - return "builderVersion: string expected"; return null; }; /** - * Creates a BuildProvenance message from a plain object. Also converts values to their respective internal types. + * Creates a SourceContext message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof grafeas.v1.BuildProvenance + * @memberof grafeas.v1.SourceContext * @static * @param {Object.} object Plain object - * @returns {grafeas.v1.BuildProvenance} BuildProvenance + * @returns {grafeas.v1.SourceContext} SourceContext */ - BuildProvenance.fromObject = function fromObject(object) { - if (object instanceof $root.grafeas.v1.BuildProvenance) + SourceContext.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.SourceContext) return object; - var message = new $root.grafeas.v1.BuildProvenance(); - if (object.id != null) - message.id = String(object.id); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.commands) { - if (!Array.isArray(object.commands)) - throw TypeError(".grafeas.v1.BuildProvenance.commands: array expected"); - message.commands = []; - for (var i = 0; i < object.commands.length; ++i) { - if (typeof object.commands[i] !== "object") - throw TypeError(".grafeas.v1.BuildProvenance.commands: object expected"); - message.commands[i] = $root.grafeas.v1.Command.fromObject(object.commands[i]); - } - } - if (object.builtArtifacts) { - if (!Array.isArray(object.builtArtifacts)) - throw TypeError(".grafeas.v1.BuildProvenance.builtArtifacts: array expected"); - message.builtArtifacts = []; - for (var i = 0; i < object.builtArtifacts.length; ++i) { - if (typeof object.builtArtifacts[i] !== "object") - throw TypeError(".grafeas.v1.BuildProvenance.builtArtifacts: object expected"); - message.builtArtifacts[i] = $root.grafeas.v1.Artifact.fromObject(object.builtArtifacts[i]); - } - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".grafeas.v1.BuildProvenance.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.startTime != null) { - if (typeof object.startTime !== "object") - throw TypeError(".grafeas.v1.BuildProvenance.startTime: object expected"); - message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".grafeas.v1.BuildProvenance.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + var message = new $root.grafeas.v1.SourceContext(); + if (object.cloudRepo != null) { + if (typeof object.cloudRepo !== "object") + throw TypeError(".grafeas.v1.SourceContext.cloudRepo: object expected"); + message.cloudRepo = $root.grafeas.v1.CloudRepoSourceContext.fromObject(object.cloudRepo); } - if (object.creator != null) - message.creator = String(object.creator); - if (object.logsUri != null) - message.logsUri = String(object.logsUri); - if (object.sourceProvenance != null) { - if (typeof object.sourceProvenance !== "object") - throw TypeError(".grafeas.v1.BuildProvenance.sourceProvenance: object expected"); - message.sourceProvenance = $root.grafeas.v1.Source.fromObject(object.sourceProvenance); + if (object.gerrit != null) { + if (typeof object.gerrit !== "object") + throw TypeError(".grafeas.v1.SourceContext.gerrit: object expected"); + message.gerrit = $root.grafeas.v1.GerritSourceContext.fromObject(object.gerrit); } - if (object.triggerId != null) - message.triggerId = String(object.triggerId); - if (object.buildOptions) { - if (typeof object.buildOptions !== "object") - throw TypeError(".grafeas.v1.BuildProvenance.buildOptions: object expected"); - message.buildOptions = {}; - for (var keys = Object.keys(object.buildOptions), i = 0; i < keys.length; ++i) - message.buildOptions[keys[i]] = String(object.buildOptions[keys[i]]); + if (object.git != null) { + if (typeof object.git !== "object") + throw TypeError(".grafeas.v1.SourceContext.git: object expected"); + message.git = $root.grafeas.v1.GitSourceContext.fromObject(object.git); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".grafeas.v1.SourceContext.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); } - if (object.builderVersion != null) - message.builderVersion = String(object.builderVersion); return message; }; /** - * Creates a plain object from a BuildProvenance message. Also converts values to other types if specified. + * Creates a plain object from a SourceContext message. Also converts values to other types if specified. * @function toObject - * @memberof grafeas.v1.BuildProvenance + * @memberof grafeas.v1.SourceContext * @static - * @param {grafeas.v1.BuildProvenance} message BuildProvenance + * @param {grafeas.v1.SourceContext} message SourceContext * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BuildProvenance.toObject = function toObject(message, options) { + SourceContext.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.commands = []; - object.builtArtifacts = []; - } if (options.objects || options.defaults) - object.buildOptions = {}; - if (options.defaults) { - object.id = ""; - object.projectId = ""; - object.createTime = null; - object.startTime = null; - object.endTime = null; - object.creator = ""; - object.logsUri = ""; - object.sourceProvenance = null; - object.triggerId = ""; - object.builderVersion = ""; + object.labels = {}; + if (message.cloudRepo != null && message.hasOwnProperty("cloudRepo")) { + object.cloudRepo = $root.grafeas.v1.CloudRepoSourceContext.toObject(message.cloudRepo, options); + if (options.oneofs) + object.context = "cloudRepo"; } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.commands && message.commands.length) { - object.commands = []; - for (var j = 0; j < message.commands.length; ++j) - object.commands[j] = $root.grafeas.v1.Command.toObject(message.commands[j], options); + if (message.gerrit != null && message.hasOwnProperty("gerrit")) { + object.gerrit = $root.grafeas.v1.GerritSourceContext.toObject(message.gerrit, options); + if (options.oneofs) + object.context = "gerrit"; } - if (message.builtArtifacts && message.builtArtifacts.length) { - object.builtArtifacts = []; - for (var j = 0; j < message.builtArtifacts.length; ++j) - object.builtArtifacts[j] = $root.grafeas.v1.Artifact.toObject(message.builtArtifacts[j], options); + if (message.git != null && message.hasOwnProperty("git")) { + object.git = $root.grafeas.v1.GitSourceContext.toObject(message.git, options); + if (options.oneofs) + object.context = "git"; } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.startTime != null && message.hasOwnProperty("startTime")) - object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.creator != null && message.hasOwnProperty("creator")) - object.creator = message.creator; - if (message.logsUri != null && message.hasOwnProperty("logsUri")) - object.logsUri = message.logsUri; - if (message.sourceProvenance != null && message.hasOwnProperty("sourceProvenance")) - object.sourceProvenance = $root.grafeas.v1.Source.toObject(message.sourceProvenance, options); - if (message.triggerId != null && message.hasOwnProperty("triggerId")) - object.triggerId = message.triggerId; var keys2; - if (message.buildOptions && (keys2 = Object.keys(message.buildOptions)).length) { - object.buildOptions = {}; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; for (var j = 0; j < keys2.length; ++j) - object.buildOptions[keys2[j]] = message.buildOptions[keys2[j]]; + object.labels[keys2[j]] = message.labels[keys2[j]]; } - if (message.builderVersion != null && message.hasOwnProperty("builderVersion")) - object.builderVersion = message.builderVersion; return object; }; /** - * Converts this BuildProvenance to JSON. + * Converts this SourceContext to JSON. * @function toJSON - * @memberof grafeas.v1.BuildProvenance + * @memberof grafeas.v1.SourceContext * @instance * @returns {Object.} JSON object */ - BuildProvenance.prototype.toJSON = function toJSON() { + SourceContext.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BuildProvenance; + return SourceContext; })(); - v1.Source = (function() { + v1.AliasContext = (function() { /** - * Properties of a Source. + * Properties of an AliasContext. * @memberof grafeas.v1 - * @interface ISource - * @property {string|null} [artifactStorageSourceUri] Source artifactStorageSourceUri - * @property {Object.|null} [fileHashes] Source fileHashes - * @property {grafeas.v1.ISourceContext|null} [context] Source context - * @property {Array.|null} [additionalContexts] Source additionalContexts + * @interface IAliasContext + * @property {grafeas.v1.AliasContext.Kind|null} [kind] AliasContext kind + * @property {string|null} [name] AliasContext name */ /** - * Constructs a new Source. + * Constructs a new AliasContext. * @memberof grafeas.v1 - * @classdesc Represents a Source. - * @implements ISource + * @classdesc Represents an AliasContext. + * @implements IAliasContext * @constructor - * @param {grafeas.v1.ISource=} [properties] Properties to set + * @param {grafeas.v1.IAliasContext=} [properties] Properties to set */ - function Source(properties) { - this.fileHashes = {}; - this.additionalContexts = []; + function AliasContext(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6294,139 +12615,88 @@ } /** - * Source artifactStorageSourceUri. - * @member {string} artifactStorageSourceUri - * @memberof grafeas.v1.Source - * @instance - */ - Source.prototype.artifactStorageSourceUri = ""; - - /** - * Source fileHashes. - * @member {Object.} fileHashes - * @memberof grafeas.v1.Source - * @instance - */ - Source.prototype.fileHashes = $util.emptyObject; - - /** - * Source context. - * @member {grafeas.v1.ISourceContext|null|undefined} context - * @memberof grafeas.v1.Source + * AliasContext kind. + * @member {grafeas.v1.AliasContext.Kind} kind + * @memberof grafeas.v1.AliasContext * @instance */ - Source.prototype.context = null; + AliasContext.prototype.kind = 0; /** - * Source additionalContexts. - * @member {Array.} additionalContexts - * @memberof grafeas.v1.Source + * AliasContext name. + * @member {string} name + * @memberof grafeas.v1.AliasContext * @instance */ - Source.prototype.additionalContexts = $util.emptyArray; + AliasContext.prototype.name = ""; /** - * Creates a new Source instance using the specified properties. + * Creates a new AliasContext instance using the specified properties. * @function create - * @memberof grafeas.v1.Source + * @memberof grafeas.v1.AliasContext * @static - * @param {grafeas.v1.ISource=} [properties] Properties to set - * @returns {grafeas.v1.Source} Source instance + * @param {grafeas.v1.IAliasContext=} [properties] Properties to set + * @returns {grafeas.v1.AliasContext} AliasContext instance */ - Source.create = function create(properties) { - return new Source(properties); + AliasContext.create = function create(properties) { + return new AliasContext(properties); }; /** - * Encodes the specified Source message. Does not implicitly {@link grafeas.v1.Source.verify|verify} messages. + * Encodes the specified AliasContext message. Does not implicitly {@link grafeas.v1.AliasContext.verify|verify} messages. * @function encode - * @memberof grafeas.v1.Source + * @memberof grafeas.v1.AliasContext * @static - * @param {grafeas.v1.ISource} message Source message or plain object to encode + * @param {grafeas.v1.IAliasContext} message AliasContext message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Source.encode = function encode(message, writer) { + AliasContext.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.artifactStorageSourceUri != null && Object.hasOwnProperty.call(message, "artifactStorageSourceUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.artifactStorageSourceUri); - if (message.fileHashes != null && Object.hasOwnProperty.call(message, "fileHashes")) - for (var keys = Object.keys(message.fileHashes), i = 0; i < keys.length; ++i) { - writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); - $root.grafeas.v1.FileHashes.encode(message.fileHashes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); - } - if (message.context != null && Object.hasOwnProperty.call(message, "context")) - $root.grafeas.v1.SourceContext.encode(message.context, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.additionalContexts != null && message.additionalContexts.length) - for (var i = 0; i < message.additionalContexts.length; ++i) - $root.grafeas.v1.SourceContext.encode(message.additionalContexts[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.kind); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); return writer; }; /** - * Encodes the specified Source message, length delimited. Does not implicitly {@link grafeas.v1.Source.verify|verify} messages. + * Encodes the specified AliasContext message, length delimited. Does not implicitly {@link grafeas.v1.AliasContext.verify|verify} messages. * @function encodeDelimited - * @memberof grafeas.v1.Source + * @memberof grafeas.v1.AliasContext * @static - * @param {grafeas.v1.ISource} message Source message or plain object to encode + * @param {grafeas.v1.IAliasContext} message AliasContext message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Source.encodeDelimited = function encodeDelimited(message, writer) { + AliasContext.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Source message from the specified reader or buffer. + * Decodes an AliasContext message from the specified reader or buffer. * @function decode - * @memberof grafeas.v1.Source + * @memberof grafeas.v1.AliasContext * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {grafeas.v1.Source} Source - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Source.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.Source(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.artifactStorageSourceUri = reader.string(); - break; - case 2: - if (message.fileHashes === $util.emptyObject) - message.fileHashes = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = null; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = $root.grafeas.v1.FileHashes.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.fileHashes[key] = value; - break; - case 3: - message.context = $root.grafeas.v1.SourceContext.decode(reader, reader.uint32()); + * @returns {grafeas.v1.AliasContext} AliasContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AliasContext.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.AliasContext(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.kind = reader.int32(); break; - case 4: - if (!(message.additionalContexts && message.additionalContexts.length)) - message.additionalContexts = []; - message.additionalContexts.push($root.grafeas.v1.SourceContext.decode(reader, reader.uint32())); + case 2: + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -6437,176 +12707,159 @@ }; /** - * Decodes a Source message from the specified reader or buffer, length delimited. + * Decodes an AliasContext message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof grafeas.v1.Source + * @memberof grafeas.v1.AliasContext * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {grafeas.v1.Source} Source + * @returns {grafeas.v1.AliasContext} AliasContext * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Source.decodeDelimited = function decodeDelimited(reader) { + AliasContext.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Source message. + * Verifies an AliasContext message. * @function verify - * @memberof grafeas.v1.Source + * @memberof grafeas.v1.AliasContext * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Source.verify = function verify(message) { + AliasContext.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.artifactStorageSourceUri != null && message.hasOwnProperty("artifactStorageSourceUri")) - if (!$util.isString(message.artifactStorageSourceUri)) - return "artifactStorageSourceUri: string expected"; - if (message.fileHashes != null && message.hasOwnProperty("fileHashes")) { - if (!$util.isObject(message.fileHashes)) - return "fileHashes: object expected"; - var key = Object.keys(message.fileHashes); - for (var i = 0; i < key.length; ++i) { - var error = $root.grafeas.v1.FileHashes.verify(message.fileHashes[key[i]]); - if (error) - return "fileHashes." + error; - } - } - if (message.context != null && message.hasOwnProperty("context")) { - var error = $root.grafeas.v1.SourceContext.verify(message.context); - if (error) - return "context." + error; - } - if (message.additionalContexts != null && message.hasOwnProperty("additionalContexts")) { - if (!Array.isArray(message.additionalContexts)) - return "additionalContexts: array expected"; - for (var i = 0; i < message.additionalContexts.length; ++i) { - var error = $root.grafeas.v1.SourceContext.verify(message.additionalContexts[i]); - if (error) - return "additionalContexts." + error; + if (message.kind != null && message.hasOwnProperty("kind")) + switch (message.kind) { + default: + return "kind: enum value expected"; + case 0: + case 1: + case 2: + case 4: + break; } - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a Source message from a plain object. Also converts values to their respective internal types. + * Creates an AliasContext message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof grafeas.v1.Source + * @memberof grafeas.v1.AliasContext * @static * @param {Object.} object Plain object - * @returns {grafeas.v1.Source} Source + * @returns {grafeas.v1.AliasContext} AliasContext */ - Source.fromObject = function fromObject(object) { - if (object instanceof $root.grafeas.v1.Source) + AliasContext.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.AliasContext) return object; - var message = new $root.grafeas.v1.Source(); - if (object.artifactStorageSourceUri != null) - message.artifactStorageSourceUri = String(object.artifactStorageSourceUri); - if (object.fileHashes) { - if (typeof object.fileHashes !== "object") - throw TypeError(".grafeas.v1.Source.fileHashes: object expected"); - message.fileHashes = {}; - for (var keys = Object.keys(object.fileHashes), i = 0; i < keys.length; ++i) { - if (typeof object.fileHashes[keys[i]] !== "object") - throw TypeError(".grafeas.v1.Source.fileHashes: object expected"); - message.fileHashes[keys[i]] = $root.grafeas.v1.FileHashes.fromObject(object.fileHashes[keys[i]]); - } - } - if (object.context != null) { - if (typeof object.context !== "object") - throw TypeError(".grafeas.v1.Source.context: object expected"); - message.context = $root.grafeas.v1.SourceContext.fromObject(object.context); - } - if (object.additionalContexts) { - if (!Array.isArray(object.additionalContexts)) - throw TypeError(".grafeas.v1.Source.additionalContexts: array expected"); - message.additionalContexts = []; - for (var i = 0; i < object.additionalContexts.length; ++i) { - if (typeof object.additionalContexts[i] !== "object") - throw TypeError(".grafeas.v1.Source.additionalContexts: object expected"); - message.additionalContexts[i] = $root.grafeas.v1.SourceContext.fromObject(object.additionalContexts[i]); - } + var message = new $root.grafeas.v1.AliasContext(); + switch (object.kind) { + case "KIND_UNSPECIFIED": + case 0: + message.kind = 0; + break; + case "FIXED": + case 1: + message.kind = 1; + break; + case "MOVABLE": + case 2: + message.kind = 2; + break; + case "OTHER": + case 4: + message.kind = 4; + break; } + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a Source message. Also converts values to other types if specified. + * Creates a plain object from an AliasContext message. Also converts values to other types if specified. * @function toObject - * @memberof grafeas.v1.Source + * @memberof grafeas.v1.AliasContext * @static - * @param {grafeas.v1.Source} message Source + * @param {grafeas.v1.AliasContext} message AliasContext * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Source.toObject = function toObject(message, options) { + AliasContext.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.additionalContexts = []; - if (options.objects || options.defaults) - object.fileHashes = {}; if (options.defaults) { - object.artifactStorageSourceUri = ""; - object.context = null; - } - if (message.artifactStorageSourceUri != null && message.hasOwnProperty("artifactStorageSourceUri")) - object.artifactStorageSourceUri = message.artifactStorageSourceUri; - var keys2; - if (message.fileHashes && (keys2 = Object.keys(message.fileHashes)).length) { - object.fileHashes = {}; - for (var j = 0; j < keys2.length; ++j) - object.fileHashes[keys2[j]] = $root.grafeas.v1.FileHashes.toObject(message.fileHashes[keys2[j]], options); - } - if (message.context != null && message.hasOwnProperty("context")) - object.context = $root.grafeas.v1.SourceContext.toObject(message.context, options); - if (message.additionalContexts && message.additionalContexts.length) { - object.additionalContexts = []; - for (var j = 0; j < message.additionalContexts.length; ++j) - object.additionalContexts[j] = $root.grafeas.v1.SourceContext.toObject(message.additionalContexts[j], options); + object.kind = options.enums === String ? "KIND_UNSPECIFIED" : 0; + object.name = ""; } + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = options.enums === String ? $root.grafeas.v1.AliasContext.Kind[message.kind] : message.kind; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this Source to JSON. + * Converts this AliasContext to JSON. * @function toJSON - * @memberof grafeas.v1.Source + * @memberof grafeas.v1.AliasContext * @instance * @returns {Object.} JSON object */ - Source.prototype.toJSON = function toJSON() { + AliasContext.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Source; + /** + * Kind enum. + * @name grafeas.v1.AliasContext.Kind + * @enum {number} + * @property {number} KIND_UNSPECIFIED=0 KIND_UNSPECIFIED value + * @property {number} FIXED=1 FIXED value + * @property {number} MOVABLE=2 MOVABLE value + * @property {number} OTHER=4 OTHER value + */ + AliasContext.Kind = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KIND_UNSPECIFIED"] = 0; + values[valuesById[1] = "FIXED"] = 1; + values[valuesById[2] = "MOVABLE"] = 2; + values[valuesById[4] = "OTHER"] = 4; + return values; + })(); + + return AliasContext; })(); - v1.FileHashes = (function() { + v1.CloudRepoSourceContext = (function() { /** - * Properties of a FileHashes. + * Properties of a CloudRepoSourceContext. * @memberof grafeas.v1 - * @interface IFileHashes - * @property {Array.|null} [fileHash] FileHashes fileHash + * @interface ICloudRepoSourceContext + * @property {grafeas.v1.IRepoId|null} [repoId] CloudRepoSourceContext repoId + * @property {string|null} [revisionId] CloudRepoSourceContext revisionId + * @property {grafeas.v1.IAliasContext|null} [aliasContext] CloudRepoSourceContext aliasContext */ /** - * Constructs a new FileHashes. + * Constructs a new CloudRepoSourceContext. * @memberof grafeas.v1 - * @classdesc Represents a FileHashes. - * @implements IFileHashes + * @classdesc Represents a CloudRepoSourceContext. + * @implements ICloudRepoSourceContext * @constructor - * @param {grafeas.v1.IFileHashes=} [properties] Properties to set + * @param {grafeas.v1.ICloudRepoSourceContext=} [properties] Properties to set */ - function FileHashes(properties) { - this.fileHash = []; + function CloudRepoSourceContext(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6614,78 +12867,115 @@ } /** - * FileHashes fileHash. - * @member {Array.} fileHash - * @memberof grafeas.v1.FileHashes + * CloudRepoSourceContext repoId. + * @member {grafeas.v1.IRepoId|null|undefined} repoId + * @memberof grafeas.v1.CloudRepoSourceContext * @instance */ - FileHashes.prototype.fileHash = $util.emptyArray; + CloudRepoSourceContext.prototype.repoId = null; /** - * Creates a new FileHashes instance using the specified properties. + * CloudRepoSourceContext revisionId. + * @member {string|null|undefined} revisionId + * @memberof grafeas.v1.CloudRepoSourceContext + * @instance + */ + CloudRepoSourceContext.prototype.revisionId = null; + + /** + * CloudRepoSourceContext aliasContext. + * @member {grafeas.v1.IAliasContext|null|undefined} aliasContext + * @memberof grafeas.v1.CloudRepoSourceContext + * @instance + */ + CloudRepoSourceContext.prototype.aliasContext = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CloudRepoSourceContext revision. + * @member {"revisionId"|"aliasContext"|undefined} revision + * @memberof grafeas.v1.CloudRepoSourceContext + * @instance + */ + Object.defineProperty(CloudRepoSourceContext.prototype, "revision", { + get: $util.oneOfGetter($oneOfFields = ["revisionId", "aliasContext"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CloudRepoSourceContext instance using the specified properties. * @function create - * @memberof grafeas.v1.FileHashes + * @memberof grafeas.v1.CloudRepoSourceContext * @static - * @param {grafeas.v1.IFileHashes=} [properties] Properties to set - * @returns {grafeas.v1.FileHashes} FileHashes instance + * @param {grafeas.v1.ICloudRepoSourceContext=} [properties] Properties to set + * @returns {grafeas.v1.CloudRepoSourceContext} CloudRepoSourceContext instance */ - FileHashes.create = function create(properties) { - return new FileHashes(properties); + CloudRepoSourceContext.create = function create(properties) { + return new CloudRepoSourceContext(properties); }; /** - * Encodes the specified FileHashes message. Does not implicitly {@link grafeas.v1.FileHashes.verify|verify} messages. + * Encodes the specified CloudRepoSourceContext message. Does not implicitly {@link grafeas.v1.CloudRepoSourceContext.verify|verify} messages. * @function encode - * @memberof grafeas.v1.FileHashes + * @memberof grafeas.v1.CloudRepoSourceContext * @static - * @param {grafeas.v1.IFileHashes} message FileHashes message or plain object to encode + * @param {grafeas.v1.ICloudRepoSourceContext} message CloudRepoSourceContext message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileHashes.encode = function encode(message, writer) { + CloudRepoSourceContext.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.fileHash != null && message.fileHash.length) - for (var i = 0; i < message.fileHash.length; ++i) - $root.grafeas.v1.Hash.encode(message.fileHash[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.repoId != null && Object.hasOwnProperty.call(message, "repoId")) + $root.grafeas.v1.RepoId.encode(message.repoId, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.revisionId); + if (message.aliasContext != null && Object.hasOwnProperty.call(message, "aliasContext")) + $root.grafeas.v1.AliasContext.encode(message.aliasContext, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified FileHashes message, length delimited. Does not implicitly {@link grafeas.v1.FileHashes.verify|verify} messages. + * Encodes the specified CloudRepoSourceContext message, length delimited. Does not implicitly {@link grafeas.v1.CloudRepoSourceContext.verify|verify} messages. * @function encodeDelimited - * @memberof grafeas.v1.FileHashes + * @memberof grafeas.v1.CloudRepoSourceContext * @static - * @param {grafeas.v1.IFileHashes} message FileHashes message or plain object to encode + * @param {grafeas.v1.ICloudRepoSourceContext} message CloudRepoSourceContext message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - FileHashes.encodeDelimited = function encodeDelimited(message, writer) { + CloudRepoSourceContext.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a FileHashes message from the specified reader or buffer. + * Decodes a CloudRepoSourceContext message from the specified reader or buffer. * @function decode - * @memberof grafeas.v1.FileHashes + * @memberof grafeas.v1.CloudRepoSourceContext * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {grafeas.v1.FileHashes} FileHashes + * @returns {grafeas.v1.CloudRepoSourceContext} CloudRepoSourceContext * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FileHashes.decode = function decode(reader, length) { + CloudRepoSourceContext.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.FileHashes(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.CloudRepoSourceContext(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.fileHash && message.fileHash.length)) - message.fileHash = []; - message.fileHash.push($root.grafeas.v1.Hash.decode(reader, reader.uint32())); + message.repoId = $root.grafeas.v1.RepoId.decode(reader, reader.uint32()); + break; + case 2: + message.revisionId = reader.string(); + break; + case 3: + message.aliasContext = $root.grafeas.v1.AliasContext.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -6696,125 +12986,148 @@ }; /** - * Decodes a FileHashes message from the specified reader or buffer, length delimited. + * Decodes a CloudRepoSourceContext message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof grafeas.v1.FileHashes + * @memberof grafeas.v1.CloudRepoSourceContext * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {grafeas.v1.FileHashes} FileHashes + * @returns {grafeas.v1.CloudRepoSourceContext} CloudRepoSourceContext * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - FileHashes.decodeDelimited = function decodeDelimited(reader) { + CloudRepoSourceContext.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a FileHashes message. + * Verifies a CloudRepoSourceContext message. * @function verify - * @memberof grafeas.v1.FileHashes + * @memberof grafeas.v1.CloudRepoSourceContext * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - FileHashes.verify = function verify(message) { + CloudRepoSourceContext.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.fileHash != null && message.hasOwnProperty("fileHash")) { - if (!Array.isArray(message.fileHash)) - return "fileHash: array expected"; - for (var i = 0; i < message.fileHash.length; ++i) { - var error = $root.grafeas.v1.Hash.verify(message.fileHash[i]); + var properties = {}; + if (message.repoId != null && message.hasOwnProperty("repoId")) { + var error = $root.grafeas.v1.RepoId.verify(message.repoId); + if (error) + return "repoId." + error; + } + if (message.revisionId != null && message.hasOwnProperty("revisionId")) { + properties.revision = 1; + if (!$util.isString(message.revisionId)) + return "revisionId: string expected"; + } + if (message.aliasContext != null && message.hasOwnProperty("aliasContext")) { + if (properties.revision === 1) + return "revision: multiple values"; + properties.revision = 1; + { + var error = $root.grafeas.v1.AliasContext.verify(message.aliasContext); if (error) - return "fileHash." + error; + return "aliasContext." + error; } } return null; }; /** - * Creates a FileHashes message from a plain object. Also converts values to their respective internal types. + * Creates a CloudRepoSourceContext message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof grafeas.v1.FileHashes + * @memberof grafeas.v1.CloudRepoSourceContext * @static * @param {Object.} object Plain object - * @returns {grafeas.v1.FileHashes} FileHashes + * @returns {grafeas.v1.CloudRepoSourceContext} CloudRepoSourceContext */ - FileHashes.fromObject = function fromObject(object) { - if (object instanceof $root.grafeas.v1.FileHashes) + CloudRepoSourceContext.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.CloudRepoSourceContext) return object; - var message = new $root.grafeas.v1.FileHashes(); - if (object.fileHash) { - if (!Array.isArray(object.fileHash)) - throw TypeError(".grafeas.v1.FileHashes.fileHash: array expected"); - message.fileHash = []; - for (var i = 0; i < object.fileHash.length; ++i) { - if (typeof object.fileHash[i] !== "object") - throw TypeError(".grafeas.v1.FileHashes.fileHash: object expected"); - message.fileHash[i] = $root.grafeas.v1.Hash.fromObject(object.fileHash[i]); - } + var message = new $root.grafeas.v1.CloudRepoSourceContext(); + if (object.repoId != null) { + if (typeof object.repoId !== "object") + throw TypeError(".grafeas.v1.CloudRepoSourceContext.repoId: object expected"); + message.repoId = $root.grafeas.v1.RepoId.fromObject(object.repoId); + } + if (object.revisionId != null) + message.revisionId = String(object.revisionId); + if (object.aliasContext != null) { + if (typeof object.aliasContext !== "object") + throw TypeError(".grafeas.v1.CloudRepoSourceContext.aliasContext: object expected"); + message.aliasContext = $root.grafeas.v1.AliasContext.fromObject(object.aliasContext); } return message; }; /** - * Creates a plain object from a FileHashes message. Also converts values to other types if specified. + * Creates a plain object from a CloudRepoSourceContext message. Also converts values to other types if specified. * @function toObject - * @memberof grafeas.v1.FileHashes + * @memberof grafeas.v1.CloudRepoSourceContext * @static - * @param {grafeas.v1.FileHashes} message FileHashes + * @param {grafeas.v1.CloudRepoSourceContext} message CloudRepoSourceContext * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - FileHashes.toObject = function toObject(message, options) { + CloudRepoSourceContext.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.fileHash = []; - if (message.fileHash && message.fileHash.length) { - object.fileHash = []; - for (var j = 0; j < message.fileHash.length; ++j) - object.fileHash[j] = $root.grafeas.v1.Hash.toObject(message.fileHash[j], options); + if (options.defaults) + object.repoId = null; + if (message.repoId != null && message.hasOwnProperty("repoId")) + object.repoId = $root.grafeas.v1.RepoId.toObject(message.repoId, options); + if (message.revisionId != null && message.hasOwnProperty("revisionId")) { + object.revisionId = message.revisionId; + if (options.oneofs) + object.revision = "revisionId"; + } + if (message.aliasContext != null && message.hasOwnProperty("aliasContext")) { + object.aliasContext = $root.grafeas.v1.AliasContext.toObject(message.aliasContext, options); + if (options.oneofs) + object.revision = "aliasContext"; } return object; }; /** - * Converts this FileHashes to JSON. + * Converts this CloudRepoSourceContext to JSON. * @function toJSON - * @memberof grafeas.v1.FileHashes + * @memberof grafeas.v1.CloudRepoSourceContext * @instance * @returns {Object.} JSON object */ - FileHashes.prototype.toJSON = function toJSON() { + CloudRepoSourceContext.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return FileHashes; + return CloudRepoSourceContext; })(); - v1.Hash = (function() { + v1.GerritSourceContext = (function() { /** - * Properties of a Hash. + * Properties of a GerritSourceContext. * @memberof grafeas.v1 - * @interface IHash - * @property {string|null} [type] Hash type - * @property {Uint8Array|null} [value] Hash value + * @interface IGerritSourceContext + * @property {string|null} [hostUri] GerritSourceContext hostUri + * @property {string|null} [gerritProject] GerritSourceContext gerritProject + * @property {string|null} [revisionId] GerritSourceContext revisionId + * @property {grafeas.v1.IAliasContext|null} [aliasContext] GerritSourceContext aliasContext */ /** - * Constructs a new Hash. + * Constructs a new GerritSourceContext. * @memberof grafeas.v1 - * @classdesc Represents a Hash. - * @implements IHash + * @classdesc Represents a GerritSourceContext. + * @implements IGerritSourceContext * @constructor - * @param {grafeas.v1.IHash=} [properties] Properties to set + * @param {grafeas.v1.IGerritSourceContext=} [properties] Properties to set */ - function Hash(properties) { + function GerritSourceContext(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6822,88 +13135,128 @@ } /** - * Hash type. - * @member {string} type - * @memberof grafeas.v1.Hash + * GerritSourceContext hostUri. + * @member {string} hostUri + * @memberof grafeas.v1.GerritSourceContext * @instance */ - Hash.prototype.type = ""; + GerritSourceContext.prototype.hostUri = ""; /** - * Hash value. - * @member {Uint8Array} value - * @memberof grafeas.v1.Hash + * GerritSourceContext gerritProject. + * @member {string} gerritProject + * @memberof grafeas.v1.GerritSourceContext * @instance */ - Hash.prototype.value = $util.newBuffer([]); + GerritSourceContext.prototype.gerritProject = ""; /** - * Creates a new Hash instance using the specified properties. + * GerritSourceContext revisionId. + * @member {string|null|undefined} revisionId + * @memberof grafeas.v1.GerritSourceContext + * @instance + */ + GerritSourceContext.prototype.revisionId = null; + + /** + * GerritSourceContext aliasContext. + * @member {grafeas.v1.IAliasContext|null|undefined} aliasContext + * @memberof grafeas.v1.GerritSourceContext + * @instance + */ + GerritSourceContext.prototype.aliasContext = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GerritSourceContext revision. + * @member {"revisionId"|"aliasContext"|undefined} revision + * @memberof grafeas.v1.GerritSourceContext + * @instance + */ + Object.defineProperty(GerritSourceContext.prototype, "revision", { + get: $util.oneOfGetter($oneOfFields = ["revisionId", "aliasContext"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GerritSourceContext instance using the specified properties. * @function create - * @memberof grafeas.v1.Hash + * @memberof grafeas.v1.GerritSourceContext * @static - * @param {grafeas.v1.IHash=} [properties] Properties to set - * @returns {grafeas.v1.Hash} Hash instance + * @param {grafeas.v1.IGerritSourceContext=} [properties] Properties to set + * @returns {grafeas.v1.GerritSourceContext} GerritSourceContext instance */ - Hash.create = function create(properties) { - return new Hash(properties); + GerritSourceContext.create = function create(properties) { + return new GerritSourceContext(properties); }; /** - * Encodes the specified Hash message. Does not implicitly {@link grafeas.v1.Hash.verify|verify} messages. + * Encodes the specified GerritSourceContext message. Does not implicitly {@link grafeas.v1.GerritSourceContext.verify|verify} messages. * @function encode - * @memberof grafeas.v1.Hash + * @memberof grafeas.v1.GerritSourceContext * @static - * @param {grafeas.v1.IHash} message Hash message or plain object to encode + * @param {grafeas.v1.IGerritSourceContext} message GerritSourceContext message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Hash.encode = function encode(message, writer) { + GerritSourceContext.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + if (message.hostUri != null && Object.hasOwnProperty.call(message, "hostUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.hostUri); + if (message.gerritProject != null && Object.hasOwnProperty.call(message, "gerritProject")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.gerritProject); + if (message.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.revisionId); + if (message.aliasContext != null && Object.hasOwnProperty.call(message, "aliasContext")) + $root.grafeas.v1.AliasContext.encode(message.aliasContext, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified Hash message, length delimited. Does not implicitly {@link grafeas.v1.Hash.verify|verify} messages. + * Encodes the specified GerritSourceContext message, length delimited. Does not implicitly {@link grafeas.v1.GerritSourceContext.verify|verify} messages. * @function encodeDelimited - * @memberof grafeas.v1.Hash + * @memberof grafeas.v1.GerritSourceContext * @static - * @param {grafeas.v1.IHash} message Hash message or plain object to encode + * @param {grafeas.v1.IGerritSourceContext} message GerritSourceContext message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Hash.encodeDelimited = function encodeDelimited(message, writer) { + GerritSourceContext.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Hash message from the specified reader or buffer. + * Decodes a GerritSourceContext message from the specified reader or buffer. * @function decode - * @memberof grafeas.v1.Hash + * @memberof grafeas.v1.GerritSourceContext * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {grafeas.v1.Hash} Hash + * @returns {grafeas.v1.GerritSourceContext} GerritSourceContext * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Hash.decode = function decode(reader, length) { + GerritSourceContext.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.Hash(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.GerritSourceContext(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.type = reader.string(); + message.hostUri = reader.string(); break; case 2: - message.value = reader.bytes(); + message.gerritProject = reader.string(); + break; + case 3: + message.revisionId = reader.string(); + break; + case 4: + message.aliasContext = $root.grafeas.v1.AliasContext.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -6914,133 +13267,150 @@ }; /** - * Decodes a Hash message from the specified reader or buffer, length delimited. + * Decodes a GerritSourceContext message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof grafeas.v1.Hash + * @memberof grafeas.v1.GerritSourceContext * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {grafeas.v1.Hash} Hash + * @returns {grafeas.v1.GerritSourceContext} GerritSourceContext * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Hash.decodeDelimited = function decodeDelimited(reader) { + GerritSourceContext.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Hash message. + * Verifies a GerritSourceContext message. * @function verify - * @memberof grafeas.v1.Hash + * @memberof grafeas.v1.GerritSourceContext * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Hash.verify = function verify(message) { + GerritSourceContext.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) - return "value: buffer expected"; + var properties = {}; + if (message.hostUri != null && message.hasOwnProperty("hostUri")) + if (!$util.isString(message.hostUri)) + return "hostUri: string expected"; + if (message.gerritProject != null && message.hasOwnProperty("gerritProject")) + if (!$util.isString(message.gerritProject)) + return "gerritProject: string expected"; + if (message.revisionId != null && message.hasOwnProperty("revisionId")) { + properties.revision = 1; + if (!$util.isString(message.revisionId)) + return "revisionId: string expected"; + } + if (message.aliasContext != null && message.hasOwnProperty("aliasContext")) { + if (properties.revision === 1) + return "revision: multiple values"; + properties.revision = 1; + { + var error = $root.grafeas.v1.AliasContext.verify(message.aliasContext); + if (error) + return "aliasContext." + error; + } + } return null; }; /** - * Creates a Hash message from a plain object. Also converts values to their respective internal types. + * Creates a GerritSourceContext message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof grafeas.v1.Hash + * @memberof grafeas.v1.GerritSourceContext * @static * @param {Object.} object Plain object - * @returns {grafeas.v1.Hash} Hash + * @returns {grafeas.v1.GerritSourceContext} GerritSourceContext */ - Hash.fromObject = function fromObject(object) { - if (object instanceof $root.grafeas.v1.Hash) + GerritSourceContext.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.GerritSourceContext) return object; - var message = new $root.grafeas.v1.Hash(); - if (object.type != null) - message.type = String(object.type); - if (object.value != null) - if (typeof object.value === "string") - $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); - else if (object.value.length) - message.value = object.value; + var message = new $root.grafeas.v1.GerritSourceContext(); + if (object.hostUri != null) + message.hostUri = String(object.hostUri); + if (object.gerritProject != null) + message.gerritProject = String(object.gerritProject); + if (object.revisionId != null) + message.revisionId = String(object.revisionId); + if (object.aliasContext != null) { + if (typeof object.aliasContext !== "object") + throw TypeError(".grafeas.v1.GerritSourceContext.aliasContext: object expected"); + message.aliasContext = $root.grafeas.v1.AliasContext.fromObject(object.aliasContext); + } return message; }; /** - * Creates a plain object from a Hash message. Also converts values to other types if specified. + * Creates a plain object from a GerritSourceContext message. Also converts values to other types if specified. * @function toObject - * @memberof grafeas.v1.Hash + * @memberof grafeas.v1.GerritSourceContext * @static - * @param {grafeas.v1.Hash} message Hash + * @param {grafeas.v1.GerritSourceContext} message GerritSourceContext * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Hash.toObject = function toObject(message, options) { + GerritSourceContext.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.type = ""; - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } + object.hostUri = ""; + object.gerritProject = ""; + } + if (message.hostUri != null && message.hasOwnProperty("hostUri")) + object.hostUri = message.hostUri; + if (message.gerritProject != null && message.hasOwnProperty("gerritProject")) + object.gerritProject = message.gerritProject; + if (message.revisionId != null && message.hasOwnProperty("revisionId")) { + object.revisionId = message.revisionId; + if (options.oneofs) + object.revision = "revisionId"; + } + if (message.aliasContext != null && message.hasOwnProperty("aliasContext")) { + object.aliasContext = $root.grafeas.v1.AliasContext.toObject(message.aliasContext, options); + if (options.oneofs) + object.revision = "aliasContext"; } - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.value != null && message.hasOwnProperty("value")) - object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; return object; }; /** - * Converts this Hash to JSON. + * Converts this GerritSourceContext to JSON. * @function toJSON - * @memberof grafeas.v1.Hash + * @memberof grafeas.v1.GerritSourceContext * @instance * @returns {Object.} JSON object */ - Hash.prototype.toJSON = function toJSON() { + GerritSourceContext.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Hash; + return GerritSourceContext; })(); - v1.Command = (function() { + v1.GitSourceContext = (function() { /** - * Properties of a Command. + * Properties of a GitSourceContext. * @memberof grafeas.v1 - * @interface ICommand - * @property {string|null} [name] Command name - * @property {Array.|null} [env] Command env - * @property {Array.|null} [args] Command args - * @property {string|null} [dir] Command dir - * @property {string|null} [id] Command id - * @property {Array.|null} [waitFor] Command waitFor + * @interface IGitSourceContext + * @property {string|null} [url] GitSourceContext url + * @property {string|null} [revisionId] GitSourceContext revisionId */ /** - * Constructs a new Command. + * Constructs a new GitSourceContext. * @memberof grafeas.v1 - * @classdesc Represents a Command. - * @implements ICommand + * @classdesc Represents a GitSourceContext. + * @implements IGitSourceContext * @constructor - * @param {grafeas.v1.ICommand=} [properties] Properties to set + * @param {grafeas.v1.IGitSourceContext=} [properties] Properties to set */ - function Command(properties) { - this.env = []; - this.args = []; - this.waitFor = []; + function GitSourceContext(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7048,149 +13418,88 @@ } /** - * Command name. - * @member {string} name - * @memberof grafeas.v1.Command - * @instance - */ - Command.prototype.name = ""; - - /** - * Command env. - * @member {Array.} env - * @memberof grafeas.v1.Command - * @instance - */ - Command.prototype.env = $util.emptyArray; - - /** - * Command args. - * @member {Array.} args - * @memberof grafeas.v1.Command - * @instance - */ - Command.prototype.args = $util.emptyArray; - - /** - * Command dir. - * @member {string} dir - * @memberof grafeas.v1.Command - * @instance - */ - Command.prototype.dir = ""; - - /** - * Command id. - * @member {string} id - * @memberof grafeas.v1.Command + * GitSourceContext url. + * @member {string} url + * @memberof grafeas.v1.GitSourceContext * @instance */ - Command.prototype.id = ""; + GitSourceContext.prototype.url = ""; /** - * Command waitFor. - * @member {Array.} waitFor - * @memberof grafeas.v1.Command + * GitSourceContext revisionId. + * @member {string} revisionId + * @memberof grafeas.v1.GitSourceContext * @instance */ - Command.prototype.waitFor = $util.emptyArray; + GitSourceContext.prototype.revisionId = ""; /** - * Creates a new Command instance using the specified properties. + * Creates a new GitSourceContext instance using the specified properties. * @function create - * @memberof grafeas.v1.Command + * @memberof grafeas.v1.GitSourceContext * @static - * @param {grafeas.v1.ICommand=} [properties] Properties to set - * @returns {grafeas.v1.Command} Command instance + * @param {grafeas.v1.IGitSourceContext=} [properties] Properties to set + * @returns {grafeas.v1.GitSourceContext} GitSourceContext instance */ - Command.create = function create(properties) { - return new Command(properties); + GitSourceContext.create = function create(properties) { + return new GitSourceContext(properties); }; /** - * Encodes the specified Command message. Does not implicitly {@link grafeas.v1.Command.verify|verify} messages. - * @function encode - * @memberof grafeas.v1.Command - * @static - * @param {grafeas.v1.ICommand} message Command message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Command.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.env != null && message.env.length) - for (var i = 0; i < message.env.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.env[i]); - if (message.args != null && message.args.length) - for (var i = 0; i < message.args.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.args[i]); - if (message.dir != null && Object.hasOwnProperty.call(message, "dir")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.dir); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.id); - if (message.waitFor != null && message.waitFor.length) - for (var i = 0; i < message.waitFor.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.waitFor[i]); + * Encodes the specified GitSourceContext message. Does not implicitly {@link grafeas.v1.GitSourceContext.verify|verify} messages. + * @function encode + * @memberof grafeas.v1.GitSourceContext + * @static + * @param {grafeas.v1.IGitSourceContext} message GitSourceContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GitSourceContext.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); + if (message.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.revisionId); return writer; }; /** - * Encodes the specified Command message, length delimited. Does not implicitly {@link grafeas.v1.Command.verify|verify} messages. + * Encodes the specified GitSourceContext message, length delimited. Does not implicitly {@link grafeas.v1.GitSourceContext.verify|verify} messages. * @function encodeDelimited - * @memberof grafeas.v1.Command + * @memberof grafeas.v1.GitSourceContext * @static - * @param {grafeas.v1.ICommand} message Command message or plain object to encode + * @param {grafeas.v1.IGitSourceContext} message GitSourceContext message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Command.encodeDelimited = function encodeDelimited(message, writer) { + GitSourceContext.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Command message from the specified reader or buffer. + * Decodes a GitSourceContext message from the specified reader or buffer. * @function decode - * @memberof grafeas.v1.Command + * @memberof grafeas.v1.GitSourceContext * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {grafeas.v1.Command} Command + * @returns {grafeas.v1.GitSourceContext} GitSourceContext * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Command.decode = function decode(reader, length) { + GitSourceContext.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.Command(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.GitSourceContext(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.url = reader.string(); break; case 2: - if (!(message.env && message.env.length)) - message.env = []; - message.env.push(reader.string()); - break; - case 3: - if (!(message.args && message.args.length)) - message.args = []; - message.args.push(reader.string()); - break; - case 4: - message.dir = reader.string(); - break; - case 5: - message.id = reader.string(); - break; - case 6: - if (!(message.waitFor && message.waitFor.length)) - message.waitFor = []; - message.waitFor.push(reader.string()); + message.revisionId = reader.string(); break; default: reader.skipType(tag & 7); @@ -7201,189 +13510,117 @@ }; /** - * Decodes a Command message from the specified reader or buffer, length delimited. + * Decodes a GitSourceContext message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof grafeas.v1.Command + * @memberof grafeas.v1.GitSourceContext * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {grafeas.v1.Command} Command + * @returns {grafeas.v1.GitSourceContext} GitSourceContext * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Command.decodeDelimited = function decodeDelimited(reader) { + GitSourceContext.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Command message. + * Verifies a GitSourceContext message. * @function verify - * @memberof grafeas.v1.Command + * @memberof grafeas.v1.GitSourceContext * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Command.verify = function verify(message) { + GitSourceContext.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.env != null && message.hasOwnProperty("env")) { - if (!Array.isArray(message.env)) - return "env: array expected"; - for (var i = 0; i < message.env.length; ++i) - if (!$util.isString(message.env[i])) - return "env: string[] expected"; - } - if (message.args != null && message.hasOwnProperty("args")) { - if (!Array.isArray(message.args)) - return "args: array expected"; - for (var i = 0; i < message.args.length; ++i) - if (!$util.isString(message.args[i])) - return "args: string[] expected"; - } - if (message.dir != null && message.hasOwnProperty("dir")) - if (!$util.isString(message.dir)) - return "dir: string expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.waitFor != null && message.hasOwnProperty("waitFor")) { - if (!Array.isArray(message.waitFor)) - return "waitFor: array expected"; - for (var i = 0; i < message.waitFor.length; ++i) - if (!$util.isString(message.waitFor[i])) - return "waitFor: string[] expected"; - } + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + if (!$util.isString(message.revisionId)) + return "revisionId: string expected"; return null; }; /** - * Creates a Command message from a plain object. Also converts values to their respective internal types. + * Creates a GitSourceContext message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof grafeas.v1.Command + * @memberof grafeas.v1.GitSourceContext * @static * @param {Object.} object Plain object - * @returns {grafeas.v1.Command} Command + * @returns {grafeas.v1.GitSourceContext} GitSourceContext */ - Command.fromObject = function fromObject(object) { - if (object instanceof $root.grafeas.v1.Command) + GitSourceContext.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.GitSourceContext) return object; - var message = new $root.grafeas.v1.Command(); - if (object.name != null) - message.name = String(object.name); - if (object.env) { - if (!Array.isArray(object.env)) - throw TypeError(".grafeas.v1.Command.env: array expected"); - message.env = []; - for (var i = 0; i < object.env.length; ++i) - message.env[i] = String(object.env[i]); - } - if (object.args) { - if (!Array.isArray(object.args)) - throw TypeError(".grafeas.v1.Command.args: array expected"); - message.args = []; - for (var i = 0; i < object.args.length; ++i) - message.args[i] = String(object.args[i]); - } - if (object.dir != null) - message.dir = String(object.dir); - if (object.id != null) - message.id = String(object.id); - if (object.waitFor) { - if (!Array.isArray(object.waitFor)) - throw TypeError(".grafeas.v1.Command.waitFor: array expected"); - message.waitFor = []; - for (var i = 0; i < object.waitFor.length; ++i) - message.waitFor[i] = String(object.waitFor[i]); - } + var message = new $root.grafeas.v1.GitSourceContext(); + if (object.url != null) + message.url = String(object.url); + if (object.revisionId != null) + message.revisionId = String(object.revisionId); return message; }; /** - * Creates a plain object from a Command message. Also converts values to other types if specified. + * Creates a plain object from a GitSourceContext message. Also converts values to other types if specified. * @function toObject - * @memberof grafeas.v1.Command + * @memberof grafeas.v1.GitSourceContext * @static - * @param {grafeas.v1.Command} message Command + * @param {grafeas.v1.GitSourceContext} message GitSourceContext * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Command.toObject = function toObject(message, options) { + GitSourceContext.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.env = []; - object.args = []; - object.waitFor = []; - } if (options.defaults) { - object.name = ""; - object.dir = ""; - object.id = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.env && message.env.length) { - object.env = []; - for (var j = 0; j < message.env.length; ++j) - object.env[j] = message.env[j]; - } - if (message.args && message.args.length) { - object.args = []; - for (var j = 0; j < message.args.length; ++j) - object.args[j] = message.args[j]; - } - if (message.dir != null && message.hasOwnProperty("dir")) - object.dir = message.dir; - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.waitFor && message.waitFor.length) { - object.waitFor = []; - for (var j = 0; j < message.waitFor.length; ++j) - object.waitFor[j] = message.waitFor[j]; + object.url = ""; + object.revisionId = ""; } + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + object.revisionId = message.revisionId; return object; }; /** - * Converts this Command to JSON. + * Converts this GitSourceContext to JSON. * @function toJSON - * @memberof grafeas.v1.Command + * @memberof grafeas.v1.GitSourceContext * @instance * @returns {Object.} JSON object */ - Command.prototype.toJSON = function toJSON() { + GitSourceContext.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Command; + return GitSourceContext; })(); - v1.Artifact = (function() { + v1.RepoId = (function() { /** - * Properties of an Artifact. + * Properties of a RepoId. * @memberof grafeas.v1 - * @interface IArtifact - * @property {string|null} [checksum] Artifact checksum - * @property {string|null} [id] Artifact id - * @property {Array.|null} [names] Artifact names + * @interface IRepoId + * @property {grafeas.v1.IProjectRepoId|null} [projectRepoId] RepoId projectRepoId + * @property {string|null} [uid] RepoId uid */ /** - * Constructs a new Artifact. + * Constructs a new RepoId. * @memberof grafeas.v1 - * @classdesc Represents an Artifact. - * @implements IArtifact + * @classdesc Represents a RepoId. + * @implements IRepoId * @constructor - * @param {grafeas.v1.IArtifact=} [properties] Properties to set + * @param {grafeas.v1.IRepoId=} [properties] Properties to set */ - function Artifact(properties) { - this.names = []; + function RepoId(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7391,104 +13628,102 @@ } /** - * Artifact checksum. - * @member {string} checksum - * @memberof grafeas.v1.Artifact + * RepoId projectRepoId. + * @member {grafeas.v1.IProjectRepoId|null|undefined} projectRepoId + * @memberof grafeas.v1.RepoId * @instance */ - Artifact.prototype.checksum = ""; + RepoId.prototype.projectRepoId = null; /** - * Artifact id. - * @member {string} id - * @memberof grafeas.v1.Artifact + * RepoId uid. + * @member {string|null|undefined} uid + * @memberof grafeas.v1.RepoId * @instance */ - Artifact.prototype.id = ""; + RepoId.prototype.uid = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Artifact names. - * @member {Array.} names - * @memberof grafeas.v1.Artifact + * RepoId id. + * @member {"projectRepoId"|"uid"|undefined} id + * @memberof grafeas.v1.RepoId * @instance */ - Artifact.prototype.names = $util.emptyArray; + Object.defineProperty(RepoId.prototype, "id", { + get: $util.oneOfGetter($oneOfFields = ["projectRepoId", "uid"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new Artifact instance using the specified properties. + * Creates a new RepoId instance using the specified properties. * @function create - * @memberof grafeas.v1.Artifact + * @memberof grafeas.v1.RepoId * @static - * @param {grafeas.v1.IArtifact=} [properties] Properties to set - * @returns {grafeas.v1.Artifact} Artifact instance + * @param {grafeas.v1.IRepoId=} [properties] Properties to set + * @returns {grafeas.v1.RepoId} RepoId instance */ - Artifact.create = function create(properties) { - return new Artifact(properties); + RepoId.create = function create(properties) { + return new RepoId(properties); }; /** - * Encodes the specified Artifact message. Does not implicitly {@link grafeas.v1.Artifact.verify|verify} messages. + * Encodes the specified RepoId message. Does not implicitly {@link grafeas.v1.RepoId.verify|verify} messages. * @function encode - * @memberof grafeas.v1.Artifact + * @memberof grafeas.v1.RepoId * @static - * @param {grafeas.v1.IArtifact} message Artifact message or plain object to encode + * @param {grafeas.v1.IRepoId} message RepoId message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Artifact.encode = function encode(message, writer) { + RepoId.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.checksum != null && Object.hasOwnProperty.call(message, "checksum")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.checksum); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.id); - if (message.names != null && message.names.length) - for (var i = 0; i < message.names.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.names[i]); + if (message.projectRepoId != null && Object.hasOwnProperty.call(message, "projectRepoId")) + $root.grafeas.v1.ProjectRepoId.encode(message.projectRepoId, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); return writer; }; /** - * Encodes the specified Artifact message, length delimited. Does not implicitly {@link grafeas.v1.Artifact.verify|verify} messages. + * Encodes the specified RepoId message, length delimited. Does not implicitly {@link grafeas.v1.RepoId.verify|verify} messages. * @function encodeDelimited - * @memberof grafeas.v1.Artifact + * @memberof grafeas.v1.RepoId * @static - * @param {grafeas.v1.IArtifact} message Artifact message or plain object to encode + * @param {grafeas.v1.IRepoId} message RepoId message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Artifact.encodeDelimited = function encodeDelimited(message, writer) { + RepoId.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Artifact message from the specified reader or buffer. + * Decodes a RepoId message from the specified reader or buffer. * @function decode - * @memberof grafeas.v1.Artifact + * @memberof grafeas.v1.RepoId * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {grafeas.v1.Artifact} Artifact + * @returns {grafeas.v1.RepoId} RepoId * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Artifact.decode = function decode(reader, length) { + RepoId.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.Artifact(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.RepoId(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.checksum = reader.string(); + message.projectRepoId = $root.grafeas.v1.ProjectRepoId.decode(reader, reader.uint32()); break; case 2: - message.id = reader.string(); - break; - case 3: - if (!(message.names && message.names.length)) - message.names = []; - message.names.push(reader.string()); + message.uid = reader.string(); break; default: reader.skipType(tag & 7); @@ -7499,141 +13734,132 @@ }; /** - * Decodes an Artifact message from the specified reader or buffer, length delimited. + * Decodes a RepoId message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof grafeas.v1.Artifact + * @memberof grafeas.v1.RepoId * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {grafeas.v1.Artifact} Artifact + * @returns {grafeas.v1.RepoId} RepoId * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Artifact.decodeDelimited = function decodeDelimited(reader) { + RepoId.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Artifact message. + * Verifies a RepoId message. * @function verify - * @memberof grafeas.v1.Artifact + * @memberof grafeas.v1.RepoId * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Artifact.verify = function verify(message) { + RepoId.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.checksum != null && message.hasOwnProperty("checksum")) - if (!$util.isString(message.checksum)) - return "checksum: string expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.names != null && message.hasOwnProperty("names")) { - if (!Array.isArray(message.names)) - return "names: array expected"; - for (var i = 0; i < message.names.length; ++i) - if (!$util.isString(message.names[i])) - return "names: string[] expected"; + var properties = {}; + if (message.projectRepoId != null && message.hasOwnProperty("projectRepoId")) { + properties.id = 1; + { + var error = $root.grafeas.v1.ProjectRepoId.verify(message.projectRepoId); + if (error) + return "projectRepoId." + error; + } + } + if (message.uid != null && message.hasOwnProperty("uid")) { + if (properties.id === 1) + return "id: multiple values"; + properties.id = 1; + if (!$util.isString(message.uid)) + return "uid: string expected"; } return null; }; /** - * Creates an Artifact message from a plain object. Also converts values to their respective internal types. + * Creates a RepoId message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof grafeas.v1.Artifact + * @memberof grafeas.v1.RepoId * @static * @param {Object.} object Plain object - * @returns {grafeas.v1.Artifact} Artifact + * @returns {grafeas.v1.RepoId} RepoId */ - Artifact.fromObject = function fromObject(object) { - if (object instanceof $root.grafeas.v1.Artifact) + RepoId.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.RepoId) return object; - var message = new $root.grafeas.v1.Artifact(); - if (object.checksum != null) - message.checksum = String(object.checksum); - if (object.id != null) - message.id = String(object.id); - if (object.names) { - if (!Array.isArray(object.names)) - throw TypeError(".grafeas.v1.Artifact.names: array expected"); - message.names = []; - for (var i = 0; i < object.names.length; ++i) - message.names[i] = String(object.names[i]); + var message = new $root.grafeas.v1.RepoId(); + if (object.projectRepoId != null) { + if (typeof object.projectRepoId !== "object") + throw TypeError(".grafeas.v1.RepoId.projectRepoId: object expected"); + message.projectRepoId = $root.grafeas.v1.ProjectRepoId.fromObject(object.projectRepoId); } + if (object.uid != null) + message.uid = String(object.uid); return message; }; /** - * Creates a plain object from an Artifact message. Also converts values to other types if specified. + * Creates a plain object from a RepoId message. Also converts values to other types if specified. * @function toObject - * @memberof grafeas.v1.Artifact + * @memberof grafeas.v1.RepoId * @static - * @param {grafeas.v1.Artifact} message Artifact + * @param {grafeas.v1.RepoId} message RepoId * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Artifact.toObject = function toObject(message, options) { + RepoId.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.names = []; - if (options.defaults) { - object.checksum = ""; - object.id = ""; + if (message.projectRepoId != null && message.hasOwnProperty("projectRepoId")) { + object.projectRepoId = $root.grafeas.v1.ProjectRepoId.toObject(message.projectRepoId, options); + if (options.oneofs) + object.id = "projectRepoId"; } - if (message.checksum != null && message.hasOwnProperty("checksum")) - object.checksum = message.checksum; - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.names && message.names.length) { - object.names = []; - for (var j = 0; j < message.names.length; ++j) - object.names[j] = message.names[j]; + if (message.uid != null && message.hasOwnProperty("uid")) { + object.uid = message.uid; + if (options.oneofs) + object.id = "uid"; } return object; }; /** - * Converts this Artifact to JSON. + * Converts this RepoId to JSON. * @function toJSON - * @memberof grafeas.v1.Artifact + * @memberof grafeas.v1.RepoId * @instance * @returns {Object.} JSON object */ - Artifact.prototype.toJSON = function toJSON() { + RepoId.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Artifact; + return RepoId; })(); - v1.SourceContext = (function() { + v1.ProjectRepoId = (function() { /** - * Properties of a SourceContext. + * Properties of a ProjectRepoId. * @memberof grafeas.v1 - * @interface ISourceContext - * @property {grafeas.v1.ICloudRepoSourceContext|null} [cloudRepo] SourceContext cloudRepo - * @property {grafeas.v1.IGerritSourceContext|null} [gerrit] SourceContext gerrit - * @property {grafeas.v1.IGitSourceContext|null} [git] SourceContext git - * @property {Object.|null} [labels] SourceContext labels + * @interface IProjectRepoId + * @property {string|null} [projectId] ProjectRepoId projectId + * @property {string|null} [repoName] ProjectRepoId repoName */ /** - * Constructs a new SourceContext. + * Constructs a new ProjectRepoId. * @memberof grafeas.v1 - * @classdesc Represents a SourceContext. - * @implements ISourceContext + * @classdesc Represents a ProjectRepoId. + * @implements IProjectRepoId * @constructor - * @param {grafeas.v1.ISourceContext=} [properties] Properties to set + * @param {grafeas.v1.IProjectRepoId=} [properties] Properties to set */ - function SourceContext(properties) { - this.labels = {}; + function ProjectRepoId(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7641,148 +13867,88 @@ } /** - * SourceContext cloudRepo. - * @member {grafeas.v1.ICloudRepoSourceContext|null|undefined} cloudRepo - * @memberof grafeas.v1.SourceContext - * @instance - */ - SourceContext.prototype.cloudRepo = null; - - /** - * SourceContext gerrit. - * @member {grafeas.v1.IGerritSourceContext|null|undefined} gerrit - * @memberof grafeas.v1.SourceContext - * @instance - */ - SourceContext.prototype.gerrit = null; - - /** - * SourceContext git. - * @member {grafeas.v1.IGitSourceContext|null|undefined} git - * @memberof grafeas.v1.SourceContext - * @instance - */ - SourceContext.prototype.git = null; - - /** - * SourceContext labels. - * @member {Object.} labels - * @memberof grafeas.v1.SourceContext + * ProjectRepoId projectId. + * @member {string} projectId + * @memberof grafeas.v1.ProjectRepoId * @instance */ - SourceContext.prototype.labels = $util.emptyObject; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ProjectRepoId.prototype.projectId = ""; /** - * SourceContext context. - * @member {"cloudRepo"|"gerrit"|"git"|undefined} context - * @memberof grafeas.v1.SourceContext + * ProjectRepoId repoName. + * @member {string} repoName + * @memberof grafeas.v1.ProjectRepoId * @instance */ - Object.defineProperty(SourceContext.prototype, "context", { - get: $util.oneOfGetter($oneOfFields = ["cloudRepo", "gerrit", "git"]), - set: $util.oneOfSetter($oneOfFields) - }); + ProjectRepoId.prototype.repoName = ""; /** - * Creates a new SourceContext instance using the specified properties. + * Creates a new ProjectRepoId instance using the specified properties. * @function create - * @memberof grafeas.v1.SourceContext + * @memberof grafeas.v1.ProjectRepoId * @static - * @param {grafeas.v1.ISourceContext=} [properties] Properties to set - * @returns {grafeas.v1.SourceContext} SourceContext instance + * @param {grafeas.v1.IProjectRepoId=} [properties] Properties to set + * @returns {grafeas.v1.ProjectRepoId} ProjectRepoId instance */ - SourceContext.create = function create(properties) { - return new SourceContext(properties); + ProjectRepoId.create = function create(properties) { + return new ProjectRepoId(properties); }; /** - * Encodes the specified SourceContext message. Does not implicitly {@link grafeas.v1.SourceContext.verify|verify} messages. + * Encodes the specified ProjectRepoId message. Does not implicitly {@link grafeas.v1.ProjectRepoId.verify|verify} messages. * @function encode - * @memberof grafeas.v1.SourceContext + * @memberof grafeas.v1.ProjectRepoId * @static - * @param {grafeas.v1.ISourceContext} message SourceContext message or plain object to encode + * @param {grafeas.v1.IProjectRepoId} message ProjectRepoId message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SourceContext.encode = function encode(message, writer) { + ProjectRepoId.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.cloudRepo != null && Object.hasOwnProperty.call(message, "cloudRepo")) - $root.grafeas.v1.CloudRepoSourceContext.encode(message.cloudRepo, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.gerrit != null && Object.hasOwnProperty.call(message, "gerrit")) - $root.grafeas.v1.GerritSourceContext.encode(message.gerrit, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.git != null && Object.hasOwnProperty.call(message, "git")) - $root.grafeas.v1.GitSourceContext.encode(message.git, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); + if (message.repoName != null && Object.hasOwnProperty.call(message, "repoName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.repoName); return writer; }; /** - * Encodes the specified SourceContext message, length delimited. Does not implicitly {@link grafeas.v1.SourceContext.verify|verify} messages. + * Encodes the specified ProjectRepoId message, length delimited. Does not implicitly {@link grafeas.v1.ProjectRepoId.verify|verify} messages. * @function encodeDelimited - * @memberof grafeas.v1.SourceContext + * @memberof grafeas.v1.ProjectRepoId * @static - * @param {grafeas.v1.ISourceContext} message SourceContext message or plain object to encode + * @param {grafeas.v1.IProjectRepoId} message ProjectRepoId message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SourceContext.encodeDelimited = function encodeDelimited(message, writer) { + ProjectRepoId.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SourceContext message from the specified reader or buffer. + * Decodes a ProjectRepoId message from the specified reader or buffer. * @function decode - * @memberof grafeas.v1.SourceContext + * @memberof grafeas.v1.ProjectRepoId * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {grafeas.v1.SourceContext} SourceContext + * @returns {grafeas.v1.ProjectRepoId} ProjectRepoId * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SourceContext.decode = function decode(reader, length) { + ProjectRepoId.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.SourceContext(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.ProjectRepoId(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.cloudRepo = $root.grafeas.v1.CloudRepoSourceContext.decode(reader, reader.uint32()); + message.projectId = reader.string(); break; case 2: - message.gerrit = $root.grafeas.v1.GerritSourceContext.decode(reader, reader.uint32()); - break; - case 3: - message.git = $root.grafeas.v1.GitSourceContext.decode(reader, reader.uint32()); - break; - case 4: - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; + message.repoName = reader.string(); break; default: reader.skipType(tag & 7); @@ -7793,181 +13959,123 @@ }; /** - * Decodes a SourceContext message from the specified reader or buffer, length delimited. + * Decodes a ProjectRepoId message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof grafeas.v1.SourceContext + * @memberof grafeas.v1.ProjectRepoId * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {grafeas.v1.SourceContext} SourceContext + * @returns {grafeas.v1.ProjectRepoId} ProjectRepoId * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SourceContext.decodeDelimited = function decodeDelimited(reader) { + ProjectRepoId.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SourceContext message. + * Verifies a ProjectRepoId message. * @function verify - * @memberof grafeas.v1.SourceContext + * @memberof grafeas.v1.ProjectRepoId * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SourceContext.verify = function verify(message) { + ProjectRepoId.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.cloudRepo != null && message.hasOwnProperty("cloudRepo")) { - properties.context = 1; - { - var error = $root.grafeas.v1.CloudRepoSourceContext.verify(message.cloudRepo); - if (error) - return "cloudRepo." + error; - } - } - if (message.gerrit != null && message.hasOwnProperty("gerrit")) { - if (properties.context === 1) - return "context: multiple values"; - properties.context = 1; - { - var error = $root.grafeas.v1.GerritSourceContext.verify(message.gerrit); - if (error) - return "gerrit." + error; - } - } - if (message.git != null && message.hasOwnProperty("git")) { - if (properties.context === 1) - return "context: multiple values"; - properties.context = 1; - { - var error = $root.grafeas.v1.GitSourceContext.verify(message.git); - if (error) - return "git." + error; - } - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } + if (message.projectId != null && message.hasOwnProperty("projectId")) + if (!$util.isString(message.projectId)) + return "projectId: string expected"; + if (message.repoName != null && message.hasOwnProperty("repoName")) + if (!$util.isString(message.repoName)) + return "repoName: string expected"; return null; }; /** - * Creates a SourceContext message from a plain object. Also converts values to their respective internal types. + * Creates a ProjectRepoId message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof grafeas.v1.SourceContext + * @memberof grafeas.v1.ProjectRepoId * @static * @param {Object.} object Plain object - * @returns {grafeas.v1.SourceContext} SourceContext + * @returns {grafeas.v1.ProjectRepoId} ProjectRepoId */ - SourceContext.fromObject = function fromObject(object) { - if (object instanceof $root.grafeas.v1.SourceContext) + ProjectRepoId.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.ProjectRepoId) return object; - var message = new $root.grafeas.v1.SourceContext(); - if (object.cloudRepo != null) { - if (typeof object.cloudRepo !== "object") - throw TypeError(".grafeas.v1.SourceContext.cloudRepo: object expected"); - message.cloudRepo = $root.grafeas.v1.CloudRepoSourceContext.fromObject(object.cloudRepo); - } - if (object.gerrit != null) { - if (typeof object.gerrit !== "object") - throw TypeError(".grafeas.v1.SourceContext.gerrit: object expected"); - message.gerrit = $root.grafeas.v1.GerritSourceContext.fromObject(object.gerrit); - } - if (object.git != null) { - if (typeof object.git !== "object") - throw TypeError(".grafeas.v1.SourceContext.git: object expected"); - message.git = $root.grafeas.v1.GitSourceContext.fromObject(object.git); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".grafeas.v1.SourceContext.labels: object expected"); - message.labels = {}; - for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) - message.labels[keys[i]] = String(object.labels[keys[i]]); - } + var message = new $root.grafeas.v1.ProjectRepoId(); + if (object.projectId != null) + message.projectId = String(object.projectId); + if (object.repoName != null) + message.repoName = String(object.repoName); return message; }; /** - * Creates a plain object from a SourceContext message. Also converts values to other types if specified. + * Creates a plain object from a ProjectRepoId message. Also converts values to other types if specified. * @function toObject - * @memberof grafeas.v1.SourceContext + * @memberof grafeas.v1.ProjectRepoId * @static - * @param {grafeas.v1.SourceContext} message SourceContext + * @param {grafeas.v1.ProjectRepoId} message ProjectRepoId * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SourceContext.toObject = function toObject(message, options) { + ProjectRepoId.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (message.cloudRepo != null && message.hasOwnProperty("cloudRepo")) { - object.cloudRepo = $root.grafeas.v1.CloudRepoSourceContext.toObject(message.cloudRepo, options); - if (options.oneofs) - object.context = "cloudRepo"; - } - if (message.gerrit != null && message.hasOwnProperty("gerrit")) { - object.gerrit = $root.grafeas.v1.GerritSourceContext.toObject(message.gerrit, options); - if (options.oneofs) - object.context = "gerrit"; - } - if (message.git != null && message.hasOwnProperty("git")) { - object.git = $root.grafeas.v1.GitSourceContext.toObject(message.git, options); - if (options.oneofs) - object.context = "git"; - } - var keys2; - if (message.labels && (keys2 = Object.keys(message.labels)).length) { - object.labels = {}; - for (var j = 0; j < keys2.length; ++j) - object.labels[keys2[j]] = message.labels[keys2[j]]; + if (options.defaults) { + object.projectId = ""; + object.repoName = ""; } + if (message.projectId != null && message.hasOwnProperty("projectId")) + object.projectId = message.projectId; + if (message.repoName != null && message.hasOwnProperty("repoName")) + object.repoName = message.repoName; return object; }; /** - * Converts this SourceContext to JSON. + * Converts this ProjectRepoId to JSON. * @function toJSON - * @memberof grafeas.v1.SourceContext + * @memberof grafeas.v1.ProjectRepoId * @instance * @returns {Object.} JSON object */ - SourceContext.prototype.toJSON = function toJSON() { + ProjectRepoId.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SourceContext; + return ProjectRepoId; })(); - v1.AliasContext = (function() { + v1.ComplianceNote = (function() { /** - * Properties of an AliasContext. + * Properties of a ComplianceNote. * @memberof grafeas.v1 - * @interface IAliasContext - * @property {grafeas.v1.AliasContext.Kind|null} [kind] AliasContext kind - * @property {string|null} [name] AliasContext name + * @interface IComplianceNote + * @property {string|null} [title] ComplianceNote title + * @property {string|null} [description] ComplianceNote description + * @property {Array.|null} [version] ComplianceNote version + * @property {string|null} [rationale] ComplianceNote rationale + * @property {string|null} [remediation] ComplianceNote remediation + * @property {grafeas.v1.ComplianceNote.ICisBenchmark|null} [cisBenchmark] ComplianceNote cisBenchmark + * @property {Uint8Array|null} [scanInstructions] ComplianceNote scanInstructions */ /** - * Constructs a new AliasContext. + * Constructs a new ComplianceNote. * @memberof grafeas.v1 - * @classdesc Represents an AliasContext. - * @implements IAliasContext + * @classdesc Represents a ComplianceNote. + * @implements IComplianceNote * @constructor - * @param {grafeas.v1.IAliasContext=} [properties] Properties to set + * @param {grafeas.v1.IComplianceNote=} [properties] Properties to set */ - function AliasContext(properties) { + function ComplianceNote(properties) { + this.version = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7975,88 +14083,170 @@ } /** - * AliasContext kind. - * @member {grafeas.v1.AliasContext.Kind} kind - * @memberof grafeas.v1.AliasContext + * ComplianceNote title. + * @member {string} title + * @memberof grafeas.v1.ComplianceNote * @instance */ - AliasContext.prototype.kind = 0; + ComplianceNote.prototype.title = ""; /** - * AliasContext name. - * @member {string} name - * @memberof grafeas.v1.AliasContext + * ComplianceNote description. + * @member {string} description + * @memberof grafeas.v1.ComplianceNote * @instance */ - AliasContext.prototype.name = ""; + ComplianceNote.prototype.description = ""; /** - * Creates a new AliasContext instance using the specified properties. + * ComplianceNote version. + * @member {Array.} version + * @memberof grafeas.v1.ComplianceNote + * @instance + */ + ComplianceNote.prototype.version = $util.emptyArray; + + /** + * ComplianceNote rationale. + * @member {string} rationale + * @memberof grafeas.v1.ComplianceNote + * @instance + */ + ComplianceNote.prototype.rationale = ""; + + /** + * ComplianceNote remediation. + * @member {string} remediation + * @memberof grafeas.v1.ComplianceNote + * @instance + */ + ComplianceNote.prototype.remediation = ""; + + /** + * ComplianceNote cisBenchmark. + * @member {grafeas.v1.ComplianceNote.ICisBenchmark|null|undefined} cisBenchmark + * @memberof grafeas.v1.ComplianceNote + * @instance + */ + ComplianceNote.prototype.cisBenchmark = null; + + /** + * ComplianceNote scanInstructions. + * @member {Uint8Array} scanInstructions + * @memberof grafeas.v1.ComplianceNote + * @instance + */ + ComplianceNote.prototype.scanInstructions = $util.newBuffer([]); + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ComplianceNote complianceType. + * @member {"cisBenchmark"|undefined} complianceType + * @memberof grafeas.v1.ComplianceNote + * @instance + */ + Object.defineProperty(ComplianceNote.prototype, "complianceType", { + get: $util.oneOfGetter($oneOfFields = ["cisBenchmark"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ComplianceNote instance using the specified properties. * @function create - * @memberof grafeas.v1.AliasContext + * @memberof grafeas.v1.ComplianceNote * @static - * @param {grafeas.v1.IAliasContext=} [properties] Properties to set - * @returns {grafeas.v1.AliasContext} AliasContext instance + * @param {grafeas.v1.IComplianceNote=} [properties] Properties to set + * @returns {grafeas.v1.ComplianceNote} ComplianceNote instance */ - AliasContext.create = function create(properties) { - return new AliasContext(properties); + ComplianceNote.create = function create(properties) { + return new ComplianceNote(properties); }; /** - * Encodes the specified AliasContext message. Does not implicitly {@link grafeas.v1.AliasContext.verify|verify} messages. + * Encodes the specified ComplianceNote message. Does not implicitly {@link grafeas.v1.ComplianceNote.verify|verify} messages. * @function encode - * @memberof grafeas.v1.AliasContext + * @memberof grafeas.v1.ComplianceNote * @static - * @param {grafeas.v1.IAliasContext} message AliasContext message or plain object to encode + * @param {grafeas.v1.IComplianceNote} message ComplianceNote message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AliasContext.encode = function encode(message, writer) { + ComplianceNote.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.kind); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.version != null && message.version.length) + for (var i = 0; i < message.version.length; ++i) + $root.grafeas.v1.ComplianceVersion.encode(message.version[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.rationale != null && Object.hasOwnProperty.call(message, "rationale")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.rationale); + if (message.remediation != null && Object.hasOwnProperty.call(message, "remediation")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.remediation); + if (message.cisBenchmark != null && Object.hasOwnProperty.call(message, "cisBenchmark")) + $root.grafeas.v1.ComplianceNote.CisBenchmark.encode(message.cisBenchmark, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.scanInstructions != null && Object.hasOwnProperty.call(message, "scanInstructions")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.scanInstructions); return writer; }; /** - * Encodes the specified AliasContext message, length delimited. Does not implicitly {@link grafeas.v1.AliasContext.verify|verify} messages. + * Encodes the specified ComplianceNote message, length delimited. Does not implicitly {@link grafeas.v1.ComplianceNote.verify|verify} messages. * @function encodeDelimited - * @memberof grafeas.v1.AliasContext + * @memberof grafeas.v1.ComplianceNote * @static - * @param {grafeas.v1.IAliasContext} message AliasContext message or plain object to encode + * @param {grafeas.v1.IComplianceNote} message ComplianceNote message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - AliasContext.encodeDelimited = function encodeDelimited(message, writer) { + ComplianceNote.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an AliasContext message from the specified reader or buffer. + * Decodes a ComplianceNote message from the specified reader or buffer. * @function decode - * @memberof grafeas.v1.AliasContext + * @memberof grafeas.v1.ComplianceNote * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {grafeas.v1.AliasContext} AliasContext + * @returns {grafeas.v1.ComplianceNote} ComplianceNote * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AliasContext.decode = function decode(reader, length) { + ComplianceNote.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.AliasContext(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.ComplianceNote(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.kind = reader.int32(); + message.title = reader.string(); break; case 2: - message.name = reader.string(); + message.description = reader.string(); + break; + case 3: + if (!(message.version && message.version.length)) + message.version = []; + message.version.push($root.grafeas.v1.ComplianceVersion.decode(reader, reader.uint32())); + break; + case 4: + message.rationale = reader.string(); + break; + case 5: + message.remediation = reader.string(); + break; + case 6: + message.cisBenchmark = $root.grafeas.v1.ComplianceNote.CisBenchmark.decode(reader, reader.uint32()); + break; + case 7: + message.scanInstructions = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -8067,159 +14257,438 @@ }; /** - * Decodes an AliasContext message from the specified reader or buffer, length delimited. + * Decodes a ComplianceNote message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof grafeas.v1.AliasContext + * @memberof grafeas.v1.ComplianceNote * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {grafeas.v1.AliasContext} AliasContext + * @returns {grafeas.v1.ComplianceNote} ComplianceNote * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - AliasContext.decodeDelimited = function decodeDelimited(reader) { + ComplianceNote.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an AliasContext message. + * Verifies a ComplianceNote message. * @function verify - * @memberof grafeas.v1.AliasContext + * @memberof grafeas.v1.ComplianceNote * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - AliasContext.verify = function verify(message) { + ComplianceNote.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - switch (message.kind) { - default: - return "kind: enum value expected"; + var properties = {}; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.version != null && message.hasOwnProperty("version")) { + if (!Array.isArray(message.version)) + return "version: array expected"; + for (var i = 0; i < message.version.length; ++i) { + var error = $root.grafeas.v1.ComplianceVersion.verify(message.version[i]); + if (error) + return "version." + error; + } + } + if (message.rationale != null && message.hasOwnProperty("rationale")) + if (!$util.isString(message.rationale)) + return "rationale: string expected"; + if (message.remediation != null && message.hasOwnProperty("remediation")) + if (!$util.isString(message.remediation)) + return "remediation: string expected"; + if (message.cisBenchmark != null && message.hasOwnProperty("cisBenchmark")) { + properties.complianceType = 1; + { + var error = $root.grafeas.v1.ComplianceNote.CisBenchmark.verify(message.cisBenchmark); + if (error) + return "cisBenchmark." + error; + } + } + if (message.scanInstructions != null && message.hasOwnProperty("scanInstructions")) + if (!(message.scanInstructions && typeof message.scanInstructions.length === "number" || $util.isString(message.scanInstructions))) + return "scanInstructions: buffer expected"; + return null; + }; + + /** + * Creates a ComplianceNote message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof grafeas.v1.ComplianceNote + * @static + * @param {Object.} object Plain object + * @returns {grafeas.v1.ComplianceNote} ComplianceNote + */ + ComplianceNote.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.ComplianceNote) + return object; + var message = new $root.grafeas.v1.ComplianceNote(); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.version) { + if (!Array.isArray(object.version)) + throw TypeError(".grafeas.v1.ComplianceNote.version: array expected"); + message.version = []; + for (var i = 0; i < object.version.length; ++i) { + if (typeof object.version[i] !== "object") + throw TypeError(".grafeas.v1.ComplianceNote.version: object expected"); + message.version[i] = $root.grafeas.v1.ComplianceVersion.fromObject(object.version[i]); + } + } + if (object.rationale != null) + message.rationale = String(object.rationale); + if (object.remediation != null) + message.remediation = String(object.remediation); + if (object.cisBenchmark != null) { + if (typeof object.cisBenchmark !== "object") + throw TypeError(".grafeas.v1.ComplianceNote.cisBenchmark: object expected"); + message.cisBenchmark = $root.grafeas.v1.ComplianceNote.CisBenchmark.fromObject(object.cisBenchmark); + } + if (object.scanInstructions != null) + if (typeof object.scanInstructions === "string") + $util.base64.decode(object.scanInstructions, message.scanInstructions = $util.newBuffer($util.base64.length(object.scanInstructions)), 0); + else if (object.scanInstructions.length) + message.scanInstructions = object.scanInstructions; + return message; + }; + + /** + * Creates a plain object from a ComplianceNote message. Also converts values to other types if specified. + * @function toObject + * @memberof grafeas.v1.ComplianceNote + * @static + * @param {grafeas.v1.ComplianceNote} message ComplianceNote + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ComplianceNote.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.version = []; + if (options.defaults) { + object.title = ""; + object.description = ""; + object.rationale = ""; + object.remediation = ""; + if (options.bytes === String) + object.scanInstructions = ""; + else { + object.scanInstructions = []; + if (options.bytes !== Array) + object.scanInstructions = $util.newBuffer(object.scanInstructions); + } + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.version && message.version.length) { + object.version = []; + for (var j = 0; j < message.version.length; ++j) + object.version[j] = $root.grafeas.v1.ComplianceVersion.toObject(message.version[j], options); + } + if (message.rationale != null && message.hasOwnProperty("rationale")) + object.rationale = message.rationale; + if (message.remediation != null && message.hasOwnProperty("remediation")) + object.remediation = message.remediation; + if (message.cisBenchmark != null && message.hasOwnProperty("cisBenchmark")) { + object.cisBenchmark = $root.grafeas.v1.ComplianceNote.CisBenchmark.toObject(message.cisBenchmark, options); + if (options.oneofs) + object.complianceType = "cisBenchmark"; + } + if (message.scanInstructions != null && message.hasOwnProperty("scanInstructions")) + object.scanInstructions = options.bytes === String ? $util.base64.encode(message.scanInstructions, 0, message.scanInstructions.length) : options.bytes === Array ? Array.prototype.slice.call(message.scanInstructions) : message.scanInstructions; + return object; + }; + + /** + * Converts this ComplianceNote to JSON. + * @function toJSON + * @memberof grafeas.v1.ComplianceNote + * @instance + * @returns {Object.} JSON object + */ + ComplianceNote.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + ComplianceNote.CisBenchmark = (function() { + + /** + * Properties of a CisBenchmark. + * @memberof grafeas.v1.ComplianceNote + * @interface ICisBenchmark + * @property {number|null} [profileLevel] CisBenchmark profileLevel + * @property {grafeas.v1.Severity|null} [severity] CisBenchmark severity + */ + + /** + * Constructs a new CisBenchmark. + * @memberof grafeas.v1.ComplianceNote + * @classdesc Represents a CisBenchmark. + * @implements ICisBenchmark + * @constructor + * @param {grafeas.v1.ComplianceNote.ICisBenchmark=} [properties] Properties to set + */ + function CisBenchmark(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CisBenchmark profileLevel. + * @member {number} profileLevel + * @memberof grafeas.v1.ComplianceNote.CisBenchmark + * @instance + */ + CisBenchmark.prototype.profileLevel = 0; + + /** + * CisBenchmark severity. + * @member {grafeas.v1.Severity} severity + * @memberof grafeas.v1.ComplianceNote.CisBenchmark + * @instance + */ + CisBenchmark.prototype.severity = 0; + + /** + * Creates a new CisBenchmark instance using the specified properties. + * @function create + * @memberof grafeas.v1.ComplianceNote.CisBenchmark + * @static + * @param {grafeas.v1.ComplianceNote.ICisBenchmark=} [properties] Properties to set + * @returns {grafeas.v1.ComplianceNote.CisBenchmark} CisBenchmark instance + */ + CisBenchmark.create = function create(properties) { + return new CisBenchmark(properties); + }; + + /** + * Encodes the specified CisBenchmark message. Does not implicitly {@link grafeas.v1.ComplianceNote.CisBenchmark.verify|verify} messages. + * @function encode + * @memberof grafeas.v1.ComplianceNote.CisBenchmark + * @static + * @param {grafeas.v1.ComplianceNote.ICisBenchmark} message CisBenchmark message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CisBenchmark.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.profileLevel != null && Object.hasOwnProperty.call(message, "profileLevel")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.profileLevel); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.severity); + return writer; + }; + + /** + * Encodes the specified CisBenchmark message, length delimited. Does not implicitly {@link grafeas.v1.ComplianceNote.CisBenchmark.verify|verify} messages. + * @function encodeDelimited + * @memberof grafeas.v1.ComplianceNote.CisBenchmark + * @static + * @param {grafeas.v1.ComplianceNote.ICisBenchmark} message CisBenchmark message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CisBenchmark.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CisBenchmark message from the specified reader or buffer. + * @function decode + * @memberof grafeas.v1.ComplianceNote.CisBenchmark + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {grafeas.v1.ComplianceNote.CisBenchmark} CisBenchmark + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CisBenchmark.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.ComplianceNote.CisBenchmark(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.profileLevel = reader.int32(); + break; + case 2: + message.severity = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CisBenchmark message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof grafeas.v1.ComplianceNote.CisBenchmark + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {grafeas.v1.ComplianceNote.CisBenchmark} CisBenchmark + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CisBenchmark.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CisBenchmark message. + * @function verify + * @memberof grafeas.v1.ComplianceNote.CisBenchmark + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CisBenchmark.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.profileLevel != null && message.hasOwnProperty("profileLevel")) + if (!$util.isInteger(message.profileLevel)) + return "profileLevel: integer expected"; + if (message.severity != null && message.hasOwnProperty("severity")) + switch (message.severity) { + default: + return "severity: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + return null; + }; + + /** + * Creates a CisBenchmark message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof grafeas.v1.ComplianceNote.CisBenchmark + * @static + * @param {Object.} object Plain object + * @returns {grafeas.v1.ComplianceNote.CisBenchmark} CisBenchmark + */ + CisBenchmark.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.ComplianceNote.CisBenchmark) + return object; + var message = new $root.grafeas.v1.ComplianceNote.CisBenchmark(); + if (object.profileLevel != null) + message.profileLevel = object.profileLevel | 0; + switch (object.severity) { + case "SEVERITY_UNSPECIFIED": case 0: + message.severity = 0; + break; + case "MINIMAL": case 1: + message.severity = 1; + break; + case "LOW": case 2: + message.severity = 2; + break; + case "MEDIUM": + case 3: + message.severity = 3; + break; + case "HIGH": case 4: + message.severity = 4; + break; + case "CRITICAL": + case 5: + message.severity = 5; break; } - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; + return message; + }; - /** - * Creates an AliasContext message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof grafeas.v1.AliasContext - * @static - * @param {Object.} object Plain object - * @returns {grafeas.v1.AliasContext} AliasContext - */ - AliasContext.fromObject = function fromObject(object) { - if (object instanceof $root.grafeas.v1.AliasContext) + /** + * Creates a plain object from a CisBenchmark message. Also converts values to other types if specified. + * @function toObject + * @memberof grafeas.v1.ComplianceNote.CisBenchmark + * @static + * @param {grafeas.v1.ComplianceNote.CisBenchmark} message CisBenchmark + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CisBenchmark.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.profileLevel = 0; + object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; + } + if (message.profileLevel != null && message.hasOwnProperty("profileLevel")) + object.profileLevel = message.profileLevel; + if (message.severity != null && message.hasOwnProperty("severity")) + object.severity = options.enums === String ? $root.grafeas.v1.Severity[message.severity] : message.severity; return object; - var message = new $root.grafeas.v1.AliasContext(); - switch (object.kind) { - case "KIND_UNSPECIFIED": - case 0: - message.kind = 0; - break; - case "FIXED": - case 1: - message.kind = 1; - break; - case "MOVABLE": - case 2: - message.kind = 2; - break; - case "OTHER": - case 4: - message.kind = 4; - break; - } - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from an AliasContext message. Also converts values to other types if specified. - * @function toObject - * @memberof grafeas.v1.AliasContext - * @static - * @param {grafeas.v1.AliasContext} message AliasContext - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AliasContext.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.kind = options.enums === String ? "KIND_UNSPECIFIED" : 0; - object.name = ""; - } - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = options.enums === String ? $root.grafeas.v1.AliasContext.Kind[message.kind] : message.kind; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; + }; - /** - * Converts this AliasContext to JSON. - * @function toJSON - * @memberof grafeas.v1.AliasContext - * @instance - * @returns {Object.} JSON object - */ - AliasContext.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this CisBenchmark to JSON. + * @function toJSON + * @memberof grafeas.v1.ComplianceNote.CisBenchmark + * @instance + * @returns {Object.} JSON object + */ + CisBenchmark.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Kind enum. - * @name grafeas.v1.AliasContext.Kind - * @enum {number} - * @property {number} KIND_UNSPECIFIED=0 KIND_UNSPECIFIED value - * @property {number} FIXED=1 FIXED value - * @property {number} MOVABLE=2 MOVABLE value - * @property {number} OTHER=4 OTHER value - */ - AliasContext.Kind = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "KIND_UNSPECIFIED"] = 0; - values[valuesById[1] = "FIXED"] = 1; - values[valuesById[2] = "MOVABLE"] = 2; - values[valuesById[4] = "OTHER"] = 4; - return values; + return CisBenchmark; })(); - return AliasContext; + return ComplianceNote; })(); - v1.CloudRepoSourceContext = (function() { + v1.ComplianceVersion = (function() { /** - * Properties of a CloudRepoSourceContext. + * Properties of a ComplianceVersion. * @memberof grafeas.v1 - * @interface ICloudRepoSourceContext - * @property {grafeas.v1.IRepoId|null} [repoId] CloudRepoSourceContext repoId - * @property {string|null} [revisionId] CloudRepoSourceContext revisionId - * @property {grafeas.v1.IAliasContext|null} [aliasContext] CloudRepoSourceContext aliasContext + * @interface IComplianceVersion + * @property {string|null} [cpeUri] ComplianceVersion cpeUri + * @property {string|null} [version] ComplianceVersion version */ /** - * Constructs a new CloudRepoSourceContext. + * Constructs a new ComplianceVersion. * @memberof grafeas.v1 - * @classdesc Represents a CloudRepoSourceContext. - * @implements ICloudRepoSourceContext + * @classdesc Represents a ComplianceVersion. + * @implements IComplianceVersion * @constructor - * @param {grafeas.v1.ICloudRepoSourceContext=} [properties] Properties to set + * @param {grafeas.v1.IComplianceVersion=} [properties] Properties to set */ - function CloudRepoSourceContext(properties) { + function ComplianceVersion(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8227,115 +14696,88 @@ } /** - * CloudRepoSourceContext repoId. - * @member {grafeas.v1.IRepoId|null|undefined} repoId - * @memberof grafeas.v1.CloudRepoSourceContext - * @instance - */ - CloudRepoSourceContext.prototype.repoId = null; - - /** - * CloudRepoSourceContext revisionId. - * @member {string|null|undefined} revisionId - * @memberof grafeas.v1.CloudRepoSourceContext - * @instance - */ - CloudRepoSourceContext.prototype.revisionId = null; - - /** - * CloudRepoSourceContext aliasContext. - * @member {grafeas.v1.IAliasContext|null|undefined} aliasContext - * @memberof grafeas.v1.CloudRepoSourceContext + * ComplianceVersion cpeUri. + * @member {string} cpeUri + * @memberof grafeas.v1.ComplianceVersion * @instance */ - CloudRepoSourceContext.prototype.aliasContext = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ComplianceVersion.prototype.cpeUri = ""; /** - * CloudRepoSourceContext revision. - * @member {"revisionId"|"aliasContext"|undefined} revision - * @memberof grafeas.v1.CloudRepoSourceContext + * ComplianceVersion version. + * @member {string} version + * @memberof grafeas.v1.ComplianceVersion * @instance */ - Object.defineProperty(CloudRepoSourceContext.prototype, "revision", { - get: $util.oneOfGetter($oneOfFields = ["revisionId", "aliasContext"]), - set: $util.oneOfSetter($oneOfFields) - }); + ComplianceVersion.prototype.version = ""; /** - * Creates a new CloudRepoSourceContext instance using the specified properties. + * Creates a new ComplianceVersion instance using the specified properties. * @function create - * @memberof grafeas.v1.CloudRepoSourceContext + * @memberof grafeas.v1.ComplianceVersion * @static - * @param {grafeas.v1.ICloudRepoSourceContext=} [properties] Properties to set - * @returns {grafeas.v1.CloudRepoSourceContext} CloudRepoSourceContext instance + * @param {grafeas.v1.IComplianceVersion=} [properties] Properties to set + * @returns {grafeas.v1.ComplianceVersion} ComplianceVersion instance */ - CloudRepoSourceContext.create = function create(properties) { - return new CloudRepoSourceContext(properties); + ComplianceVersion.create = function create(properties) { + return new ComplianceVersion(properties); }; /** - * Encodes the specified CloudRepoSourceContext message. Does not implicitly {@link grafeas.v1.CloudRepoSourceContext.verify|verify} messages. + * Encodes the specified ComplianceVersion message. Does not implicitly {@link grafeas.v1.ComplianceVersion.verify|verify} messages. * @function encode - * @memberof grafeas.v1.CloudRepoSourceContext + * @memberof grafeas.v1.ComplianceVersion * @static - * @param {grafeas.v1.ICloudRepoSourceContext} message CloudRepoSourceContext message or plain object to encode + * @param {grafeas.v1.IComplianceVersion} message ComplianceVersion message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CloudRepoSourceContext.encode = function encode(message, writer) { + ComplianceVersion.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.repoId != null && Object.hasOwnProperty.call(message, "repoId")) - $root.grafeas.v1.RepoId.encode(message.repoId, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.revisionId); - if (message.aliasContext != null && Object.hasOwnProperty.call(message, "aliasContext")) - $root.grafeas.v1.AliasContext.encode(message.aliasContext, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.cpeUri != null && Object.hasOwnProperty.call(message, "cpeUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.cpeUri); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); return writer; }; /** - * Encodes the specified CloudRepoSourceContext message, length delimited. Does not implicitly {@link grafeas.v1.CloudRepoSourceContext.verify|verify} messages. + * Encodes the specified ComplianceVersion message, length delimited. Does not implicitly {@link grafeas.v1.ComplianceVersion.verify|verify} messages. * @function encodeDelimited - * @memberof grafeas.v1.CloudRepoSourceContext + * @memberof grafeas.v1.ComplianceVersion * @static - * @param {grafeas.v1.ICloudRepoSourceContext} message CloudRepoSourceContext message or plain object to encode + * @param {grafeas.v1.IComplianceVersion} message ComplianceVersion message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CloudRepoSourceContext.encodeDelimited = function encodeDelimited(message, writer) { + ComplianceVersion.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CloudRepoSourceContext message from the specified reader or buffer. + * Decodes a ComplianceVersion message from the specified reader or buffer. * @function decode - * @memberof grafeas.v1.CloudRepoSourceContext + * @memberof grafeas.v1.ComplianceVersion * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {grafeas.v1.CloudRepoSourceContext} CloudRepoSourceContext + * @returns {grafeas.v1.ComplianceVersion} ComplianceVersion * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CloudRepoSourceContext.decode = function decode(reader, length) { + ComplianceVersion.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.CloudRepoSourceContext(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.ComplianceVersion(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.repoId = $root.grafeas.v1.RepoId.decode(reader, reader.uint32()); + message.cpeUri = reader.string(); break; case 2: - message.revisionId = reader.string(); - break; - case 3: - message.aliasContext = $root.grafeas.v1.AliasContext.decode(reader, reader.uint32()); + message.version = reader.string(); break; default: reader.skipType(tag & 7); @@ -8346,148 +14788,118 @@ }; /** - * Decodes a CloudRepoSourceContext message from the specified reader or buffer, length delimited. + * Decodes a ComplianceVersion message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof grafeas.v1.CloudRepoSourceContext + * @memberof grafeas.v1.ComplianceVersion * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {grafeas.v1.CloudRepoSourceContext} CloudRepoSourceContext + * @returns {grafeas.v1.ComplianceVersion} ComplianceVersion * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CloudRepoSourceContext.decodeDelimited = function decodeDelimited(reader) { + ComplianceVersion.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CloudRepoSourceContext message. + * Verifies a ComplianceVersion message. * @function verify - * @memberof grafeas.v1.CloudRepoSourceContext + * @memberof grafeas.v1.ComplianceVersion * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CloudRepoSourceContext.verify = function verify(message) { + ComplianceVersion.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.repoId != null && message.hasOwnProperty("repoId")) { - var error = $root.grafeas.v1.RepoId.verify(message.repoId); - if (error) - return "repoId." + error; - } - if (message.revisionId != null && message.hasOwnProperty("revisionId")) { - properties.revision = 1; - if (!$util.isString(message.revisionId)) - return "revisionId: string expected"; - } - if (message.aliasContext != null && message.hasOwnProperty("aliasContext")) { - if (properties.revision === 1) - return "revision: multiple values"; - properties.revision = 1; - { - var error = $root.grafeas.v1.AliasContext.verify(message.aliasContext); - if (error) - return "aliasContext." + error; - } - } + if (message.cpeUri != null && message.hasOwnProperty("cpeUri")) + if (!$util.isString(message.cpeUri)) + return "cpeUri: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; return null; }; /** - * Creates a CloudRepoSourceContext message from a plain object. Also converts values to their respective internal types. + * Creates a ComplianceVersion message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof grafeas.v1.CloudRepoSourceContext + * @memberof grafeas.v1.ComplianceVersion * @static * @param {Object.} object Plain object - * @returns {grafeas.v1.CloudRepoSourceContext} CloudRepoSourceContext + * @returns {grafeas.v1.ComplianceVersion} ComplianceVersion */ - CloudRepoSourceContext.fromObject = function fromObject(object) { - if (object instanceof $root.grafeas.v1.CloudRepoSourceContext) + ComplianceVersion.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.ComplianceVersion) return object; - var message = new $root.grafeas.v1.CloudRepoSourceContext(); - if (object.repoId != null) { - if (typeof object.repoId !== "object") - throw TypeError(".grafeas.v1.CloudRepoSourceContext.repoId: object expected"); - message.repoId = $root.grafeas.v1.RepoId.fromObject(object.repoId); - } - if (object.revisionId != null) - message.revisionId = String(object.revisionId); - if (object.aliasContext != null) { - if (typeof object.aliasContext !== "object") - throw TypeError(".grafeas.v1.CloudRepoSourceContext.aliasContext: object expected"); - message.aliasContext = $root.grafeas.v1.AliasContext.fromObject(object.aliasContext); - } + var message = new $root.grafeas.v1.ComplianceVersion(); + if (object.cpeUri != null) + message.cpeUri = String(object.cpeUri); + if (object.version != null) + message.version = String(object.version); return message; }; /** - * Creates a plain object from a CloudRepoSourceContext message. Also converts values to other types if specified. + * Creates a plain object from a ComplianceVersion message. Also converts values to other types if specified. * @function toObject - * @memberof grafeas.v1.CloudRepoSourceContext + * @memberof grafeas.v1.ComplianceVersion * @static - * @param {grafeas.v1.CloudRepoSourceContext} message CloudRepoSourceContext + * @param {grafeas.v1.ComplianceVersion} message ComplianceVersion * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CloudRepoSourceContext.toObject = function toObject(message, options) { + ComplianceVersion.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.repoId = null; - if (message.repoId != null && message.hasOwnProperty("repoId")) - object.repoId = $root.grafeas.v1.RepoId.toObject(message.repoId, options); - if (message.revisionId != null && message.hasOwnProperty("revisionId")) { - object.revisionId = message.revisionId; - if (options.oneofs) - object.revision = "revisionId"; - } - if (message.aliasContext != null && message.hasOwnProperty("aliasContext")) { - object.aliasContext = $root.grafeas.v1.AliasContext.toObject(message.aliasContext, options); - if (options.oneofs) - object.revision = "aliasContext"; + if (options.defaults) { + object.cpeUri = ""; + object.version = ""; } + if (message.cpeUri != null && message.hasOwnProperty("cpeUri")) + object.cpeUri = message.cpeUri; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; return object; }; /** - * Converts this CloudRepoSourceContext to JSON. + * Converts this ComplianceVersion to JSON. * @function toJSON - * @memberof grafeas.v1.CloudRepoSourceContext + * @memberof grafeas.v1.ComplianceVersion * @instance * @returns {Object.} JSON object */ - CloudRepoSourceContext.prototype.toJSON = function toJSON() { + ComplianceVersion.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CloudRepoSourceContext; + return ComplianceVersion; })(); - v1.GerritSourceContext = (function() { + v1.ComplianceOccurrence = (function() { /** - * Properties of a GerritSourceContext. + * Properties of a ComplianceOccurrence. * @memberof grafeas.v1 - * @interface IGerritSourceContext - * @property {string|null} [hostUri] GerritSourceContext hostUri - * @property {string|null} [gerritProject] GerritSourceContext gerritProject - * @property {string|null} [revisionId] GerritSourceContext revisionId - * @property {grafeas.v1.IAliasContext|null} [aliasContext] GerritSourceContext aliasContext + * @interface IComplianceOccurrence + * @property {Array.|null} [nonCompliantFiles] ComplianceOccurrence nonCompliantFiles + * @property {string|null} [nonComplianceReason] ComplianceOccurrence nonComplianceReason */ /** - * Constructs a new GerritSourceContext. + * Constructs a new ComplianceOccurrence. * @memberof grafeas.v1 - * @classdesc Represents a GerritSourceContext. - * @implements IGerritSourceContext + * @classdesc Represents a ComplianceOccurrence. + * @implements IComplianceOccurrence * @constructor - * @param {grafeas.v1.IGerritSourceContext=} [properties] Properties to set + * @param {grafeas.v1.IComplianceOccurrence=} [properties] Properties to set */ - function GerritSourceContext(properties) { + function ComplianceOccurrence(properties) { + this.nonCompliantFiles = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8495,128 +14907,91 @@ } /** - * GerritSourceContext hostUri. - * @member {string} hostUri - * @memberof grafeas.v1.GerritSourceContext - * @instance - */ - GerritSourceContext.prototype.hostUri = ""; - - /** - * GerritSourceContext gerritProject. - * @member {string} gerritProject - * @memberof grafeas.v1.GerritSourceContext - * @instance - */ - GerritSourceContext.prototype.gerritProject = ""; - - /** - * GerritSourceContext revisionId. - * @member {string|null|undefined} revisionId - * @memberof grafeas.v1.GerritSourceContext - * @instance - */ - GerritSourceContext.prototype.revisionId = null; - - /** - * GerritSourceContext aliasContext. - * @member {grafeas.v1.IAliasContext|null|undefined} aliasContext - * @memberof grafeas.v1.GerritSourceContext + * ComplianceOccurrence nonCompliantFiles. + * @member {Array.} nonCompliantFiles + * @memberof grafeas.v1.ComplianceOccurrence * @instance */ - GerritSourceContext.prototype.aliasContext = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ComplianceOccurrence.prototype.nonCompliantFiles = $util.emptyArray; /** - * GerritSourceContext revision. - * @member {"revisionId"|"aliasContext"|undefined} revision - * @memberof grafeas.v1.GerritSourceContext + * ComplianceOccurrence nonComplianceReason. + * @member {string} nonComplianceReason + * @memberof grafeas.v1.ComplianceOccurrence * @instance */ - Object.defineProperty(GerritSourceContext.prototype, "revision", { - get: $util.oneOfGetter($oneOfFields = ["revisionId", "aliasContext"]), - set: $util.oneOfSetter($oneOfFields) - }); + ComplianceOccurrence.prototype.nonComplianceReason = ""; /** - * Creates a new GerritSourceContext instance using the specified properties. + * Creates a new ComplianceOccurrence instance using the specified properties. * @function create - * @memberof grafeas.v1.GerritSourceContext + * @memberof grafeas.v1.ComplianceOccurrence * @static - * @param {grafeas.v1.IGerritSourceContext=} [properties] Properties to set - * @returns {grafeas.v1.GerritSourceContext} GerritSourceContext instance + * @param {grafeas.v1.IComplianceOccurrence=} [properties] Properties to set + * @returns {grafeas.v1.ComplianceOccurrence} ComplianceOccurrence instance */ - GerritSourceContext.create = function create(properties) { - return new GerritSourceContext(properties); + ComplianceOccurrence.create = function create(properties) { + return new ComplianceOccurrence(properties); }; /** - * Encodes the specified GerritSourceContext message. Does not implicitly {@link grafeas.v1.GerritSourceContext.verify|verify} messages. + * Encodes the specified ComplianceOccurrence message. Does not implicitly {@link grafeas.v1.ComplianceOccurrence.verify|verify} messages. * @function encode - * @memberof grafeas.v1.GerritSourceContext + * @memberof grafeas.v1.ComplianceOccurrence * @static - * @param {grafeas.v1.IGerritSourceContext} message GerritSourceContext message or plain object to encode + * @param {grafeas.v1.IComplianceOccurrence} message ComplianceOccurrence message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GerritSourceContext.encode = function encode(message, writer) { + ComplianceOccurrence.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.hostUri != null && Object.hasOwnProperty.call(message, "hostUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.hostUri); - if (message.gerritProject != null && Object.hasOwnProperty.call(message, "gerritProject")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.gerritProject); - if (message.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.revisionId); - if (message.aliasContext != null && Object.hasOwnProperty.call(message, "aliasContext")) - $root.grafeas.v1.AliasContext.encode(message.aliasContext, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.nonCompliantFiles != null && message.nonCompliantFiles.length) + for (var i = 0; i < message.nonCompliantFiles.length; ++i) + $root.grafeas.v1.NonCompliantFile.encode(message.nonCompliantFiles[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nonComplianceReason != null && Object.hasOwnProperty.call(message, "nonComplianceReason")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nonComplianceReason); return writer; }; /** - * Encodes the specified GerritSourceContext message, length delimited. Does not implicitly {@link grafeas.v1.GerritSourceContext.verify|verify} messages. + * Encodes the specified ComplianceOccurrence message, length delimited. Does not implicitly {@link grafeas.v1.ComplianceOccurrence.verify|verify} messages. * @function encodeDelimited - * @memberof grafeas.v1.GerritSourceContext + * @memberof grafeas.v1.ComplianceOccurrence * @static - * @param {grafeas.v1.IGerritSourceContext} message GerritSourceContext message or plain object to encode + * @param {grafeas.v1.IComplianceOccurrence} message ComplianceOccurrence message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GerritSourceContext.encodeDelimited = function encodeDelimited(message, writer) { + ComplianceOccurrence.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GerritSourceContext message from the specified reader or buffer. + * Decodes a ComplianceOccurrence message from the specified reader or buffer. * @function decode - * @memberof grafeas.v1.GerritSourceContext + * @memberof grafeas.v1.ComplianceOccurrence * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {grafeas.v1.GerritSourceContext} GerritSourceContext + * @returns {grafeas.v1.ComplianceOccurrence} ComplianceOccurrence * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GerritSourceContext.decode = function decode(reader, length) { + ComplianceOccurrence.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.GerritSourceContext(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.ComplianceOccurrence(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.hostUri = reader.string(); - break; case 2: - message.gerritProject = reader.string(); + if (!(message.nonCompliantFiles && message.nonCompliantFiles.length)) + message.nonCompliantFiles = []; + message.nonCompliantFiles.push($root.grafeas.v1.NonCompliantFile.decode(reader, reader.uint32())); break; case 3: - message.revisionId = reader.string(); - break; - case 4: - message.aliasContext = $root.grafeas.v1.AliasContext.decode(reader, reader.uint32()); + message.nonComplianceReason = reader.string(); break; default: reader.skipType(tag & 7); @@ -8627,150 +15002,135 @@ }; /** - * Decodes a GerritSourceContext message from the specified reader or buffer, length delimited. + * Decodes a ComplianceOccurrence message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof grafeas.v1.GerritSourceContext + * @memberof grafeas.v1.ComplianceOccurrence * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {grafeas.v1.GerritSourceContext} GerritSourceContext + * @returns {grafeas.v1.ComplianceOccurrence} ComplianceOccurrence * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GerritSourceContext.decodeDelimited = function decodeDelimited(reader) { + ComplianceOccurrence.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GerritSourceContext message. + * Verifies a ComplianceOccurrence message. * @function verify - * @memberof grafeas.v1.GerritSourceContext + * @memberof grafeas.v1.ComplianceOccurrence * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GerritSourceContext.verify = function verify(message) { + ComplianceOccurrence.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.hostUri != null && message.hasOwnProperty("hostUri")) - if (!$util.isString(message.hostUri)) - return "hostUri: string expected"; - if (message.gerritProject != null && message.hasOwnProperty("gerritProject")) - if (!$util.isString(message.gerritProject)) - return "gerritProject: string expected"; - if (message.revisionId != null && message.hasOwnProperty("revisionId")) { - properties.revision = 1; - if (!$util.isString(message.revisionId)) - return "revisionId: string expected"; - } - if (message.aliasContext != null && message.hasOwnProperty("aliasContext")) { - if (properties.revision === 1) - return "revision: multiple values"; - properties.revision = 1; - { - var error = $root.grafeas.v1.AliasContext.verify(message.aliasContext); + if (message.nonCompliantFiles != null && message.hasOwnProperty("nonCompliantFiles")) { + if (!Array.isArray(message.nonCompliantFiles)) + return "nonCompliantFiles: array expected"; + for (var i = 0; i < message.nonCompliantFiles.length; ++i) { + var error = $root.grafeas.v1.NonCompliantFile.verify(message.nonCompliantFiles[i]); if (error) - return "aliasContext." + error; + return "nonCompliantFiles." + error; } } + if (message.nonComplianceReason != null && message.hasOwnProperty("nonComplianceReason")) + if (!$util.isString(message.nonComplianceReason)) + return "nonComplianceReason: string expected"; return null; }; /** - * Creates a GerritSourceContext message from a plain object. Also converts values to their respective internal types. + * Creates a ComplianceOccurrence message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof grafeas.v1.GerritSourceContext + * @memberof grafeas.v1.ComplianceOccurrence * @static * @param {Object.} object Plain object - * @returns {grafeas.v1.GerritSourceContext} GerritSourceContext + * @returns {grafeas.v1.ComplianceOccurrence} ComplianceOccurrence */ - GerritSourceContext.fromObject = function fromObject(object) { - if (object instanceof $root.grafeas.v1.GerritSourceContext) + ComplianceOccurrence.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.ComplianceOccurrence) return object; - var message = new $root.grafeas.v1.GerritSourceContext(); - if (object.hostUri != null) - message.hostUri = String(object.hostUri); - if (object.gerritProject != null) - message.gerritProject = String(object.gerritProject); - if (object.revisionId != null) - message.revisionId = String(object.revisionId); - if (object.aliasContext != null) { - if (typeof object.aliasContext !== "object") - throw TypeError(".grafeas.v1.GerritSourceContext.aliasContext: object expected"); - message.aliasContext = $root.grafeas.v1.AliasContext.fromObject(object.aliasContext); - } + var message = new $root.grafeas.v1.ComplianceOccurrence(); + if (object.nonCompliantFiles) { + if (!Array.isArray(object.nonCompliantFiles)) + throw TypeError(".grafeas.v1.ComplianceOccurrence.nonCompliantFiles: array expected"); + message.nonCompliantFiles = []; + for (var i = 0; i < object.nonCompliantFiles.length; ++i) { + if (typeof object.nonCompliantFiles[i] !== "object") + throw TypeError(".grafeas.v1.ComplianceOccurrence.nonCompliantFiles: object expected"); + message.nonCompliantFiles[i] = $root.grafeas.v1.NonCompliantFile.fromObject(object.nonCompliantFiles[i]); + } + } + if (object.nonComplianceReason != null) + message.nonComplianceReason = String(object.nonComplianceReason); return message; }; /** - * Creates a plain object from a GerritSourceContext message. Also converts values to other types if specified. + * Creates a plain object from a ComplianceOccurrence message. Also converts values to other types if specified. * @function toObject - * @memberof grafeas.v1.GerritSourceContext + * @memberof grafeas.v1.ComplianceOccurrence * @static - * @param {grafeas.v1.GerritSourceContext} message GerritSourceContext + * @param {grafeas.v1.ComplianceOccurrence} message ComplianceOccurrence * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GerritSourceContext.toObject = function toObject(message, options) { + ComplianceOccurrence.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.hostUri = ""; - object.gerritProject = ""; - } - if (message.hostUri != null && message.hasOwnProperty("hostUri")) - object.hostUri = message.hostUri; - if (message.gerritProject != null && message.hasOwnProperty("gerritProject")) - object.gerritProject = message.gerritProject; - if (message.revisionId != null && message.hasOwnProperty("revisionId")) { - object.revisionId = message.revisionId; - if (options.oneofs) - object.revision = "revisionId"; - } - if (message.aliasContext != null && message.hasOwnProperty("aliasContext")) { - object.aliasContext = $root.grafeas.v1.AliasContext.toObject(message.aliasContext, options); - if (options.oneofs) - object.revision = "aliasContext"; - } + if (options.arrays || options.defaults) + object.nonCompliantFiles = []; + if (options.defaults) + object.nonComplianceReason = ""; + if (message.nonCompliantFiles && message.nonCompliantFiles.length) { + object.nonCompliantFiles = []; + for (var j = 0; j < message.nonCompliantFiles.length; ++j) + object.nonCompliantFiles[j] = $root.grafeas.v1.NonCompliantFile.toObject(message.nonCompliantFiles[j], options); + } + if (message.nonComplianceReason != null && message.hasOwnProperty("nonComplianceReason")) + object.nonComplianceReason = message.nonComplianceReason; return object; }; /** - * Converts this GerritSourceContext to JSON. + * Converts this ComplianceOccurrence to JSON. * @function toJSON - * @memberof grafeas.v1.GerritSourceContext + * @memberof grafeas.v1.ComplianceOccurrence * @instance * @returns {Object.} JSON object */ - GerritSourceContext.prototype.toJSON = function toJSON() { + ComplianceOccurrence.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GerritSourceContext; + return ComplianceOccurrence; })(); - v1.GitSourceContext = (function() { + v1.NonCompliantFile = (function() { /** - * Properties of a GitSourceContext. + * Properties of a NonCompliantFile. * @memberof grafeas.v1 - * @interface IGitSourceContext - * @property {string|null} [url] GitSourceContext url - * @property {string|null} [revisionId] GitSourceContext revisionId + * @interface INonCompliantFile + * @property {string|null} [path] NonCompliantFile path + * @property {string|null} [displayCommand] NonCompliantFile displayCommand + * @property {string|null} [reason] NonCompliantFile reason */ /** - * Constructs a new GitSourceContext. + * Constructs a new NonCompliantFile. * @memberof grafeas.v1 - * @classdesc Represents a GitSourceContext. - * @implements IGitSourceContext + * @classdesc Represents a NonCompliantFile. + * @implements INonCompliantFile * @constructor - * @param {grafeas.v1.IGitSourceContext=} [properties] Properties to set + * @param {grafeas.v1.INonCompliantFile=} [properties] Properties to set */ - function GitSourceContext(properties) { + function NonCompliantFile(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8778,88 +15138,101 @@ } /** - * GitSourceContext url. - * @member {string} url - * @memberof grafeas.v1.GitSourceContext + * NonCompliantFile path. + * @member {string} path + * @memberof grafeas.v1.NonCompliantFile * @instance */ - GitSourceContext.prototype.url = ""; + NonCompliantFile.prototype.path = ""; /** - * GitSourceContext revisionId. - * @member {string} revisionId - * @memberof grafeas.v1.GitSourceContext + * NonCompliantFile displayCommand. + * @member {string} displayCommand + * @memberof grafeas.v1.NonCompliantFile * @instance */ - GitSourceContext.prototype.revisionId = ""; + NonCompliantFile.prototype.displayCommand = ""; /** - * Creates a new GitSourceContext instance using the specified properties. + * NonCompliantFile reason. + * @member {string} reason + * @memberof grafeas.v1.NonCompliantFile + * @instance + */ + NonCompliantFile.prototype.reason = ""; + + /** + * Creates a new NonCompliantFile instance using the specified properties. * @function create - * @memberof grafeas.v1.GitSourceContext + * @memberof grafeas.v1.NonCompliantFile * @static - * @param {grafeas.v1.IGitSourceContext=} [properties] Properties to set - * @returns {grafeas.v1.GitSourceContext} GitSourceContext instance + * @param {grafeas.v1.INonCompliantFile=} [properties] Properties to set + * @returns {grafeas.v1.NonCompliantFile} NonCompliantFile instance */ - GitSourceContext.create = function create(properties) { - return new GitSourceContext(properties); + NonCompliantFile.create = function create(properties) { + return new NonCompliantFile(properties); }; /** - * Encodes the specified GitSourceContext message. Does not implicitly {@link grafeas.v1.GitSourceContext.verify|verify} messages. + * Encodes the specified NonCompliantFile message. Does not implicitly {@link grafeas.v1.NonCompliantFile.verify|verify} messages. * @function encode - * @memberof grafeas.v1.GitSourceContext + * @memberof grafeas.v1.NonCompliantFile * @static - * @param {grafeas.v1.IGitSourceContext} message GitSourceContext message or plain object to encode + * @param {grafeas.v1.INonCompliantFile} message NonCompliantFile message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GitSourceContext.encode = function encode(message, writer) { + NonCompliantFile.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.url != null && Object.hasOwnProperty.call(message, "url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); - if (message.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.revisionId); + if (message.path != null && Object.hasOwnProperty.call(message, "path")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.path); + if (message.displayCommand != null && Object.hasOwnProperty.call(message, "displayCommand")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayCommand); + if (message.reason != null && Object.hasOwnProperty.call(message, "reason")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.reason); return writer; }; /** - * Encodes the specified GitSourceContext message, length delimited. Does not implicitly {@link grafeas.v1.GitSourceContext.verify|verify} messages. + * Encodes the specified NonCompliantFile message, length delimited. Does not implicitly {@link grafeas.v1.NonCompliantFile.verify|verify} messages. * @function encodeDelimited - * @memberof grafeas.v1.GitSourceContext + * @memberof grafeas.v1.NonCompliantFile * @static - * @param {grafeas.v1.IGitSourceContext} message GitSourceContext message or plain object to encode + * @param {grafeas.v1.INonCompliantFile} message NonCompliantFile message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GitSourceContext.encodeDelimited = function encodeDelimited(message, writer) { + NonCompliantFile.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GitSourceContext message from the specified reader or buffer. + * Decodes a NonCompliantFile message from the specified reader or buffer. * @function decode - * @memberof grafeas.v1.GitSourceContext + * @memberof grafeas.v1.NonCompliantFile * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {grafeas.v1.GitSourceContext} GitSourceContext + * @returns {grafeas.v1.NonCompliantFile} NonCompliantFile * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GitSourceContext.decode = function decode(reader, length) { + NonCompliantFile.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.GitSourceContext(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.NonCompliantFile(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.url = reader.string(); + message.path = reader.string(); break; case 2: - message.revisionId = reader.string(); + message.displayCommand = reader.string(); + break; + case 3: + message.reason = reader.string(); break; default: reader.skipType(tag & 7); @@ -8870,117 +15243,125 @@ }; /** - * Decodes a GitSourceContext message from the specified reader or buffer, length delimited. + * Decodes a NonCompliantFile message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof grafeas.v1.GitSourceContext + * @memberof grafeas.v1.NonCompliantFile * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {grafeas.v1.GitSourceContext} GitSourceContext + * @returns {grafeas.v1.NonCompliantFile} NonCompliantFile * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GitSourceContext.decodeDelimited = function decodeDelimited(reader) { + NonCompliantFile.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GitSourceContext message. + * Verifies a NonCompliantFile message. * @function verify - * @memberof grafeas.v1.GitSourceContext + * @memberof grafeas.v1.NonCompliantFile * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GitSourceContext.verify = function verify(message) { + NonCompliantFile.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.url != null && message.hasOwnProperty("url")) - if (!$util.isString(message.url)) - return "url: string expected"; - if (message.revisionId != null && message.hasOwnProperty("revisionId")) - if (!$util.isString(message.revisionId)) - return "revisionId: string expected"; + if (message.path != null && message.hasOwnProperty("path")) + if (!$util.isString(message.path)) + return "path: string expected"; + if (message.displayCommand != null && message.hasOwnProperty("displayCommand")) + if (!$util.isString(message.displayCommand)) + return "displayCommand: string expected"; + if (message.reason != null && message.hasOwnProperty("reason")) + if (!$util.isString(message.reason)) + return "reason: string expected"; return null; }; /** - * Creates a GitSourceContext message from a plain object. Also converts values to their respective internal types. + * Creates a NonCompliantFile message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof grafeas.v1.GitSourceContext + * @memberof grafeas.v1.NonCompliantFile * @static * @param {Object.} object Plain object - * @returns {grafeas.v1.GitSourceContext} GitSourceContext + * @returns {grafeas.v1.NonCompliantFile} NonCompliantFile */ - GitSourceContext.fromObject = function fromObject(object) { - if (object instanceof $root.grafeas.v1.GitSourceContext) + NonCompliantFile.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.NonCompliantFile) return object; - var message = new $root.grafeas.v1.GitSourceContext(); - if (object.url != null) - message.url = String(object.url); - if (object.revisionId != null) - message.revisionId = String(object.revisionId); + var message = new $root.grafeas.v1.NonCompliantFile(); + if (object.path != null) + message.path = String(object.path); + if (object.displayCommand != null) + message.displayCommand = String(object.displayCommand); + if (object.reason != null) + message.reason = String(object.reason); return message; }; /** - * Creates a plain object from a GitSourceContext message. Also converts values to other types if specified. + * Creates a plain object from a NonCompliantFile message. Also converts values to other types if specified. * @function toObject - * @memberof grafeas.v1.GitSourceContext + * @memberof grafeas.v1.NonCompliantFile * @static - * @param {grafeas.v1.GitSourceContext} message GitSourceContext + * @param {grafeas.v1.NonCompliantFile} message NonCompliantFile * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GitSourceContext.toObject = function toObject(message, options) { + NonCompliantFile.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.url = ""; - object.revisionId = ""; + object.path = ""; + object.displayCommand = ""; + object.reason = ""; } - if (message.url != null && message.hasOwnProperty("url")) - object.url = message.url; - if (message.revisionId != null && message.hasOwnProperty("revisionId")) - object.revisionId = message.revisionId; + if (message.path != null && message.hasOwnProperty("path")) + object.path = message.path; + if (message.displayCommand != null && message.hasOwnProperty("displayCommand")) + object.displayCommand = message.displayCommand; + if (message.reason != null && message.hasOwnProperty("reason")) + object.reason = message.reason; return object; }; /** - * Converts this GitSourceContext to JSON. + * Converts this NonCompliantFile to JSON. * @function toJSON - * @memberof grafeas.v1.GitSourceContext + * @memberof grafeas.v1.NonCompliantFile * @instance * @returns {Object.} JSON object */ - GitSourceContext.prototype.toJSON = function toJSON() { + NonCompliantFile.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GitSourceContext; + return NonCompliantFile; })(); - v1.RepoId = (function() { + v1.DeploymentNote = (function() { /** - * Properties of a RepoId. + * Properties of a DeploymentNote. * @memberof grafeas.v1 - * @interface IRepoId - * @property {grafeas.v1.IProjectRepoId|null} [projectRepoId] RepoId projectRepoId - * @property {string|null} [uid] RepoId uid + * @interface IDeploymentNote + * @property {Array.|null} [resourceUri] DeploymentNote resourceUri */ /** - * Constructs a new RepoId. + * Constructs a new DeploymentNote. * @memberof grafeas.v1 - * @classdesc Represents a RepoId. - * @implements IRepoId + * @classdesc Represents a DeploymentNote. + * @implements IDeploymentNote * @constructor - * @param {grafeas.v1.IRepoId=} [properties] Properties to set + * @param {grafeas.v1.IDeploymentNote=} [properties] Properties to set */ - function RepoId(properties) { + function DeploymentNote(properties) { + this.resourceUri = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8988,102 +15369,78 @@ } /** - * RepoId projectRepoId. - * @member {grafeas.v1.IProjectRepoId|null|undefined} projectRepoId - * @memberof grafeas.v1.RepoId - * @instance - */ - RepoId.prototype.projectRepoId = null; - - /** - * RepoId uid. - * @member {string|null|undefined} uid - * @memberof grafeas.v1.RepoId - * @instance - */ - RepoId.prototype.uid = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * RepoId id. - * @member {"projectRepoId"|"uid"|undefined} id - * @memberof grafeas.v1.RepoId + * DeploymentNote resourceUri. + * @member {Array.} resourceUri + * @memberof grafeas.v1.DeploymentNote * @instance */ - Object.defineProperty(RepoId.prototype, "id", { - get: $util.oneOfGetter($oneOfFields = ["projectRepoId", "uid"]), - set: $util.oneOfSetter($oneOfFields) - }); + DeploymentNote.prototype.resourceUri = $util.emptyArray; /** - * Creates a new RepoId instance using the specified properties. + * Creates a new DeploymentNote instance using the specified properties. * @function create - * @memberof grafeas.v1.RepoId + * @memberof grafeas.v1.DeploymentNote * @static - * @param {grafeas.v1.IRepoId=} [properties] Properties to set - * @returns {grafeas.v1.RepoId} RepoId instance + * @param {grafeas.v1.IDeploymentNote=} [properties] Properties to set + * @returns {grafeas.v1.DeploymentNote} DeploymentNote instance */ - RepoId.create = function create(properties) { - return new RepoId(properties); + DeploymentNote.create = function create(properties) { + return new DeploymentNote(properties); }; /** - * Encodes the specified RepoId message. Does not implicitly {@link grafeas.v1.RepoId.verify|verify} messages. + * Encodes the specified DeploymentNote message. Does not implicitly {@link grafeas.v1.DeploymentNote.verify|verify} messages. * @function encode - * @memberof grafeas.v1.RepoId + * @memberof grafeas.v1.DeploymentNote * @static - * @param {grafeas.v1.IRepoId} message RepoId message or plain object to encode + * @param {grafeas.v1.IDeploymentNote} message DeploymentNote message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RepoId.encode = function encode(message, writer) { + DeploymentNote.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.projectRepoId != null && Object.hasOwnProperty.call(message, "projectRepoId")) - $root.grafeas.v1.ProjectRepoId.encode(message.projectRepoId, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); + if (message.resourceUri != null && message.resourceUri.length) + for (var i = 0; i < message.resourceUri.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceUri[i]); return writer; }; /** - * Encodes the specified RepoId message, length delimited. Does not implicitly {@link grafeas.v1.RepoId.verify|verify} messages. + * Encodes the specified DeploymentNote message, length delimited. Does not implicitly {@link grafeas.v1.DeploymentNote.verify|verify} messages. * @function encodeDelimited - * @memberof grafeas.v1.RepoId + * @memberof grafeas.v1.DeploymentNote * @static - * @param {grafeas.v1.IRepoId} message RepoId message or plain object to encode + * @param {grafeas.v1.IDeploymentNote} message DeploymentNote message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RepoId.encodeDelimited = function encodeDelimited(message, writer) { + DeploymentNote.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RepoId message from the specified reader or buffer. + * Decodes a DeploymentNote message from the specified reader or buffer. * @function decode - * @memberof grafeas.v1.RepoId + * @memberof grafeas.v1.DeploymentNote * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {grafeas.v1.RepoId} RepoId + * @returns {grafeas.v1.DeploymentNote} DeploymentNote * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RepoId.decode = function decode(reader, length) { + DeploymentNote.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.RepoId(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.DeploymentNote(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.projectRepoId = $root.grafeas.v1.ProjectRepoId.decode(reader, reader.uint32()); - break; - case 2: - message.uid = reader.string(); + if (!(message.resourceUri && message.resourceUri.length)) + message.resourceUri = []; + message.resourceUri.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -9094,221 +15451,283 @@ }; /** - * Decodes a RepoId message from the specified reader or buffer, length delimited. + * Decodes a DeploymentNote message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof grafeas.v1.RepoId + * @memberof grafeas.v1.DeploymentNote * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {grafeas.v1.RepoId} RepoId + * @returns {grafeas.v1.DeploymentNote} DeploymentNote * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RepoId.decodeDelimited = function decodeDelimited(reader) { + DeploymentNote.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RepoId message. + * Verifies a DeploymentNote message. * @function verify - * @memberof grafeas.v1.RepoId + * @memberof grafeas.v1.DeploymentNote * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RepoId.verify = function verify(message) { + DeploymentNote.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.projectRepoId != null && message.hasOwnProperty("projectRepoId")) { - properties.id = 1; - { - var error = $root.grafeas.v1.ProjectRepoId.verify(message.projectRepoId); - if (error) - return "projectRepoId." + error; - } - } - if (message.uid != null && message.hasOwnProperty("uid")) { - if (properties.id === 1) - return "id: multiple values"; - properties.id = 1; - if (!$util.isString(message.uid)) - return "uid: string expected"; + if (message.resourceUri != null && message.hasOwnProperty("resourceUri")) { + if (!Array.isArray(message.resourceUri)) + return "resourceUri: array expected"; + for (var i = 0; i < message.resourceUri.length; ++i) + if (!$util.isString(message.resourceUri[i])) + return "resourceUri: string[] expected"; } return null; }; /** - * Creates a RepoId message from a plain object. Also converts values to their respective internal types. + * Creates a DeploymentNote message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof grafeas.v1.RepoId + * @memberof grafeas.v1.DeploymentNote * @static * @param {Object.} object Plain object - * @returns {grafeas.v1.RepoId} RepoId + * @returns {grafeas.v1.DeploymentNote} DeploymentNote */ - RepoId.fromObject = function fromObject(object) { - if (object instanceof $root.grafeas.v1.RepoId) + DeploymentNote.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.DeploymentNote) return object; - var message = new $root.grafeas.v1.RepoId(); - if (object.projectRepoId != null) { - if (typeof object.projectRepoId !== "object") - throw TypeError(".grafeas.v1.RepoId.projectRepoId: object expected"); - message.projectRepoId = $root.grafeas.v1.ProjectRepoId.fromObject(object.projectRepoId); + var message = new $root.grafeas.v1.DeploymentNote(); + if (object.resourceUri) { + if (!Array.isArray(object.resourceUri)) + throw TypeError(".grafeas.v1.DeploymentNote.resourceUri: array expected"); + message.resourceUri = []; + for (var i = 0; i < object.resourceUri.length; ++i) + message.resourceUri[i] = String(object.resourceUri[i]); } - if (object.uid != null) - message.uid = String(object.uid); return message; }; /** - * Creates a plain object from a RepoId message. Also converts values to other types if specified. + * Creates a plain object from a DeploymentNote message. Also converts values to other types if specified. * @function toObject - * @memberof grafeas.v1.RepoId + * @memberof grafeas.v1.DeploymentNote * @static - * @param {grafeas.v1.RepoId} message RepoId + * @param {grafeas.v1.DeploymentNote} message DeploymentNote * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RepoId.toObject = function toObject(message, options) { + DeploymentNote.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.projectRepoId != null && message.hasOwnProperty("projectRepoId")) { - object.projectRepoId = $root.grafeas.v1.ProjectRepoId.toObject(message.projectRepoId, options); - if (options.oneofs) - object.id = "projectRepoId"; - } - if (message.uid != null && message.hasOwnProperty("uid")) { - object.uid = message.uid; - if (options.oneofs) - object.id = "uid"; + if (options.arrays || options.defaults) + object.resourceUri = []; + if (message.resourceUri && message.resourceUri.length) { + object.resourceUri = []; + for (var j = 0; j < message.resourceUri.length; ++j) + object.resourceUri[j] = message.resourceUri[j]; } return object; }; /** - * Converts this RepoId to JSON. + * Converts this DeploymentNote to JSON. * @function toJSON - * @memberof grafeas.v1.RepoId + * @memberof grafeas.v1.DeploymentNote * @instance * @returns {Object.} JSON object */ - RepoId.prototype.toJSON = function toJSON() { + DeploymentNote.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return RepoId; + return DeploymentNote; })(); - v1.ProjectRepoId = (function() { + v1.DeploymentOccurrence = (function() { /** - * Properties of a ProjectRepoId. + * Properties of a DeploymentOccurrence. * @memberof grafeas.v1 - * @interface IProjectRepoId - * @property {string|null} [projectId] ProjectRepoId projectId - * @property {string|null} [repoName] ProjectRepoId repoName + * @interface IDeploymentOccurrence + * @property {string|null} [userEmail] DeploymentOccurrence userEmail + * @property {google.protobuf.ITimestamp|null} [deployTime] DeploymentOccurrence deployTime + * @property {google.protobuf.ITimestamp|null} [undeployTime] DeploymentOccurrence undeployTime + * @property {string|null} [config] DeploymentOccurrence config + * @property {string|null} [address] DeploymentOccurrence address + * @property {Array.|null} [resourceUri] DeploymentOccurrence resourceUri + * @property {grafeas.v1.DeploymentOccurrence.Platform|null} [platform] DeploymentOccurrence platform */ /** - * Constructs a new ProjectRepoId. + * Constructs a new DeploymentOccurrence. * @memberof grafeas.v1 - * @classdesc Represents a ProjectRepoId. - * @implements IProjectRepoId + * @classdesc Represents a DeploymentOccurrence. + * @implements IDeploymentOccurrence * @constructor - * @param {grafeas.v1.IProjectRepoId=} [properties] Properties to set + * @param {grafeas.v1.IDeploymentOccurrence=} [properties] Properties to set + */ + function DeploymentOccurrence(properties) { + this.resourceUri = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeploymentOccurrence userEmail. + * @member {string} userEmail + * @memberof grafeas.v1.DeploymentOccurrence + * @instance + */ + DeploymentOccurrence.prototype.userEmail = ""; + + /** + * DeploymentOccurrence deployTime. + * @member {google.protobuf.ITimestamp|null|undefined} deployTime + * @memberof grafeas.v1.DeploymentOccurrence + * @instance + */ + DeploymentOccurrence.prototype.deployTime = null; + + /** + * DeploymentOccurrence undeployTime. + * @member {google.protobuf.ITimestamp|null|undefined} undeployTime + * @memberof grafeas.v1.DeploymentOccurrence + * @instance + */ + DeploymentOccurrence.prototype.undeployTime = null; + + /** + * DeploymentOccurrence config. + * @member {string} config + * @memberof grafeas.v1.DeploymentOccurrence + * @instance + */ + DeploymentOccurrence.prototype.config = ""; + + /** + * DeploymentOccurrence address. + * @member {string} address + * @memberof grafeas.v1.DeploymentOccurrence + * @instance */ - function ProjectRepoId(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + DeploymentOccurrence.prototype.address = ""; /** - * ProjectRepoId projectId. - * @member {string} projectId - * @memberof grafeas.v1.ProjectRepoId + * DeploymentOccurrence resourceUri. + * @member {Array.} resourceUri + * @memberof grafeas.v1.DeploymentOccurrence * @instance */ - ProjectRepoId.prototype.projectId = ""; + DeploymentOccurrence.prototype.resourceUri = $util.emptyArray; /** - * ProjectRepoId repoName. - * @member {string} repoName - * @memberof grafeas.v1.ProjectRepoId + * DeploymentOccurrence platform. + * @member {grafeas.v1.DeploymentOccurrence.Platform} platform + * @memberof grafeas.v1.DeploymentOccurrence * @instance */ - ProjectRepoId.prototype.repoName = ""; + DeploymentOccurrence.prototype.platform = 0; /** - * Creates a new ProjectRepoId instance using the specified properties. + * Creates a new DeploymentOccurrence instance using the specified properties. * @function create - * @memberof grafeas.v1.ProjectRepoId + * @memberof grafeas.v1.DeploymentOccurrence * @static - * @param {grafeas.v1.IProjectRepoId=} [properties] Properties to set - * @returns {grafeas.v1.ProjectRepoId} ProjectRepoId instance + * @param {grafeas.v1.IDeploymentOccurrence=} [properties] Properties to set + * @returns {grafeas.v1.DeploymentOccurrence} DeploymentOccurrence instance */ - ProjectRepoId.create = function create(properties) { - return new ProjectRepoId(properties); + DeploymentOccurrence.create = function create(properties) { + return new DeploymentOccurrence(properties); }; /** - * Encodes the specified ProjectRepoId message. Does not implicitly {@link grafeas.v1.ProjectRepoId.verify|verify} messages. + * Encodes the specified DeploymentOccurrence message. Does not implicitly {@link grafeas.v1.DeploymentOccurrence.verify|verify} messages. * @function encode - * @memberof grafeas.v1.ProjectRepoId + * @memberof grafeas.v1.DeploymentOccurrence * @static - * @param {grafeas.v1.IProjectRepoId} message ProjectRepoId message or plain object to encode + * @param {grafeas.v1.IDeploymentOccurrence} message DeploymentOccurrence message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ProjectRepoId.encode = function encode(message, writer) { + DeploymentOccurrence.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.projectId != null && Object.hasOwnProperty.call(message, "projectId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.projectId); - if (message.repoName != null && Object.hasOwnProperty.call(message, "repoName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.repoName); + if (message.userEmail != null && Object.hasOwnProperty.call(message, "userEmail")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.userEmail); + if (message.deployTime != null && Object.hasOwnProperty.call(message, "deployTime")) + $root.google.protobuf.Timestamp.encode(message.deployTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.undeployTime != null && Object.hasOwnProperty.call(message, "undeployTime")) + $root.google.protobuf.Timestamp.encode(message.undeployTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.config); + if (message.address != null && Object.hasOwnProperty.call(message, "address")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.address); + if (message.resourceUri != null && message.resourceUri.length) + for (var i = 0; i < message.resourceUri.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.resourceUri[i]); + if (message.platform != null && Object.hasOwnProperty.call(message, "platform")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.platform); return writer; }; /** - * Encodes the specified ProjectRepoId message, length delimited. Does not implicitly {@link grafeas.v1.ProjectRepoId.verify|verify} messages. + * Encodes the specified DeploymentOccurrence message, length delimited. Does not implicitly {@link grafeas.v1.DeploymentOccurrence.verify|verify} messages. * @function encodeDelimited - * @memberof grafeas.v1.ProjectRepoId + * @memberof grafeas.v1.DeploymentOccurrence * @static - * @param {grafeas.v1.IProjectRepoId} message ProjectRepoId message or plain object to encode + * @param {grafeas.v1.IDeploymentOccurrence} message DeploymentOccurrence message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ProjectRepoId.encodeDelimited = function encodeDelimited(message, writer) { + DeploymentOccurrence.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ProjectRepoId message from the specified reader or buffer. + * Decodes a DeploymentOccurrence message from the specified reader or buffer. * @function decode - * @memberof grafeas.v1.ProjectRepoId + * @memberof grafeas.v1.DeploymentOccurrence * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {grafeas.v1.ProjectRepoId} ProjectRepoId + * @returns {grafeas.v1.DeploymentOccurrence} DeploymentOccurrence * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ProjectRepoId.decode = function decode(reader, length) { + DeploymentOccurrence.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.ProjectRepoId(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.DeploymentOccurrence(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.projectId = reader.string(); + message.userEmail = reader.string(); break; case 2: - message.repoName = reader.string(); + message.deployTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.undeployTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 4: + message.config = reader.string(); + break; + case 5: + message.address = reader.string(); + break; + case 6: + if (!(message.resourceUri && message.resourceUri.length)) + message.resourceUri = []; + message.resourceUri.push(reader.string()); + break; + case 7: + message.platform = reader.int32(); break; default: reader.skipType(tag & 7); @@ -9319,117 +15738,220 @@ }; /** - * Decodes a ProjectRepoId message from the specified reader or buffer, length delimited. + * Decodes a DeploymentOccurrence message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof grafeas.v1.ProjectRepoId + * @memberof grafeas.v1.DeploymentOccurrence * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {grafeas.v1.ProjectRepoId} ProjectRepoId + * @returns {grafeas.v1.DeploymentOccurrence} DeploymentOccurrence * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ProjectRepoId.decodeDelimited = function decodeDelimited(reader) { + DeploymentOccurrence.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ProjectRepoId message. + * Verifies a DeploymentOccurrence message. * @function verify - * @memberof grafeas.v1.ProjectRepoId + * @memberof grafeas.v1.DeploymentOccurrence * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ProjectRepoId.verify = function verify(message) { + DeploymentOccurrence.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.projectId != null && message.hasOwnProperty("projectId")) - if (!$util.isString(message.projectId)) - return "projectId: string expected"; - if (message.repoName != null && message.hasOwnProperty("repoName")) - if (!$util.isString(message.repoName)) - return "repoName: string expected"; + if (message.userEmail != null && message.hasOwnProperty("userEmail")) + if (!$util.isString(message.userEmail)) + return "userEmail: string expected"; + if (message.deployTime != null && message.hasOwnProperty("deployTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deployTime); + if (error) + return "deployTime." + error; + } + if (message.undeployTime != null && message.hasOwnProperty("undeployTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.undeployTime); + if (error) + return "undeployTime." + error; + } + if (message.config != null && message.hasOwnProperty("config")) + if (!$util.isString(message.config)) + return "config: string expected"; + if (message.address != null && message.hasOwnProperty("address")) + if (!$util.isString(message.address)) + return "address: string expected"; + if (message.resourceUri != null && message.hasOwnProperty("resourceUri")) { + if (!Array.isArray(message.resourceUri)) + return "resourceUri: array expected"; + for (var i = 0; i < message.resourceUri.length; ++i) + if (!$util.isString(message.resourceUri[i])) + return "resourceUri: string[] expected"; + } + if (message.platform != null && message.hasOwnProperty("platform")) + switch (message.platform) { + default: + return "platform: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } return null; }; /** - * Creates a ProjectRepoId message from a plain object. Also converts values to their respective internal types. + * Creates a DeploymentOccurrence message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof grafeas.v1.ProjectRepoId + * @memberof grafeas.v1.DeploymentOccurrence * @static * @param {Object.} object Plain object - * @returns {grafeas.v1.ProjectRepoId} ProjectRepoId + * @returns {grafeas.v1.DeploymentOccurrence} DeploymentOccurrence */ - ProjectRepoId.fromObject = function fromObject(object) { - if (object instanceof $root.grafeas.v1.ProjectRepoId) + DeploymentOccurrence.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.DeploymentOccurrence) return object; - var message = new $root.grafeas.v1.ProjectRepoId(); - if (object.projectId != null) - message.projectId = String(object.projectId); - if (object.repoName != null) - message.repoName = String(object.repoName); + var message = new $root.grafeas.v1.DeploymentOccurrence(); + if (object.userEmail != null) + message.userEmail = String(object.userEmail); + if (object.deployTime != null) { + if (typeof object.deployTime !== "object") + throw TypeError(".grafeas.v1.DeploymentOccurrence.deployTime: object expected"); + message.deployTime = $root.google.protobuf.Timestamp.fromObject(object.deployTime); + } + if (object.undeployTime != null) { + if (typeof object.undeployTime !== "object") + throw TypeError(".grafeas.v1.DeploymentOccurrence.undeployTime: object expected"); + message.undeployTime = $root.google.protobuf.Timestamp.fromObject(object.undeployTime); + } + if (object.config != null) + message.config = String(object.config); + if (object.address != null) + message.address = String(object.address); + if (object.resourceUri) { + if (!Array.isArray(object.resourceUri)) + throw TypeError(".grafeas.v1.DeploymentOccurrence.resourceUri: array expected"); + message.resourceUri = []; + for (var i = 0; i < object.resourceUri.length; ++i) + message.resourceUri[i] = String(object.resourceUri[i]); + } + switch (object.platform) { + case "PLATFORM_UNSPECIFIED": + case 0: + message.platform = 0; + break; + case "GKE": + case 1: + message.platform = 1; + break; + case "FLEX": + case 2: + message.platform = 2; + break; + case "CUSTOM": + case 3: + message.platform = 3; + break; + } return message; }; /** - * Creates a plain object from a ProjectRepoId message. Also converts values to other types if specified. + * Creates a plain object from a DeploymentOccurrence message. Also converts values to other types if specified. * @function toObject - * @memberof grafeas.v1.ProjectRepoId + * @memberof grafeas.v1.DeploymentOccurrence * @static - * @param {grafeas.v1.ProjectRepoId} message ProjectRepoId + * @param {grafeas.v1.DeploymentOccurrence} message DeploymentOccurrence * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ProjectRepoId.toObject = function toObject(message, options) { + DeploymentOccurrence.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.resourceUri = []; if (options.defaults) { - object.projectId = ""; - object.repoName = ""; + object.userEmail = ""; + object.deployTime = null; + object.undeployTime = null; + object.config = ""; + object.address = ""; + object.platform = options.enums === String ? "PLATFORM_UNSPECIFIED" : 0; } - if (message.projectId != null && message.hasOwnProperty("projectId")) - object.projectId = message.projectId; - if (message.repoName != null && message.hasOwnProperty("repoName")) - object.repoName = message.repoName; + if (message.userEmail != null && message.hasOwnProperty("userEmail")) + object.userEmail = message.userEmail; + if (message.deployTime != null && message.hasOwnProperty("deployTime")) + object.deployTime = $root.google.protobuf.Timestamp.toObject(message.deployTime, options); + if (message.undeployTime != null && message.hasOwnProperty("undeployTime")) + object.undeployTime = $root.google.protobuf.Timestamp.toObject(message.undeployTime, options); + if (message.config != null && message.hasOwnProperty("config")) + object.config = message.config; + if (message.address != null && message.hasOwnProperty("address")) + object.address = message.address; + if (message.resourceUri && message.resourceUri.length) { + object.resourceUri = []; + for (var j = 0; j < message.resourceUri.length; ++j) + object.resourceUri[j] = message.resourceUri[j]; + } + if (message.platform != null && message.hasOwnProperty("platform")) + object.platform = options.enums === String ? $root.grafeas.v1.DeploymentOccurrence.Platform[message.platform] : message.platform; return object; }; /** - * Converts this ProjectRepoId to JSON. + * Converts this DeploymentOccurrence to JSON. * @function toJSON - * @memberof grafeas.v1.ProjectRepoId + * @memberof grafeas.v1.DeploymentOccurrence * @instance * @returns {Object.} JSON object */ - ProjectRepoId.prototype.toJSON = function toJSON() { + DeploymentOccurrence.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ProjectRepoId; + /** + * Platform enum. + * @name grafeas.v1.DeploymentOccurrence.Platform + * @enum {number} + * @property {number} PLATFORM_UNSPECIFIED=0 PLATFORM_UNSPECIFIED value + * @property {number} GKE=1 GKE value + * @property {number} FLEX=2 FLEX value + * @property {number} CUSTOM=3 CUSTOM value + */ + DeploymentOccurrence.Platform = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PLATFORM_UNSPECIFIED"] = 0; + values[valuesById[1] = "GKE"] = 1; + values[valuesById[2] = "FLEX"] = 2; + values[valuesById[3] = "CUSTOM"] = 3; + return values; + })(); + + return DeploymentOccurrence; })(); - v1.DeploymentNote = (function() { + v1.DiscoveryNote = (function() { /** - * Properties of a DeploymentNote. + * Properties of a DiscoveryNote. * @memberof grafeas.v1 - * @interface IDeploymentNote - * @property {Array.|null} [resourceUri] DeploymentNote resourceUri + * @interface IDiscoveryNote + * @property {grafeas.v1.NoteKind|null} [analysisKind] DiscoveryNote analysisKind */ /** - * Constructs a new DeploymentNote. + * Constructs a new DiscoveryNote. * @memberof grafeas.v1 - * @classdesc Represents a DeploymentNote. - * @implements IDeploymentNote + * @classdesc Represents a DiscoveryNote. + * @implements IDiscoveryNote * @constructor - * @param {grafeas.v1.IDeploymentNote=} [properties] Properties to set + * @param {grafeas.v1.IDiscoveryNote=} [properties] Properties to set */ - function DeploymentNote(properties) { - this.resourceUri = []; + function DiscoveryNote(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9437,78 +15959,75 @@ } /** - * DeploymentNote resourceUri. - * @member {Array.} resourceUri - * @memberof grafeas.v1.DeploymentNote + * DiscoveryNote analysisKind. + * @member {grafeas.v1.NoteKind} analysisKind + * @memberof grafeas.v1.DiscoveryNote * @instance */ - DeploymentNote.prototype.resourceUri = $util.emptyArray; + DiscoveryNote.prototype.analysisKind = 0; /** - * Creates a new DeploymentNote instance using the specified properties. + * Creates a new DiscoveryNote instance using the specified properties. * @function create - * @memberof grafeas.v1.DeploymentNote + * @memberof grafeas.v1.DiscoveryNote * @static - * @param {grafeas.v1.IDeploymentNote=} [properties] Properties to set - * @returns {grafeas.v1.DeploymentNote} DeploymentNote instance + * @param {grafeas.v1.IDiscoveryNote=} [properties] Properties to set + * @returns {grafeas.v1.DiscoveryNote} DiscoveryNote instance */ - DeploymentNote.create = function create(properties) { - return new DeploymentNote(properties); + DiscoveryNote.create = function create(properties) { + return new DiscoveryNote(properties); }; /** - * Encodes the specified DeploymentNote message. Does not implicitly {@link grafeas.v1.DeploymentNote.verify|verify} messages. + * Encodes the specified DiscoveryNote message. Does not implicitly {@link grafeas.v1.DiscoveryNote.verify|verify} messages. * @function encode - * @memberof grafeas.v1.DeploymentNote + * @memberof grafeas.v1.DiscoveryNote * @static - * @param {grafeas.v1.IDeploymentNote} message DeploymentNote message or plain object to encode + * @param {grafeas.v1.IDiscoveryNote} message DiscoveryNote message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeploymentNote.encode = function encode(message, writer) { + DiscoveryNote.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.resourceUri != null && message.resourceUri.length) - for (var i = 0; i < message.resourceUri.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.resourceUri[i]); + if (message.analysisKind != null && Object.hasOwnProperty.call(message, "analysisKind")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.analysisKind); return writer; }; /** - * Encodes the specified DeploymentNote message, length delimited. Does not implicitly {@link grafeas.v1.DeploymentNote.verify|verify} messages. + * Encodes the specified DiscoveryNote message, length delimited. Does not implicitly {@link grafeas.v1.DiscoveryNote.verify|verify} messages. * @function encodeDelimited - * @memberof grafeas.v1.DeploymentNote + * @memberof grafeas.v1.DiscoveryNote * @static - * @param {grafeas.v1.IDeploymentNote} message DeploymentNote message or plain object to encode + * @param {grafeas.v1.IDiscoveryNote} message DiscoveryNote message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeploymentNote.encodeDelimited = function encodeDelimited(message, writer) { + DiscoveryNote.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeploymentNote message from the specified reader or buffer. + * Decodes a DiscoveryNote message from the specified reader or buffer. * @function decode - * @memberof grafeas.v1.DeploymentNote + * @memberof grafeas.v1.DiscoveryNote * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {grafeas.v1.DeploymentNote} DeploymentNote + * @returns {grafeas.v1.DiscoveryNote} DiscoveryNote * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeploymentNote.decode = function decode(reader, length) { + DiscoveryNote.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.DeploymentNote(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.DiscoveryNote(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.resourceUri && message.resourceUri.length)) - message.resourceUri = []; - message.resourceUri.push(reader.string()); + message.analysisKind = reader.int32(); break; default: reader.skipType(tag & 7); @@ -9519,126 +16038,169 @@ }; /** - * Decodes a DeploymentNote message from the specified reader or buffer, length delimited. + * Decodes a DiscoveryNote message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof grafeas.v1.DeploymentNote + * @memberof grafeas.v1.DiscoveryNote * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {grafeas.v1.DeploymentNote} DeploymentNote + * @returns {grafeas.v1.DiscoveryNote} DiscoveryNote * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeploymentNote.decodeDelimited = function decodeDelimited(reader) { + DiscoveryNote.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeploymentNote message. + * Verifies a DiscoveryNote message. * @function verify - * @memberof grafeas.v1.DeploymentNote + * @memberof grafeas.v1.DiscoveryNote * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeploymentNote.verify = function verify(message) { + DiscoveryNote.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.resourceUri != null && message.hasOwnProperty("resourceUri")) { - if (!Array.isArray(message.resourceUri)) - return "resourceUri: array expected"; - for (var i = 0; i < message.resourceUri.length; ++i) - if (!$util.isString(message.resourceUri[i])) - return "resourceUri: string[] expected"; - } + if (message.analysisKind != null && message.hasOwnProperty("analysisKind")) + switch (message.analysisKind) { + default: + return "analysisKind: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + break; + } return null; }; /** - * Creates a DeploymentNote message from a plain object. Also converts values to their respective internal types. + * Creates a DiscoveryNote message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof grafeas.v1.DeploymentNote + * @memberof grafeas.v1.DiscoveryNote * @static * @param {Object.} object Plain object - * @returns {grafeas.v1.DeploymentNote} DeploymentNote + * @returns {grafeas.v1.DiscoveryNote} DiscoveryNote */ - DeploymentNote.fromObject = function fromObject(object) { - if (object instanceof $root.grafeas.v1.DeploymentNote) + DiscoveryNote.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.DiscoveryNote) return object; - var message = new $root.grafeas.v1.DeploymentNote(); - if (object.resourceUri) { - if (!Array.isArray(object.resourceUri)) - throw TypeError(".grafeas.v1.DeploymentNote.resourceUri: array expected"); - message.resourceUri = []; - for (var i = 0; i < object.resourceUri.length; ++i) - message.resourceUri[i] = String(object.resourceUri[i]); + var message = new $root.grafeas.v1.DiscoveryNote(); + switch (object.analysisKind) { + case "NOTE_KIND_UNSPECIFIED": + case 0: + message.analysisKind = 0; + break; + case "VULNERABILITY": + case 1: + message.analysisKind = 1; + break; + case "BUILD": + case 2: + message.analysisKind = 2; + break; + case "IMAGE": + case 3: + message.analysisKind = 3; + break; + case "PACKAGE": + case 4: + message.analysisKind = 4; + break; + case "DEPLOYMENT": + case 5: + message.analysisKind = 5; + break; + case "DISCOVERY": + case 6: + message.analysisKind = 6; + break; + case "ATTESTATION": + case 7: + message.analysisKind = 7; + break; + case "UPGRADE": + case 8: + message.analysisKind = 8; + break; + case "COMPLIANCE": + case 9: + message.analysisKind = 9; + break; + case "DSSE_ATTESTATION": + case 10: + message.analysisKind = 10; + break; } return message; }; /** - * Creates a plain object from a DeploymentNote message. Also converts values to other types if specified. + * Creates a plain object from a DiscoveryNote message. Also converts values to other types if specified. * @function toObject - * @memberof grafeas.v1.DeploymentNote + * @memberof grafeas.v1.DiscoveryNote * @static - * @param {grafeas.v1.DeploymentNote} message DeploymentNote + * @param {grafeas.v1.DiscoveryNote} message DiscoveryNote * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeploymentNote.toObject = function toObject(message, options) { + DiscoveryNote.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.resourceUri = []; - if (message.resourceUri && message.resourceUri.length) { - object.resourceUri = []; - for (var j = 0; j < message.resourceUri.length; ++j) - object.resourceUri[j] = message.resourceUri[j]; - } + if (options.defaults) + object.analysisKind = options.enums === String ? "NOTE_KIND_UNSPECIFIED" : 0; + if (message.analysisKind != null && message.hasOwnProperty("analysisKind")) + object.analysisKind = options.enums === String ? $root.grafeas.v1.NoteKind[message.analysisKind] : message.analysisKind; return object; }; /** - * Converts this DeploymentNote to JSON. + * Converts this DiscoveryNote to JSON. * @function toJSON - * @memberof grafeas.v1.DeploymentNote + * @memberof grafeas.v1.DiscoveryNote * @instance * @returns {Object.} JSON object */ - DeploymentNote.prototype.toJSON = function toJSON() { + DiscoveryNote.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeploymentNote; + return DiscoveryNote; })(); - v1.DeploymentOccurrence = (function() { + v1.DiscoveryOccurrence = (function() { /** - * Properties of a DeploymentOccurrence. + * Properties of a DiscoveryOccurrence. * @memberof grafeas.v1 - * @interface IDeploymentOccurrence - * @property {string|null} [userEmail] DeploymentOccurrence userEmail - * @property {google.protobuf.ITimestamp|null} [deployTime] DeploymentOccurrence deployTime - * @property {google.protobuf.ITimestamp|null} [undeployTime] DeploymentOccurrence undeployTime - * @property {string|null} [config] DeploymentOccurrence config - * @property {string|null} [address] DeploymentOccurrence address - * @property {Array.|null} [resourceUri] DeploymentOccurrence resourceUri - * @property {grafeas.v1.DeploymentOccurrence.Platform|null} [platform] DeploymentOccurrence platform + * @interface IDiscoveryOccurrence + * @property {grafeas.v1.DiscoveryOccurrence.ContinuousAnalysis|null} [continuousAnalysis] DiscoveryOccurrence continuousAnalysis + * @property {grafeas.v1.DiscoveryOccurrence.AnalysisStatus|null} [analysisStatus] DiscoveryOccurrence analysisStatus + * @property {google.rpc.IStatus|null} [analysisStatusError] DiscoveryOccurrence analysisStatusError + * @property {string|null} [cpe] DiscoveryOccurrence cpe + * @property {google.protobuf.ITimestamp|null} [lastScanTime] DiscoveryOccurrence lastScanTime */ /** - * Constructs a new DeploymentOccurrence. + * Constructs a new DiscoveryOccurrence. * @memberof grafeas.v1 - * @classdesc Represents a DeploymentOccurrence. - * @implements IDeploymentOccurrence + * @classdesc Represents a DiscoveryOccurrence. + * @implements IDiscoveryOccurrence * @constructor - * @param {grafeas.v1.IDeploymentOccurrence=} [properties] Properties to set - */ - function DeploymentOccurrence(properties) { - this.resourceUri = []; + * @param {grafeas.v1.IDiscoveryOccurrence=} [properties] Properties to set + */ + function DiscoveryOccurrence(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9646,156 +16208,127 @@ } /** - * DeploymentOccurrence userEmail. - * @member {string} userEmail - * @memberof grafeas.v1.DeploymentOccurrence - * @instance - */ - DeploymentOccurrence.prototype.userEmail = ""; - - /** - * DeploymentOccurrence deployTime. - * @member {google.protobuf.ITimestamp|null|undefined} deployTime - * @memberof grafeas.v1.DeploymentOccurrence - * @instance - */ - DeploymentOccurrence.prototype.deployTime = null; - - /** - * DeploymentOccurrence undeployTime. - * @member {google.protobuf.ITimestamp|null|undefined} undeployTime - * @memberof grafeas.v1.DeploymentOccurrence + * DiscoveryOccurrence continuousAnalysis. + * @member {grafeas.v1.DiscoveryOccurrence.ContinuousAnalysis} continuousAnalysis + * @memberof grafeas.v1.DiscoveryOccurrence * @instance */ - DeploymentOccurrence.prototype.undeployTime = null; + DiscoveryOccurrence.prototype.continuousAnalysis = 0; /** - * DeploymentOccurrence config. - * @member {string} config - * @memberof grafeas.v1.DeploymentOccurrence + * DiscoveryOccurrence analysisStatus. + * @member {grafeas.v1.DiscoveryOccurrence.AnalysisStatus} analysisStatus + * @memberof grafeas.v1.DiscoveryOccurrence * @instance */ - DeploymentOccurrence.prototype.config = ""; + DiscoveryOccurrence.prototype.analysisStatus = 0; /** - * DeploymentOccurrence address. - * @member {string} address - * @memberof grafeas.v1.DeploymentOccurrence + * DiscoveryOccurrence analysisStatusError. + * @member {google.rpc.IStatus|null|undefined} analysisStatusError + * @memberof grafeas.v1.DiscoveryOccurrence * @instance */ - DeploymentOccurrence.prototype.address = ""; + DiscoveryOccurrence.prototype.analysisStatusError = null; /** - * DeploymentOccurrence resourceUri. - * @member {Array.} resourceUri - * @memberof grafeas.v1.DeploymentOccurrence + * DiscoveryOccurrence cpe. + * @member {string} cpe + * @memberof grafeas.v1.DiscoveryOccurrence * @instance */ - DeploymentOccurrence.prototype.resourceUri = $util.emptyArray; + DiscoveryOccurrence.prototype.cpe = ""; /** - * DeploymentOccurrence platform. - * @member {grafeas.v1.DeploymentOccurrence.Platform} platform - * @memberof grafeas.v1.DeploymentOccurrence + * DiscoveryOccurrence lastScanTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastScanTime + * @memberof grafeas.v1.DiscoveryOccurrence * @instance */ - DeploymentOccurrence.prototype.platform = 0; + DiscoveryOccurrence.prototype.lastScanTime = null; /** - * Creates a new DeploymentOccurrence instance using the specified properties. + * Creates a new DiscoveryOccurrence instance using the specified properties. * @function create - * @memberof grafeas.v1.DeploymentOccurrence + * @memberof grafeas.v1.DiscoveryOccurrence * @static - * @param {grafeas.v1.IDeploymentOccurrence=} [properties] Properties to set - * @returns {grafeas.v1.DeploymentOccurrence} DeploymentOccurrence instance + * @param {grafeas.v1.IDiscoveryOccurrence=} [properties] Properties to set + * @returns {grafeas.v1.DiscoveryOccurrence} DiscoveryOccurrence instance */ - DeploymentOccurrence.create = function create(properties) { - return new DeploymentOccurrence(properties); + DiscoveryOccurrence.create = function create(properties) { + return new DiscoveryOccurrence(properties); }; /** - * Encodes the specified DeploymentOccurrence message. Does not implicitly {@link grafeas.v1.DeploymentOccurrence.verify|verify} messages. + * Encodes the specified DiscoveryOccurrence message. Does not implicitly {@link grafeas.v1.DiscoveryOccurrence.verify|verify} messages. * @function encode - * @memberof grafeas.v1.DeploymentOccurrence + * @memberof grafeas.v1.DiscoveryOccurrence * @static - * @param {grafeas.v1.IDeploymentOccurrence} message DeploymentOccurrence message or plain object to encode + * @param {grafeas.v1.IDiscoveryOccurrence} message DiscoveryOccurrence message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeploymentOccurrence.encode = function encode(message, writer) { + DiscoveryOccurrence.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.userEmail != null && Object.hasOwnProperty.call(message, "userEmail")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.userEmail); - if (message.deployTime != null && Object.hasOwnProperty.call(message, "deployTime")) - $root.google.protobuf.Timestamp.encode(message.deployTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.undeployTime != null && Object.hasOwnProperty.call(message, "undeployTime")) - $root.google.protobuf.Timestamp.encode(message.undeployTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.config != null && Object.hasOwnProperty.call(message, "config")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.config); - if (message.address != null && Object.hasOwnProperty.call(message, "address")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.address); - if (message.resourceUri != null && message.resourceUri.length) - for (var i = 0; i < message.resourceUri.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.resourceUri[i]); - if (message.platform != null && Object.hasOwnProperty.call(message, "platform")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.platform); + if (message.continuousAnalysis != null && Object.hasOwnProperty.call(message, "continuousAnalysis")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.continuousAnalysis); + if (message.analysisStatus != null && Object.hasOwnProperty.call(message, "analysisStatus")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.analysisStatus); + if (message.analysisStatusError != null && Object.hasOwnProperty.call(message, "analysisStatusError")) + $root.google.rpc.Status.encode(message.analysisStatusError, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.cpe != null && Object.hasOwnProperty.call(message, "cpe")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.cpe); + if (message.lastScanTime != null && Object.hasOwnProperty.call(message, "lastScanTime")) + $root.google.protobuf.Timestamp.encode(message.lastScanTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified DeploymentOccurrence message, length delimited. Does not implicitly {@link grafeas.v1.DeploymentOccurrence.verify|verify} messages. + * Encodes the specified DiscoveryOccurrence message, length delimited. Does not implicitly {@link grafeas.v1.DiscoveryOccurrence.verify|verify} messages. * @function encodeDelimited - * @memberof grafeas.v1.DeploymentOccurrence + * @memberof grafeas.v1.DiscoveryOccurrence * @static - * @param {grafeas.v1.IDeploymentOccurrence} message DeploymentOccurrence message or plain object to encode + * @param {grafeas.v1.IDiscoveryOccurrence} message DiscoveryOccurrence message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeploymentOccurrence.encodeDelimited = function encodeDelimited(message, writer) { + DiscoveryOccurrence.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeploymentOccurrence message from the specified reader or buffer. + * Decodes a DiscoveryOccurrence message from the specified reader or buffer. * @function decode - * @memberof grafeas.v1.DeploymentOccurrence + * @memberof grafeas.v1.DiscoveryOccurrence * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {grafeas.v1.DeploymentOccurrence} DeploymentOccurrence + * @returns {grafeas.v1.DiscoveryOccurrence} DiscoveryOccurrence * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeploymentOccurrence.decode = function decode(reader, length) { + DiscoveryOccurrence.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.DeploymentOccurrence(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.DiscoveryOccurrence(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.userEmail = reader.string(); + message.continuousAnalysis = reader.int32(); break; case 2: - message.deployTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.analysisStatus = reader.int32(); break; case 3: - message.undeployTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.analysisStatusError = $root.google.rpc.Status.decode(reader, reader.uint32()); break; case 4: - message.config = reader.string(); + message.cpe = reader.string(); break; case 5: - message.address = reader.string(); - break; - case 6: - if (!(message.resourceUri && message.resourceUri.length)) - message.resourceUri = []; - message.resourceUri.push(reader.string()); - break; - case 7: - message.platform = reader.int32(); + message.lastScanTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -9806,220 +16339,239 @@ }; /** - * Decodes a DeploymentOccurrence message from the specified reader or buffer, length delimited. + * Decodes a DiscoveryOccurrence message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof grafeas.v1.DeploymentOccurrence + * @memberof grafeas.v1.DiscoveryOccurrence * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {grafeas.v1.DeploymentOccurrence} DeploymentOccurrence + * @returns {grafeas.v1.DiscoveryOccurrence} DiscoveryOccurrence * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeploymentOccurrence.decodeDelimited = function decodeDelimited(reader) { + DiscoveryOccurrence.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeploymentOccurrence message. + * Verifies a DiscoveryOccurrence message. * @function verify - * @memberof grafeas.v1.DeploymentOccurrence + * @memberof grafeas.v1.DiscoveryOccurrence * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeploymentOccurrence.verify = function verify(message) { + DiscoveryOccurrence.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.userEmail != null && message.hasOwnProperty("userEmail")) - if (!$util.isString(message.userEmail)) - return "userEmail: string expected"; - if (message.deployTime != null && message.hasOwnProperty("deployTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.deployTime); - if (error) - return "deployTime." + error; - } - if (message.undeployTime != null && message.hasOwnProperty("undeployTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.undeployTime); - if (error) - return "undeployTime." + error; - } - if (message.config != null && message.hasOwnProperty("config")) - if (!$util.isString(message.config)) - return "config: string expected"; - if (message.address != null && message.hasOwnProperty("address")) - if (!$util.isString(message.address)) - return "address: string expected"; - if (message.resourceUri != null && message.hasOwnProperty("resourceUri")) { - if (!Array.isArray(message.resourceUri)) - return "resourceUri: array expected"; - for (var i = 0; i < message.resourceUri.length; ++i) - if (!$util.isString(message.resourceUri[i])) - return "resourceUri: string[] expected"; - } - if (message.platform != null && message.hasOwnProperty("platform")) - switch (message.platform) { + if (message.continuousAnalysis != null && message.hasOwnProperty("continuousAnalysis")) + switch (message.continuousAnalysis) { default: - return "platform: enum value expected"; + return "continuousAnalysis: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.analysisStatus != null && message.hasOwnProperty("analysisStatus")) + switch (message.analysisStatus) { + default: + return "analysisStatus: enum value expected"; case 0: case 1: case 2: case 3: + case 4: + case 5: break; } + if (message.analysisStatusError != null && message.hasOwnProperty("analysisStatusError")) { + var error = $root.google.rpc.Status.verify(message.analysisStatusError); + if (error) + return "analysisStatusError." + error; + } + if (message.cpe != null && message.hasOwnProperty("cpe")) + if (!$util.isString(message.cpe)) + return "cpe: string expected"; + if (message.lastScanTime != null && message.hasOwnProperty("lastScanTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastScanTime); + if (error) + return "lastScanTime." + error; + } return null; }; /** - * Creates a DeploymentOccurrence message from a plain object. Also converts values to their respective internal types. + * Creates a DiscoveryOccurrence message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof grafeas.v1.DeploymentOccurrence + * @memberof grafeas.v1.DiscoveryOccurrence * @static * @param {Object.} object Plain object - * @returns {grafeas.v1.DeploymentOccurrence} DeploymentOccurrence + * @returns {grafeas.v1.DiscoveryOccurrence} DiscoveryOccurrence */ - DeploymentOccurrence.fromObject = function fromObject(object) { - if (object instanceof $root.grafeas.v1.DeploymentOccurrence) + DiscoveryOccurrence.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.DiscoveryOccurrence) return object; - var message = new $root.grafeas.v1.DeploymentOccurrence(); - if (object.userEmail != null) - message.userEmail = String(object.userEmail); - if (object.deployTime != null) { - if (typeof object.deployTime !== "object") - throw TypeError(".grafeas.v1.DeploymentOccurrence.deployTime: object expected"); - message.deployTime = $root.google.protobuf.Timestamp.fromObject(object.deployTime); - } - if (object.undeployTime != null) { - if (typeof object.undeployTime !== "object") - throw TypeError(".grafeas.v1.DeploymentOccurrence.undeployTime: object expected"); - message.undeployTime = $root.google.protobuf.Timestamp.fromObject(object.undeployTime); - } - if (object.config != null) - message.config = String(object.config); - if (object.address != null) - message.address = String(object.address); - if (object.resourceUri) { - if (!Array.isArray(object.resourceUri)) - throw TypeError(".grafeas.v1.DeploymentOccurrence.resourceUri: array expected"); - message.resourceUri = []; - for (var i = 0; i < object.resourceUri.length; ++i) - message.resourceUri[i] = String(object.resourceUri[i]); + var message = new $root.grafeas.v1.DiscoveryOccurrence(); + switch (object.continuousAnalysis) { + case "CONTINUOUS_ANALYSIS_UNSPECIFIED": + case 0: + message.continuousAnalysis = 0; + break; + case "ACTIVE": + case 1: + message.continuousAnalysis = 1; + break; + case "INACTIVE": + case 2: + message.continuousAnalysis = 2; + break; } - switch (object.platform) { - case "PLATFORM_UNSPECIFIED": + switch (object.analysisStatus) { + case "ANALYSIS_STATUS_UNSPECIFIED": case 0: - message.platform = 0; + message.analysisStatus = 0; break; - case "GKE": + case "PENDING": case 1: - message.platform = 1; + message.analysisStatus = 1; break; - case "FLEX": + case "SCANNING": case 2: - message.platform = 2; + message.analysisStatus = 2; break; - case "CUSTOM": + case "FINISHED_SUCCESS": case 3: - message.platform = 3; + message.analysisStatus = 3; + break; + case "FINISHED_FAILED": + case 4: + message.analysisStatus = 4; + break; + case "FINISHED_UNSUPPORTED": + case 5: + message.analysisStatus = 5; break; } + if (object.analysisStatusError != null) { + if (typeof object.analysisStatusError !== "object") + throw TypeError(".grafeas.v1.DiscoveryOccurrence.analysisStatusError: object expected"); + message.analysisStatusError = $root.google.rpc.Status.fromObject(object.analysisStatusError); + } + if (object.cpe != null) + message.cpe = String(object.cpe); + if (object.lastScanTime != null) { + if (typeof object.lastScanTime !== "object") + throw TypeError(".grafeas.v1.DiscoveryOccurrence.lastScanTime: object expected"); + message.lastScanTime = $root.google.protobuf.Timestamp.fromObject(object.lastScanTime); + } return message; }; /** - * Creates a plain object from a DeploymentOccurrence message. Also converts values to other types if specified. + * Creates a plain object from a DiscoveryOccurrence message. Also converts values to other types if specified. * @function toObject - * @memberof grafeas.v1.DeploymentOccurrence + * @memberof grafeas.v1.DiscoveryOccurrence * @static - * @param {grafeas.v1.DeploymentOccurrence} message DeploymentOccurrence + * @param {grafeas.v1.DiscoveryOccurrence} message DiscoveryOccurrence * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeploymentOccurrence.toObject = function toObject(message, options) { + DiscoveryOccurrence.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.resourceUri = []; if (options.defaults) { - object.userEmail = ""; - object.deployTime = null; - object.undeployTime = null; - object.config = ""; - object.address = ""; - object.platform = options.enums === String ? "PLATFORM_UNSPECIFIED" : 0; - } - if (message.userEmail != null && message.hasOwnProperty("userEmail")) - object.userEmail = message.userEmail; - if (message.deployTime != null && message.hasOwnProperty("deployTime")) - object.deployTime = $root.google.protobuf.Timestamp.toObject(message.deployTime, options); - if (message.undeployTime != null && message.hasOwnProperty("undeployTime")) - object.undeployTime = $root.google.protobuf.Timestamp.toObject(message.undeployTime, options); - if (message.config != null && message.hasOwnProperty("config")) - object.config = message.config; - if (message.address != null && message.hasOwnProperty("address")) - object.address = message.address; - if (message.resourceUri && message.resourceUri.length) { - object.resourceUri = []; - for (var j = 0; j < message.resourceUri.length; ++j) - object.resourceUri[j] = message.resourceUri[j]; + object.continuousAnalysis = options.enums === String ? "CONTINUOUS_ANALYSIS_UNSPECIFIED" : 0; + object.analysisStatus = options.enums === String ? "ANALYSIS_STATUS_UNSPECIFIED" : 0; + object.analysisStatusError = null; + object.cpe = ""; + object.lastScanTime = null; } - if (message.platform != null && message.hasOwnProperty("platform")) - object.platform = options.enums === String ? $root.grafeas.v1.DeploymentOccurrence.Platform[message.platform] : message.platform; + if (message.continuousAnalysis != null && message.hasOwnProperty("continuousAnalysis")) + object.continuousAnalysis = options.enums === String ? $root.grafeas.v1.DiscoveryOccurrence.ContinuousAnalysis[message.continuousAnalysis] : message.continuousAnalysis; + if (message.analysisStatus != null && message.hasOwnProperty("analysisStatus")) + object.analysisStatus = options.enums === String ? $root.grafeas.v1.DiscoveryOccurrence.AnalysisStatus[message.analysisStatus] : message.analysisStatus; + if (message.analysisStatusError != null && message.hasOwnProperty("analysisStatusError")) + object.analysisStatusError = $root.google.rpc.Status.toObject(message.analysisStatusError, options); + if (message.cpe != null && message.hasOwnProperty("cpe")) + object.cpe = message.cpe; + if (message.lastScanTime != null && message.hasOwnProperty("lastScanTime")) + object.lastScanTime = $root.google.protobuf.Timestamp.toObject(message.lastScanTime, options); return object; }; /** - * Converts this DeploymentOccurrence to JSON. + * Converts this DiscoveryOccurrence to JSON. * @function toJSON - * @memberof grafeas.v1.DeploymentOccurrence + * @memberof grafeas.v1.DiscoveryOccurrence * @instance * @returns {Object.} JSON object */ - DeploymentOccurrence.prototype.toJSON = function toJSON() { + DiscoveryOccurrence.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Platform enum. - * @name grafeas.v1.DeploymentOccurrence.Platform + * ContinuousAnalysis enum. + * @name grafeas.v1.DiscoveryOccurrence.ContinuousAnalysis * @enum {number} - * @property {number} PLATFORM_UNSPECIFIED=0 PLATFORM_UNSPECIFIED value - * @property {number} GKE=1 GKE value - * @property {number} FLEX=2 FLEX value - * @property {number} CUSTOM=3 CUSTOM value + * @property {number} CONTINUOUS_ANALYSIS_UNSPECIFIED=0 CONTINUOUS_ANALYSIS_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} INACTIVE=2 INACTIVE value */ - DeploymentOccurrence.Platform = (function() { + DiscoveryOccurrence.ContinuousAnalysis = (function() { var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PLATFORM_UNSPECIFIED"] = 0; - values[valuesById[1] = "GKE"] = 1; - values[valuesById[2] = "FLEX"] = 2; - values[valuesById[3] = "CUSTOM"] = 3; + values[valuesById[0] = "CONTINUOUS_ANALYSIS_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "INACTIVE"] = 2; return values; })(); - return DeploymentOccurrence; + /** + * AnalysisStatus enum. + * @name grafeas.v1.DiscoveryOccurrence.AnalysisStatus + * @enum {number} + * @property {number} ANALYSIS_STATUS_UNSPECIFIED=0 ANALYSIS_STATUS_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} SCANNING=2 SCANNING value + * @property {number} FINISHED_SUCCESS=3 FINISHED_SUCCESS value + * @property {number} FINISHED_FAILED=4 FINISHED_FAILED value + * @property {number} FINISHED_UNSUPPORTED=5 FINISHED_UNSUPPORTED value + */ + DiscoveryOccurrence.AnalysisStatus = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ANALYSIS_STATUS_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "SCANNING"] = 2; + values[valuesById[3] = "FINISHED_SUCCESS"] = 3; + values[valuesById[4] = "FINISHED_FAILED"] = 4; + values[valuesById[5] = "FINISHED_UNSUPPORTED"] = 5; + return values; + })(); + + return DiscoveryOccurrence; })(); - v1.DiscoveryNote = (function() { + v1.DSSEAttestationNote = (function() { /** - * Properties of a DiscoveryNote. + * Properties of a DSSEAttestationNote. * @memberof grafeas.v1 - * @interface IDiscoveryNote - * @property {grafeas.v1.NoteKind|null} [analysisKind] DiscoveryNote analysisKind + * @interface IDSSEAttestationNote + * @property {grafeas.v1.DSSEAttestationNote.IDSSEHint|null} [hint] DSSEAttestationNote hint */ /** - * Constructs a new DiscoveryNote. + * Constructs a new DSSEAttestationNote. * @memberof grafeas.v1 - * @classdesc Represents a DiscoveryNote. - * @implements IDiscoveryNote + * @classdesc Represents a DSSEAttestationNote. + * @implements IDSSEAttestationNote * @constructor - * @param {grafeas.v1.IDiscoveryNote=} [properties] Properties to set + * @param {grafeas.v1.IDSSEAttestationNote=} [properties] Properties to set */ - function DiscoveryNote(properties) { + function DSSEAttestationNote(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10027,75 +16579,75 @@ } /** - * DiscoveryNote analysisKind. - * @member {grafeas.v1.NoteKind} analysisKind - * @memberof grafeas.v1.DiscoveryNote + * DSSEAttestationNote hint. + * @member {grafeas.v1.DSSEAttestationNote.IDSSEHint|null|undefined} hint + * @memberof grafeas.v1.DSSEAttestationNote * @instance */ - DiscoveryNote.prototype.analysisKind = 0; + DSSEAttestationNote.prototype.hint = null; /** - * Creates a new DiscoveryNote instance using the specified properties. + * Creates a new DSSEAttestationNote instance using the specified properties. * @function create - * @memberof grafeas.v1.DiscoveryNote + * @memberof grafeas.v1.DSSEAttestationNote * @static - * @param {grafeas.v1.IDiscoveryNote=} [properties] Properties to set - * @returns {grafeas.v1.DiscoveryNote} DiscoveryNote instance + * @param {grafeas.v1.IDSSEAttestationNote=} [properties] Properties to set + * @returns {grafeas.v1.DSSEAttestationNote} DSSEAttestationNote instance */ - DiscoveryNote.create = function create(properties) { - return new DiscoveryNote(properties); + DSSEAttestationNote.create = function create(properties) { + return new DSSEAttestationNote(properties); }; /** - * Encodes the specified DiscoveryNote message. Does not implicitly {@link grafeas.v1.DiscoveryNote.verify|verify} messages. + * Encodes the specified DSSEAttestationNote message. Does not implicitly {@link grafeas.v1.DSSEAttestationNote.verify|verify} messages. * @function encode - * @memberof grafeas.v1.DiscoveryNote + * @memberof grafeas.v1.DSSEAttestationNote * @static - * @param {grafeas.v1.IDiscoveryNote} message DiscoveryNote message or plain object to encode + * @param {grafeas.v1.IDSSEAttestationNote} message DSSEAttestationNote message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DiscoveryNote.encode = function encode(message, writer) { + DSSEAttestationNote.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.analysisKind != null && Object.hasOwnProperty.call(message, "analysisKind")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.analysisKind); + if (message.hint != null && Object.hasOwnProperty.call(message, "hint")) + $root.grafeas.v1.DSSEAttestationNote.DSSEHint.encode(message.hint, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified DiscoveryNote message, length delimited. Does not implicitly {@link grafeas.v1.DiscoveryNote.verify|verify} messages. + * Encodes the specified DSSEAttestationNote message, length delimited. Does not implicitly {@link grafeas.v1.DSSEAttestationNote.verify|verify} messages. * @function encodeDelimited - * @memberof grafeas.v1.DiscoveryNote + * @memberof grafeas.v1.DSSEAttestationNote * @static - * @param {grafeas.v1.IDiscoveryNote} message DiscoveryNote message or plain object to encode + * @param {grafeas.v1.IDSSEAttestationNote} message DSSEAttestationNote message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DiscoveryNote.encodeDelimited = function encodeDelimited(message, writer) { + DSSEAttestationNote.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DiscoveryNote message from the specified reader or buffer. + * Decodes a DSSEAttestationNote message from the specified reader or buffer. * @function decode - * @memberof grafeas.v1.DiscoveryNote + * @memberof grafeas.v1.DSSEAttestationNote * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {grafeas.v1.DiscoveryNote} DiscoveryNote + * @returns {grafeas.v1.DSSEAttestationNote} DSSEAttestationNote * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DiscoveryNote.decode = function decode(reader, length) { + DSSEAttestationNote.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.DiscoveryNote(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.DSSEAttestationNote(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.analysisKind = reader.int32(); + message.hint = $root.grafeas.v1.DSSEAttestationNote.DSSEHint.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -10106,159 +16658,300 @@ }; /** - * Decodes a DiscoveryNote message from the specified reader or buffer, length delimited. + * Decodes a DSSEAttestationNote message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof grafeas.v1.DiscoveryNote + * @memberof grafeas.v1.DSSEAttestationNote * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {grafeas.v1.DiscoveryNote} DiscoveryNote + * @returns {grafeas.v1.DSSEAttestationNote} DSSEAttestationNote * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DiscoveryNote.decodeDelimited = function decodeDelimited(reader) { + DSSEAttestationNote.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DiscoveryNote message. - * @function verify - * @memberof grafeas.v1.DiscoveryNote - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DiscoveryNote.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.analysisKind != null && message.hasOwnProperty("analysisKind")) - switch (message.analysisKind) { - default: - return "analysisKind: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - return null; - }; - - /** - * Creates a DiscoveryNote message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof grafeas.v1.DiscoveryNote - * @static - * @param {Object.} object Plain object - * @returns {grafeas.v1.DiscoveryNote} DiscoveryNote - */ - DiscoveryNote.fromObject = function fromObject(object) { - if (object instanceof $root.grafeas.v1.DiscoveryNote) - return object; - var message = new $root.grafeas.v1.DiscoveryNote(); - switch (object.analysisKind) { - case "NOTE_KIND_UNSPECIFIED": - case 0: - message.analysisKind = 0; - break; - case "VULNERABILITY": - case 1: - message.analysisKind = 1; - break; - case "BUILD": - case 2: - message.analysisKind = 2; - break; - case "IMAGE": - case 3: - message.analysisKind = 3; - break; - case "PACKAGE": - case 4: - message.analysisKind = 4; - break; - case "DEPLOYMENT": - case 5: - message.analysisKind = 5; - break; - case "DISCOVERY": - case 6: - message.analysisKind = 6; - break; - case "ATTESTATION": - case 7: - message.analysisKind = 7; - break; - case "UPGRADE": - case 8: - message.analysisKind = 8; - break; + }; + + /** + * Verifies a DSSEAttestationNote message. + * @function verify + * @memberof grafeas.v1.DSSEAttestationNote + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DSSEAttestationNote.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hint != null && message.hasOwnProperty("hint")) { + var error = $root.grafeas.v1.DSSEAttestationNote.DSSEHint.verify(message.hint); + if (error) + return "hint." + error; + } + return null; + }; + + /** + * Creates a DSSEAttestationNote message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof grafeas.v1.DSSEAttestationNote + * @static + * @param {Object.} object Plain object + * @returns {grafeas.v1.DSSEAttestationNote} DSSEAttestationNote + */ + DSSEAttestationNote.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.DSSEAttestationNote) + return object; + var message = new $root.grafeas.v1.DSSEAttestationNote(); + if (object.hint != null) { + if (typeof object.hint !== "object") + throw TypeError(".grafeas.v1.DSSEAttestationNote.hint: object expected"); + message.hint = $root.grafeas.v1.DSSEAttestationNote.DSSEHint.fromObject(object.hint); } return message; }; /** - * Creates a plain object from a DiscoveryNote message. Also converts values to other types if specified. + * Creates a plain object from a DSSEAttestationNote message. Also converts values to other types if specified. * @function toObject - * @memberof grafeas.v1.DiscoveryNote + * @memberof grafeas.v1.DSSEAttestationNote * @static - * @param {grafeas.v1.DiscoveryNote} message DiscoveryNote + * @param {grafeas.v1.DSSEAttestationNote} message DSSEAttestationNote * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DiscoveryNote.toObject = function toObject(message, options) { + DSSEAttestationNote.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.analysisKind = options.enums === String ? "NOTE_KIND_UNSPECIFIED" : 0; - if (message.analysisKind != null && message.hasOwnProperty("analysisKind")) - object.analysisKind = options.enums === String ? $root.grafeas.v1.NoteKind[message.analysisKind] : message.analysisKind; + object.hint = null; + if (message.hint != null && message.hasOwnProperty("hint")) + object.hint = $root.grafeas.v1.DSSEAttestationNote.DSSEHint.toObject(message.hint, options); return object; }; /** - * Converts this DiscoveryNote to JSON. + * Converts this DSSEAttestationNote to JSON. * @function toJSON - * @memberof grafeas.v1.DiscoveryNote + * @memberof grafeas.v1.DSSEAttestationNote * @instance * @returns {Object.} JSON object */ - DiscoveryNote.prototype.toJSON = function toJSON() { + DSSEAttestationNote.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DiscoveryNote; + DSSEAttestationNote.DSSEHint = (function() { + + /** + * Properties of a DSSEHint. + * @memberof grafeas.v1.DSSEAttestationNote + * @interface IDSSEHint + * @property {string|null} [humanReadableName] DSSEHint humanReadableName + */ + + /** + * Constructs a new DSSEHint. + * @memberof grafeas.v1.DSSEAttestationNote + * @classdesc Represents a DSSEHint. + * @implements IDSSEHint + * @constructor + * @param {grafeas.v1.DSSEAttestationNote.IDSSEHint=} [properties] Properties to set + */ + function DSSEHint(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DSSEHint humanReadableName. + * @member {string} humanReadableName + * @memberof grafeas.v1.DSSEAttestationNote.DSSEHint + * @instance + */ + DSSEHint.prototype.humanReadableName = ""; + + /** + * Creates a new DSSEHint instance using the specified properties. + * @function create + * @memberof grafeas.v1.DSSEAttestationNote.DSSEHint + * @static + * @param {grafeas.v1.DSSEAttestationNote.IDSSEHint=} [properties] Properties to set + * @returns {grafeas.v1.DSSEAttestationNote.DSSEHint} DSSEHint instance + */ + DSSEHint.create = function create(properties) { + return new DSSEHint(properties); + }; + + /** + * Encodes the specified DSSEHint message. Does not implicitly {@link grafeas.v1.DSSEAttestationNote.DSSEHint.verify|verify} messages. + * @function encode + * @memberof grafeas.v1.DSSEAttestationNote.DSSEHint + * @static + * @param {grafeas.v1.DSSEAttestationNote.IDSSEHint} message DSSEHint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DSSEHint.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.humanReadableName != null && Object.hasOwnProperty.call(message, "humanReadableName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.humanReadableName); + return writer; + }; + + /** + * Encodes the specified DSSEHint message, length delimited. Does not implicitly {@link grafeas.v1.DSSEAttestationNote.DSSEHint.verify|verify} messages. + * @function encodeDelimited + * @memberof grafeas.v1.DSSEAttestationNote.DSSEHint + * @static + * @param {grafeas.v1.DSSEAttestationNote.IDSSEHint} message DSSEHint message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DSSEHint.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DSSEHint message from the specified reader or buffer. + * @function decode + * @memberof grafeas.v1.DSSEAttestationNote.DSSEHint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {grafeas.v1.DSSEAttestationNote.DSSEHint} DSSEHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DSSEHint.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.DSSEAttestationNote.DSSEHint(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.humanReadableName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DSSEHint message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof grafeas.v1.DSSEAttestationNote.DSSEHint + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {grafeas.v1.DSSEAttestationNote.DSSEHint} DSSEHint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DSSEHint.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DSSEHint message. + * @function verify + * @memberof grafeas.v1.DSSEAttestationNote.DSSEHint + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DSSEHint.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.humanReadableName != null && message.hasOwnProperty("humanReadableName")) + if (!$util.isString(message.humanReadableName)) + return "humanReadableName: string expected"; + return null; + }; + + /** + * Creates a DSSEHint message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof grafeas.v1.DSSEAttestationNote.DSSEHint + * @static + * @param {Object.} object Plain object + * @returns {grafeas.v1.DSSEAttestationNote.DSSEHint} DSSEHint + */ + DSSEHint.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.DSSEAttestationNote.DSSEHint) + return object; + var message = new $root.grafeas.v1.DSSEAttestationNote.DSSEHint(); + if (object.humanReadableName != null) + message.humanReadableName = String(object.humanReadableName); + return message; + }; + + /** + * Creates a plain object from a DSSEHint message. Also converts values to other types if specified. + * @function toObject + * @memberof grafeas.v1.DSSEAttestationNote.DSSEHint + * @static + * @param {grafeas.v1.DSSEAttestationNote.DSSEHint} message DSSEHint + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DSSEHint.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.humanReadableName = ""; + if (message.humanReadableName != null && message.hasOwnProperty("humanReadableName")) + object.humanReadableName = message.humanReadableName; + return object; + }; + + /** + * Converts this DSSEHint to JSON. + * @function toJSON + * @memberof grafeas.v1.DSSEAttestationNote.DSSEHint + * @instance + * @returns {Object.} JSON object + */ + DSSEHint.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DSSEHint; + })(); + + return DSSEAttestationNote; })(); - v1.DiscoveryOccurrence = (function() { + v1.DSSEAttestationOccurrence = (function() { /** - * Properties of a DiscoveryOccurrence. + * Properties of a DSSEAttestationOccurrence. * @memberof grafeas.v1 - * @interface IDiscoveryOccurrence - * @property {grafeas.v1.DiscoveryOccurrence.ContinuousAnalysis|null} [continuousAnalysis] DiscoveryOccurrence continuousAnalysis - * @property {grafeas.v1.DiscoveryOccurrence.AnalysisStatus|null} [analysisStatus] DiscoveryOccurrence analysisStatus - * @property {google.rpc.IStatus|null} [analysisStatusError] DiscoveryOccurrence analysisStatusError - * @property {string|null} [cpe] DiscoveryOccurrence cpe - * @property {google.protobuf.ITimestamp|null} [lastScanTime] DiscoveryOccurrence lastScanTime + * @interface IDSSEAttestationOccurrence + * @property {grafeas.v1.IEnvelope|null} [envelope] DSSEAttestationOccurrence envelope + * @property {grafeas.v1.IInTotoStatement|null} [statement] DSSEAttestationOccurrence statement */ /** - * Constructs a new DiscoveryOccurrence. + * Constructs a new DSSEAttestationOccurrence. * @memberof grafeas.v1 - * @classdesc Represents a DiscoveryOccurrence. - * @implements IDiscoveryOccurrence + * @classdesc Represents a DSSEAttestationOccurrence. + * @implements IDSSEAttestationOccurrence * @constructor - * @param {grafeas.v1.IDiscoveryOccurrence=} [properties] Properties to set + * @param {grafeas.v1.IDSSEAttestationOccurrence=} [properties] Properties to set */ - function DiscoveryOccurrence(properties) { + function DSSEAttestationOccurrence(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10266,127 +16959,102 @@ } /** - * DiscoveryOccurrence continuousAnalysis. - * @member {grafeas.v1.DiscoveryOccurrence.ContinuousAnalysis} continuousAnalysis - * @memberof grafeas.v1.DiscoveryOccurrence - * @instance - */ - DiscoveryOccurrence.prototype.continuousAnalysis = 0; - - /** - * DiscoveryOccurrence analysisStatus. - * @member {grafeas.v1.DiscoveryOccurrence.AnalysisStatus} analysisStatus - * @memberof grafeas.v1.DiscoveryOccurrence + * DSSEAttestationOccurrence envelope. + * @member {grafeas.v1.IEnvelope|null|undefined} envelope + * @memberof grafeas.v1.DSSEAttestationOccurrence * @instance */ - DiscoveryOccurrence.prototype.analysisStatus = 0; + DSSEAttestationOccurrence.prototype.envelope = null; /** - * DiscoveryOccurrence analysisStatusError. - * @member {google.rpc.IStatus|null|undefined} analysisStatusError - * @memberof grafeas.v1.DiscoveryOccurrence + * DSSEAttestationOccurrence statement. + * @member {grafeas.v1.IInTotoStatement|null|undefined} statement + * @memberof grafeas.v1.DSSEAttestationOccurrence * @instance */ - DiscoveryOccurrence.prototype.analysisStatusError = null; + DSSEAttestationOccurrence.prototype.statement = null; - /** - * DiscoveryOccurrence cpe. - * @member {string} cpe - * @memberof grafeas.v1.DiscoveryOccurrence - * @instance - */ - DiscoveryOccurrence.prototype.cpe = ""; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * DiscoveryOccurrence lastScanTime. - * @member {google.protobuf.ITimestamp|null|undefined} lastScanTime - * @memberof grafeas.v1.DiscoveryOccurrence + * DSSEAttestationOccurrence decodedPayload. + * @member {"statement"|undefined} decodedPayload + * @memberof grafeas.v1.DSSEAttestationOccurrence * @instance */ - DiscoveryOccurrence.prototype.lastScanTime = null; + Object.defineProperty(DSSEAttestationOccurrence.prototype, "decodedPayload", { + get: $util.oneOfGetter($oneOfFields = ["statement"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new DiscoveryOccurrence instance using the specified properties. + * Creates a new DSSEAttestationOccurrence instance using the specified properties. * @function create - * @memberof grafeas.v1.DiscoveryOccurrence + * @memberof grafeas.v1.DSSEAttestationOccurrence * @static - * @param {grafeas.v1.IDiscoveryOccurrence=} [properties] Properties to set - * @returns {grafeas.v1.DiscoveryOccurrence} DiscoveryOccurrence instance + * @param {grafeas.v1.IDSSEAttestationOccurrence=} [properties] Properties to set + * @returns {grafeas.v1.DSSEAttestationOccurrence} DSSEAttestationOccurrence instance */ - DiscoveryOccurrence.create = function create(properties) { - return new DiscoveryOccurrence(properties); + DSSEAttestationOccurrence.create = function create(properties) { + return new DSSEAttestationOccurrence(properties); }; /** - * Encodes the specified DiscoveryOccurrence message. Does not implicitly {@link grafeas.v1.DiscoveryOccurrence.verify|verify} messages. + * Encodes the specified DSSEAttestationOccurrence message. Does not implicitly {@link grafeas.v1.DSSEAttestationOccurrence.verify|verify} messages. * @function encode - * @memberof grafeas.v1.DiscoveryOccurrence + * @memberof grafeas.v1.DSSEAttestationOccurrence * @static - * @param {grafeas.v1.IDiscoveryOccurrence} message DiscoveryOccurrence message or plain object to encode + * @param {grafeas.v1.IDSSEAttestationOccurrence} message DSSEAttestationOccurrence message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DiscoveryOccurrence.encode = function encode(message, writer) { + DSSEAttestationOccurrence.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.continuousAnalysis != null && Object.hasOwnProperty.call(message, "continuousAnalysis")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.continuousAnalysis); - if (message.analysisStatus != null && Object.hasOwnProperty.call(message, "analysisStatus")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.analysisStatus); - if (message.analysisStatusError != null && Object.hasOwnProperty.call(message, "analysisStatusError")) - $root.google.rpc.Status.encode(message.analysisStatusError, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.cpe != null && Object.hasOwnProperty.call(message, "cpe")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.cpe); - if (message.lastScanTime != null && Object.hasOwnProperty.call(message, "lastScanTime")) - $root.google.protobuf.Timestamp.encode(message.lastScanTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.envelope != null && Object.hasOwnProperty.call(message, "envelope")) + $root.grafeas.v1.Envelope.encode(message.envelope, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.statement != null && Object.hasOwnProperty.call(message, "statement")) + $root.grafeas.v1.InTotoStatement.encode(message.statement, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified DiscoveryOccurrence message, length delimited. Does not implicitly {@link grafeas.v1.DiscoveryOccurrence.verify|verify} messages. + * Encodes the specified DSSEAttestationOccurrence message, length delimited. Does not implicitly {@link grafeas.v1.DSSEAttestationOccurrence.verify|verify} messages. * @function encodeDelimited - * @memberof grafeas.v1.DiscoveryOccurrence + * @memberof grafeas.v1.DSSEAttestationOccurrence * @static - * @param {grafeas.v1.IDiscoveryOccurrence} message DiscoveryOccurrence message or plain object to encode + * @param {grafeas.v1.IDSSEAttestationOccurrence} message DSSEAttestationOccurrence message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DiscoveryOccurrence.encodeDelimited = function encodeDelimited(message, writer) { + DSSEAttestationOccurrence.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DiscoveryOccurrence message from the specified reader or buffer. + * Decodes a DSSEAttestationOccurrence message from the specified reader or buffer. * @function decode - * @memberof grafeas.v1.DiscoveryOccurrence + * @memberof grafeas.v1.DSSEAttestationOccurrence * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {grafeas.v1.DiscoveryOccurrence} DiscoveryOccurrence + * @returns {grafeas.v1.DSSEAttestationOccurrence} DSSEAttestationOccurrence * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DiscoveryOccurrence.decode = function decode(reader, length) { + DSSEAttestationOccurrence.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.DiscoveryOccurrence(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.grafeas.v1.DSSEAttestationOccurrence(); while (reader.pos < end) { var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.continuousAnalysis = reader.int32(); - break; - case 2: - message.analysisStatus = reader.int32(); - break; - case 3: - message.analysisStatusError = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - case 4: - message.cpe = reader.string(); + switch (tag >>> 3) { + case 1: + message.envelope = $root.grafeas.v1.Envelope.decode(reader, reader.uint32()); break; - case 5: - message.lastScanTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + case 2: + message.statement = $root.grafeas.v1.InTotoStatement.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -10397,219 +17065,111 @@ }; /** - * Decodes a DiscoveryOccurrence message from the specified reader or buffer, length delimited. + * Decodes a DSSEAttestationOccurrence message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof grafeas.v1.DiscoveryOccurrence + * @memberof grafeas.v1.DSSEAttestationOccurrence * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {grafeas.v1.DiscoveryOccurrence} DiscoveryOccurrence + * @returns {grafeas.v1.DSSEAttestationOccurrence} DSSEAttestationOccurrence * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DiscoveryOccurrence.decodeDelimited = function decodeDelimited(reader) { + DSSEAttestationOccurrence.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DiscoveryOccurrence message. + * Verifies a DSSEAttestationOccurrence message. * @function verify - * @memberof grafeas.v1.DiscoveryOccurrence + * @memberof grafeas.v1.DSSEAttestationOccurrence * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DiscoveryOccurrence.verify = function verify(message) { + DSSEAttestationOccurrence.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.continuousAnalysis != null && message.hasOwnProperty("continuousAnalysis")) - switch (message.continuousAnalysis) { - default: - return "continuousAnalysis: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.analysisStatus != null && message.hasOwnProperty("analysisStatus")) - switch (message.analysisStatus) { - default: - return "analysisStatus: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.analysisStatusError != null && message.hasOwnProperty("analysisStatusError")) { - var error = $root.google.rpc.Status.verify(message.analysisStatusError); + var properties = {}; + if (message.envelope != null && message.hasOwnProperty("envelope")) { + var error = $root.grafeas.v1.Envelope.verify(message.envelope); if (error) - return "analysisStatusError." + error; + return "envelope." + error; } - if (message.cpe != null && message.hasOwnProperty("cpe")) - if (!$util.isString(message.cpe)) - return "cpe: string expected"; - if (message.lastScanTime != null && message.hasOwnProperty("lastScanTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.lastScanTime); - if (error) - return "lastScanTime." + error; + if (message.statement != null && message.hasOwnProperty("statement")) { + properties.decodedPayload = 1; + { + var error = $root.grafeas.v1.InTotoStatement.verify(message.statement); + if (error) + return "statement." + error; + } } return null; }; /** - * Creates a DiscoveryOccurrence message from a plain object. Also converts values to their respective internal types. + * Creates a DSSEAttestationOccurrence message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof grafeas.v1.DiscoveryOccurrence + * @memberof grafeas.v1.DSSEAttestationOccurrence * @static * @param {Object.} object Plain object - * @returns {grafeas.v1.DiscoveryOccurrence} DiscoveryOccurrence + * @returns {grafeas.v1.DSSEAttestationOccurrence} DSSEAttestationOccurrence */ - DiscoveryOccurrence.fromObject = function fromObject(object) { - if (object instanceof $root.grafeas.v1.DiscoveryOccurrence) + DSSEAttestationOccurrence.fromObject = function fromObject(object) { + if (object instanceof $root.grafeas.v1.DSSEAttestationOccurrence) return object; - var message = new $root.grafeas.v1.DiscoveryOccurrence(); - switch (object.continuousAnalysis) { - case "CONTINUOUS_ANALYSIS_UNSPECIFIED": - case 0: - message.continuousAnalysis = 0; - break; - case "ACTIVE": - case 1: - message.continuousAnalysis = 1; - break; - case "INACTIVE": - case 2: - message.continuousAnalysis = 2; - break; - } - switch (object.analysisStatus) { - case "ANALYSIS_STATUS_UNSPECIFIED": - case 0: - message.analysisStatus = 0; - break; - case "PENDING": - case 1: - message.analysisStatus = 1; - break; - case "SCANNING": - case 2: - message.analysisStatus = 2; - break; - case "FINISHED_SUCCESS": - case 3: - message.analysisStatus = 3; - break; - case "FINISHED_FAILED": - case 4: - message.analysisStatus = 4; - break; - case "FINISHED_UNSUPPORTED": - case 5: - message.analysisStatus = 5; - break; - } - if (object.analysisStatusError != null) { - if (typeof object.analysisStatusError !== "object") - throw TypeError(".grafeas.v1.DiscoveryOccurrence.analysisStatusError: object expected"); - message.analysisStatusError = $root.google.rpc.Status.fromObject(object.analysisStatusError); + var message = new $root.grafeas.v1.DSSEAttestationOccurrence(); + if (object.envelope != null) { + if (typeof object.envelope !== "object") + throw TypeError(".grafeas.v1.DSSEAttestationOccurrence.envelope: object expected"); + message.envelope = $root.grafeas.v1.Envelope.fromObject(object.envelope); } - if (object.cpe != null) - message.cpe = String(object.cpe); - if (object.lastScanTime != null) { - if (typeof object.lastScanTime !== "object") - throw TypeError(".grafeas.v1.DiscoveryOccurrence.lastScanTime: object expected"); - message.lastScanTime = $root.google.protobuf.Timestamp.fromObject(object.lastScanTime); + if (object.statement != null) { + if (typeof object.statement !== "object") + throw TypeError(".grafeas.v1.DSSEAttestationOccurrence.statement: object expected"); + message.statement = $root.grafeas.v1.InTotoStatement.fromObject(object.statement); } return message; }; /** - * Creates a plain object from a DiscoveryOccurrence message. Also converts values to other types if specified. + * Creates a plain object from a DSSEAttestationOccurrence message. Also converts values to other types if specified. * @function toObject - * @memberof grafeas.v1.DiscoveryOccurrence + * @memberof grafeas.v1.DSSEAttestationOccurrence * @static - * @param {grafeas.v1.DiscoveryOccurrence} message DiscoveryOccurrence + * @param {grafeas.v1.DSSEAttestationOccurrence} message DSSEAttestationOccurrence * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DiscoveryOccurrence.toObject = function toObject(message, options) { + DSSEAttestationOccurrence.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.continuousAnalysis = options.enums === String ? "CONTINUOUS_ANALYSIS_UNSPECIFIED" : 0; - object.analysisStatus = options.enums === String ? "ANALYSIS_STATUS_UNSPECIFIED" : 0; - object.analysisStatusError = null; - object.cpe = ""; - object.lastScanTime = null; + if (options.defaults) + object.envelope = null; + if (message.envelope != null && message.hasOwnProperty("envelope")) + object.envelope = $root.grafeas.v1.Envelope.toObject(message.envelope, options); + if (message.statement != null && message.hasOwnProperty("statement")) { + object.statement = $root.grafeas.v1.InTotoStatement.toObject(message.statement, options); + if (options.oneofs) + object.decodedPayload = "statement"; } - if (message.continuousAnalysis != null && message.hasOwnProperty("continuousAnalysis")) - object.continuousAnalysis = options.enums === String ? $root.grafeas.v1.DiscoveryOccurrence.ContinuousAnalysis[message.continuousAnalysis] : message.continuousAnalysis; - if (message.analysisStatus != null && message.hasOwnProperty("analysisStatus")) - object.analysisStatus = options.enums === String ? $root.grafeas.v1.DiscoveryOccurrence.AnalysisStatus[message.analysisStatus] : message.analysisStatus; - if (message.analysisStatusError != null && message.hasOwnProperty("analysisStatusError")) - object.analysisStatusError = $root.google.rpc.Status.toObject(message.analysisStatusError, options); - if (message.cpe != null && message.hasOwnProperty("cpe")) - object.cpe = message.cpe; - if (message.lastScanTime != null && message.hasOwnProperty("lastScanTime")) - object.lastScanTime = $root.google.protobuf.Timestamp.toObject(message.lastScanTime, options); return object; }; /** - * Converts this DiscoveryOccurrence to JSON. + * Converts this DSSEAttestationOccurrence to JSON. * @function toJSON - * @memberof grafeas.v1.DiscoveryOccurrence + * @memberof grafeas.v1.DSSEAttestationOccurrence * @instance * @returns {Object.} JSON object */ - DiscoveryOccurrence.prototype.toJSON = function toJSON() { + DSSEAttestationOccurrence.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * ContinuousAnalysis enum. - * @name grafeas.v1.DiscoveryOccurrence.ContinuousAnalysis - * @enum {number} - * @property {number} CONTINUOUS_ANALYSIS_UNSPECIFIED=0 CONTINUOUS_ANALYSIS_UNSPECIFIED value - * @property {number} ACTIVE=1 ACTIVE value - * @property {number} INACTIVE=2 INACTIVE value - */ - DiscoveryOccurrence.ContinuousAnalysis = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CONTINUOUS_ANALYSIS_UNSPECIFIED"] = 0; - values[valuesById[1] = "ACTIVE"] = 1; - values[valuesById[2] = "INACTIVE"] = 2; - return values; - })(); - - /** - * AnalysisStatus enum. - * @name grafeas.v1.DiscoveryOccurrence.AnalysisStatus - * @enum {number} - * @property {number} ANALYSIS_STATUS_UNSPECIFIED=0 ANALYSIS_STATUS_UNSPECIFIED value - * @property {number} PENDING=1 PENDING value - * @property {number} SCANNING=2 SCANNING value - * @property {number} FINISHED_SUCCESS=3 FINISHED_SUCCESS value - * @property {number} FINISHED_FAILED=4 FINISHED_FAILED value - * @property {number} FINISHED_UNSUPPORTED=5 FINISHED_UNSUPPORTED value - */ - DiscoveryOccurrence.AnalysisStatus = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ANALYSIS_STATUS_UNSPECIFIED"] = 0; - values[valuesById[1] = "PENDING"] = 1; - values[valuesById[2] = "SCANNING"] = 2; - values[valuesById[3] = "FINISHED_SUCCESS"] = 3; - values[valuesById[4] = "FINISHED_FAILED"] = 4; - values[valuesById[5] = "FINISHED_UNSUPPORTED"] = 5; - return values; - })(); - - return DiscoveryOccurrence; + return DSSEAttestationOccurrence; })(); v1.Grafeas = (function() { @@ -11130,6 +17690,9 @@ * @property {grafeas.v1.IDiscoveryOccurrence|null} [discovery] Occurrence discovery * @property {grafeas.v1.IAttestationOccurrence|null} [attestation] Occurrence attestation * @property {grafeas.v1.IUpgradeOccurrence|null} [upgrade] Occurrence upgrade + * @property {grafeas.v1.IComplianceOccurrence|null} [compliance] Occurrence compliance + * @property {grafeas.v1.IDSSEAttestationOccurrence|null} [dsseAttestation] Occurrence dsseAttestation + * @property {grafeas.v1.IEnvelope|null} [envelope] Occurrence envelope */ /** @@ -11267,17 +17830,41 @@ */ Occurrence.prototype.upgrade = null; + /** + * Occurrence compliance. + * @member {grafeas.v1.IComplianceOccurrence|null|undefined} compliance + * @memberof grafeas.v1.Occurrence + * @instance + */ + Occurrence.prototype.compliance = null; + + /** + * Occurrence dsseAttestation. + * @member {grafeas.v1.IDSSEAttestationOccurrence|null|undefined} dsseAttestation + * @memberof grafeas.v1.Occurrence + * @instance + */ + Occurrence.prototype.dsseAttestation = null; + + /** + * Occurrence envelope. + * @member {grafeas.v1.IEnvelope|null|undefined} envelope + * @memberof grafeas.v1.Occurrence + * @instance + */ + Occurrence.prototype.envelope = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * Occurrence details. - * @member {"vulnerability"|"build"|"image"|"package"|"deployment"|"discovery"|"attestation"|"upgrade"|undefined} details + * @member {"vulnerability"|"build"|"image"|"package"|"deployment"|"discovery"|"attestation"|"upgrade"|"compliance"|"dsseAttestation"|undefined} details * @memberof grafeas.v1.Occurrence * @instance */ Object.defineProperty(Occurrence.prototype, "details", { - get: $util.oneOfGetter($oneOfFields = ["vulnerability", "build", "image", "package", "deployment", "discovery", "attestation", "upgrade"]), + get: $util.oneOfGetter($oneOfFields = ["vulnerability", "build", "image", "package", "deployment", "discovery", "attestation", "upgrade", "compliance", "dsseAttestation"]), set: $util.oneOfSetter($oneOfFields) }); @@ -11335,6 +17922,12 @@ $root.grafeas.v1.AttestationOccurrence.encode(message.attestation, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); if (message.upgrade != null && Object.hasOwnProperty.call(message, "upgrade")) $root.grafeas.v1.UpgradeOccurrence.encode(message.upgrade, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.compliance != null && Object.hasOwnProperty.call(message, "compliance")) + $root.grafeas.v1.ComplianceOccurrence.encode(message.compliance, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.dsseAttestation != null && Object.hasOwnProperty.call(message, "dsseAttestation")) + $root.grafeas.v1.DSSEAttestationOccurrence.encode(message.dsseAttestation, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.envelope != null && Object.hasOwnProperty.call(message, "envelope")) + $root.grafeas.v1.Envelope.encode(message.envelope, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); return writer; }; @@ -11414,6 +18007,15 @@ case 15: message.upgrade = $root.grafeas.v1.UpgradeOccurrence.decode(reader, reader.uint32()); break; + case 16: + message.compliance = $root.grafeas.v1.ComplianceOccurrence.decode(reader, reader.uint32()); + break; + case 17: + message.dsseAttestation = $root.grafeas.v1.DSSEAttestationOccurrence.decode(reader, reader.uint32()); + break; + case 18: + message.envelope = $root.grafeas.v1.Envelope.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -11472,6 +18074,8 @@ case 6: case 7: case 8: + case 9: + case 10: break; } if (message.remediation != null && message.hasOwnProperty("remediation")) @@ -11565,6 +18169,31 @@ return "upgrade." + error; } } + if (message.compliance != null && message.hasOwnProperty("compliance")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.grafeas.v1.ComplianceOccurrence.verify(message.compliance); + if (error) + return "compliance." + error; + } + } + if (message.dsseAttestation != null && message.hasOwnProperty("dsseAttestation")) { + if (properties.details === 1) + return "details: multiple values"; + properties.details = 1; + { + var error = $root.grafeas.v1.DSSEAttestationOccurrence.verify(message.dsseAttestation); + if (error) + return "dsseAttestation." + error; + } + } + if (message.envelope != null && message.hasOwnProperty("envelope")) { + var error = $root.grafeas.v1.Envelope.verify(message.envelope); + if (error) + return "envelope." + error; + } return null; }; @@ -11623,6 +18252,14 @@ case 8: message.kind = 8; break; + case "COMPLIANCE": + case 9: + message.kind = 9; + break; + case "DSSE_ATTESTATION": + case 10: + message.kind = 10; + break; } if (object.remediation != null) message.remediation = String(object.remediation); @@ -11676,6 +18313,21 @@ throw TypeError(".grafeas.v1.Occurrence.upgrade: object expected"); message.upgrade = $root.grafeas.v1.UpgradeOccurrence.fromObject(object.upgrade); } + if (object.compliance != null) { + if (typeof object.compliance !== "object") + throw TypeError(".grafeas.v1.Occurrence.compliance: object expected"); + message.compliance = $root.grafeas.v1.ComplianceOccurrence.fromObject(object.compliance); + } + if (object.dsseAttestation != null) { + if (typeof object.dsseAttestation !== "object") + throw TypeError(".grafeas.v1.Occurrence.dsseAttestation: object expected"); + message.dsseAttestation = $root.grafeas.v1.DSSEAttestationOccurrence.fromObject(object.dsseAttestation); + } + if (object.envelope != null) { + if (typeof object.envelope !== "object") + throw TypeError(".grafeas.v1.Occurrence.envelope: object expected"); + message.envelope = $root.grafeas.v1.Envelope.fromObject(object.envelope); + } return message; }; @@ -11700,6 +18352,7 @@ object.remediation = ""; object.createTime = null; object.updateTime = null; + object.envelope = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -11755,6 +18408,18 @@ if (options.oneofs) object.details = "upgrade"; } + if (message.compliance != null && message.hasOwnProperty("compliance")) { + object.compliance = $root.grafeas.v1.ComplianceOccurrence.toObject(message.compliance, options); + if (options.oneofs) + object.details = "compliance"; + } + if (message.dsseAttestation != null && message.hasOwnProperty("dsseAttestation")) { + object.dsseAttestation = $root.grafeas.v1.DSSEAttestationOccurrence.toObject(message.dsseAttestation, options); + if (options.oneofs) + object.details = "dsseAttestation"; + } + if (message.envelope != null && message.hasOwnProperty("envelope")) + object.envelope = $root.grafeas.v1.Envelope.toObject(message.envelope, options); return object; }; @@ -11795,6 +18460,8 @@ * @property {grafeas.v1.IDiscoveryNote|null} [discovery] Note discovery * @property {grafeas.v1.IAttestationNote|null} [attestation] Note attestation * @property {grafeas.v1.IUpgradeNote|null} [upgrade] Note upgrade + * @property {grafeas.v1.IComplianceNote|null} [compliance] Note compliance + * @property {grafeas.v1.IDSSEAttestationNote|null} [dsseAttestation] Note dsseAttestation */ /** @@ -11950,17 +18617,33 @@ */ Note.prototype.upgrade = null; + /** + * Note compliance. + * @member {grafeas.v1.IComplianceNote|null|undefined} compliance + * @memberof grafeas.v1.Note + * @instance + */ + Note.prototype.compliance = null; + + /** + * Note dsseAttestation. + * @member {grafeas.v1.IDSSEAttestationNote|null|undefined} dsseAttestation + * @memberof grafeas.v1.Note + * @instance + */ + Note.prototype.dsseAttestation = null; + // OneOf field names bound to virtual getters and setters var $oneOfFields; /** * Note type. - * @member {"vulnerability"|"build"|"image"|"package"|"deployment"|"discovery"|"attestation"|"upgrade"|undefined} type + * @member {"vulnerability"|"build"|"image"|"package"|"deployment"|"discovery"|"attestation"|"upgrade"|"compliance"|"dsseAttestation"|undefined} type * @memberof grafeas.v1.Note * @instance */ Object.defineProperty(Note.prototype, "type", { - get: $util.oneOfGetter($oneOfFields = ["vulnerability", "build", "image", "package", "deployment", "discovery", "attestation", "upgrade"]), + get: $util.oneOfGetter($oneOfFields = ["vulnerability", "build", "image", "package", "deployment", "discovery", "attestation", "upgrade", "compliance", "dsseAttestation"]), set: $util.oneOfSetter($oneOfFields) }); @@ -12024,6 +18707,10 @@ $root.grafeas.v1.AttestationNote.encode(message.attestation, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); if (message.upgrade != null && Object.hasOwnProperty.call(message, "upgrade")) $root.grafeas.v1.UpgradeNote.encode(message.upgrade, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.compliance != null && Object.hasOwnProperty.call(message, "compliance")) + $root.grafeas.v1.ComplianceNote.encode(message.compliance, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.dsseAttestation != null && Object.hasOwnProperty.call(message, "dsseAttestation")) + $root.grafeas.v1.DSSEAttestationNote.encode(message.dsseAttestation, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); return writer; }; @@ -12113,6 +18800,12 @@ case 17: message.upgrade = $root.grafeas.v1.UpgradeNote.decode(reader, reader.uint32()); break; + case 18: + message.compliance = $root.grafeas.v1.ComplianceNote.decode(reader, reader.uint32()); + break; + case 19: + message.dsseAttestation = $root.grafeas.v1.DSSEAttestationNote.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -12171,6 +18864,8 @@ case 6: case 7: case 8: + case 9: + case 10: break; } if (message.relatedUrl != null && message.hasOwnProperty("relatedUrl")) { @@ -12282,6 +18977,26 @@ return "upgrade." + error; } } + if (message.compliance != null && message.hasOwnProperty("compliance")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.grafeas.v1.ComplianceNote.verify(message.compliance); + if (error) + return "compliance." + error; + } + } + if (message.dsseAttestation != null && message.hasOwnProperty("dsseAttestation")) { + if (properties.type === 1) + return "type: multiple values"; + properties.type = 1; + { + var error = $root.grafeas.v1.DSSEAttestationNote.verify(message.dsseAttestation); + if (error) + return "dsseAttestation." + error; + } + } return null; }; @@ -12340,6 +19055,14 @@ case 8: message.kind = 8; break; + case "COMPLIANCE": + case 9: + message.kind = 9; + break; + case "DSSE_ATTESTATION": + case 10: + message.kind = 10; + break; } if (object.relatedUrl) { if (!Array.isArray(object.relatedUrl)) @@ -12413,6 +19136,16 @@ throw TypeError(".grafeas.v1.Note.upgrade: object expected"); message.upgrade = $root.grafeas.v1.UpgradeNote.fromObject(object.upgrade); } + if (object.compliance != null) { + if (typeof object.compliance !== "object") + throw TypeError(".grafeas.v1.Note.compliance: object expected"); + message.compliance = $root.grafeas.v1.ComplianceNote.fromObject(object.compliance); + } + if (object.dsseAttestation != null) { + if (typeof object.dsseAttestation !== "object") + throw TypeError(".grafeas.v1.Note.dsseAttestation: object expected"); + message.dsseAttestation = $root.grafeas.v1.DSSEAttestationNote.fromObject(object.dsseAttestation); + } return message; }; @@ -12506,6 +19239,16 @@ if (options.oneofs) object.type = "upgrade"; } + if (message.compliance != null && message.hasOwnProperty("compliance")) { + object.compliance = $root.grafeas.v1.ComplianceNote.toObject(message.compliance, options); + if (options.oneofs) + object.type = "compliance"; + } + if (message.dsseAttestation != null && message.hasOwnProperty("dsseAttestation")) { + object.dsseAttestation = $root.grafeas.v1.DSSEAttestationNote.toObject(message.dsseAttestation, options); + if (options.oneofs) + object.type = "dsseAttestation"; + } return object; }; diff --git a/packages/google-devtools-containeranalysis/protos/protos.json b/packages/google-devtools-containeranalysis/protos/protos.json index 7dfc9beb502..31cc077061c 100644 --- a/packages/google-devtools-containeranalysis/protos/protos.json +++ b/packages/google-devtools-containeranalysis/protos/protos.json @@ -101,6 +101,14 @@ "sourceUpdateTime": { "type": "google.protobuf.Timestamp", "id": 12 + }, + "source": { + "type": "string", + "id": 13 + }, + "vendor": { + "type": "string", + "id": 14 } } }, @@ -155,6 +163,10 @@ "type": "float", "id": 3 }, + "cvssv3": { + "type": "CVSSV3", + "id": 10 + }, "packageIssue": { "rule": "repeated", "type": "PackageIssue", @@ -183,6 +195,18 @@ } }, "nested": { + "CVSSV3": { + "fields": { + "baseScore": { + "type": "float", + "id": 1 + }, + "severity": { + "type": "Severity", + "id": 2 + } + } + }, "PackageIssue": { "fields": { "affectedCpeUri": { @@ -212,6 +236,17 @@ "fixAvailable": { "type": "bool", "id": 7 + }, + "packageType": { + "type": "string", + "id": 8 + }, + "effectiveSeverity": { + "type": "Severity", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } } @@ -227,7 +262,9 @@ "DEPLOYMENT": 5, "DISCOVERY": 6, "ATTESTATION": 7, - "UPGRADE": 8 + "UPGRADE": 8, + "COMPLIANCE": 9, + "DSSE_ATTESTATION": 10 } }, "RelatedUrl": { @@ -254,6 +291,35 @@ } } }, + "Envelope": { + "fields": { + "payload": { + "type": "bytes", + "id": 1 + }, + "payloadType": { + "type": "string", + "id": 2 + }, + "signatures": { + "rule": "repeated", + "type": "EnvelopeSignature", + "id": 3 + } + } + }, + "EnvelopeSignature": { + "fields": { + "sig": { + "type": "bytes", + "id": 1 + }, + "keyid": { + "type": "string", + "id": 2 + } + } + }, "CVSSv3": { "fields": { "baseScore": { @@ -441,6 +507,10 @@ "type": "string", "id": 3 }, + "inclusive": { + "type": "bool", + "id": 6 + }, "kind": { "type": "VersionKind", "id": 4 @@ -479,6 +549,14 @@ } } }, + "Jwt": { + "fields": { + "compactJwt": { + "type": "string", + "id": 1 + } + } + }, "AttestationOccurrence": { "fields": { "serializedPayload": { @@ -489,6 +567,11 @@ "rule": "repeated", "type": "Signature", "id": 2 + }, + "jwts": { + "rule": "repeated", + "type": "Jwt", + "id": 3 } } }, @@ -509,6 +592,266 @@ "provenanceBytes": { "type": "string", "id": 2 + }, + "intotoProvenance": { + "type": "InTotoProvenance", + "id": 3 + }, + "intotoStatement": { + "type": "InTotoStatement", + "id": 4 + } + } + }, + "Recipe": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "definedInMaterial": { + "type": "int64", + "id": 2 + }, + "entryPoint": { + "type": "string", + "id": 3 + }, + "arguments": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 4 + }, + "environment": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "Completeness": { + "fields": { + "arguments": { + "type": "bool", + "id": 1 + }, + "environment": { + "type": "bool", + "id": 2 + }, + "materials": { + "type": "bool", + "id": 3 + } + } + }, + "Metadata": { + "fields": { + "buildInvocationId": { + "type": "string", + "id": 1 + }, + "buildStartedOn": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "buildFinishedOn": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "completeness": { + "type": "Completeness", + "id": 4 + }, + "reproducible": { + "type": "bool", + "id": 5 + } + } + }, + "BuilderConfig": { + "fields": { + "id": { + "type": "string", + "id": 1 + } + } + }, + "InTotoProvenance": { + "fields": { + "builderConfig": { + "type": "BuilderConfig", + "id": 1 + }, + "recipe": { + "type": "Recipe", + "id": 2 + }, + "metadata": { + "type": "Metadata", + "id": 3 + }, + "materials": { + "rule": "repeated", + "type": "string", + "id": 4 + } + } + }, + "InTotoStatement": { + "oneofs": { + "predicate": { + "oneof": [ + "provenance", + "slsaProvenance" + ] + } + }, + "fields": { + "type": { + "type": "string", + "id": 1, + "options": { + "json_name": "_type" + } + }, + "subject": { + "rule": "repeated", + "type": "Subject", + "id": 2 + }, + "predicateType": { + "type": "string", + "id": 3 + }, + "provenance": { + "type": "InTotoProvenance", + "id": 4 + }, + "slsaProvenance": { + "type": "SlsaProvenance", + "id": 5 + } + } + }, + "Subject": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "digest": { + "keyType": "string", + "type": "string", + "id": 2 + } + } + }, + "SlsaProvenance": { + "fields": { + "builder": { + "type": "SlsaBuilder", + "id": 1 + }, + "recipe": { + "type": "SlsaRecipe", + "id": 2 + }, + "metadata": { + "type": "SlsaMetadata", + "id": 3 + }, + "materials": { + "rule": "repeated", + "type": "Material", + "id": 4 + } + }, + "nested": { + "SlsaRecipe": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "definedInMaterial": { + "type": "int64", + "id": 2 + }, + "entryPoint": { + "type": "string", + "id": 3 + }, + "arguments": { + "type": "google.protobuf.Any", + "id": 4 + }, + "environment": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "SlsaCompleteness": { + "fields": { + "arguments": { + "type": "bool", + "id": 1 + }, + "environment": { + "type": "bool", + "id": 2 + }, + "materials": { + "type": "bool", + "id": 3 + } + } + }, + "SlsaMetadata": { + "fields": { + "buildInvocationId": { + "type": "string", + "id": 1 + }, + "buildStartedOn": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "buildFinishedOn": { + "type": "google.protobuf.Timestamp", + "id": 3 + }, + "completeness": { + "type": "SlsaCompleteness", + "id": 4 + }, + "reproducible": { + "type": "bool", + "id": 5 + } + } + }, + "SlsaBuilder": { + "fields": { + "id": { + "type": "string", + "id": 1 + } + } + }, + "Material": { + "fields": { + "uri": { + "type": "string", + "id": 1 + }, + "digest": { + "keyType": "string", + "type": "string", + "id": 2 + } + } } } }, @@ -810,6 +1153,101 @@ } } }, + "ComplianceNote": { + "oneofs": { + "complianceType": { + "oneof": [ + "cisBenchmark" + ] + } + }, + "fields": { + "title": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "version": { + "rule": "repeated", + "type": "grafeas.v1.ComplianceVersion", + "id": 3 + }, + "rationale": { + "type": "string", + "id": 4 + }, + "remediation": { + "type": "string", + "id": 5 + }, + "cisBenchmark": { + "type": "CisBenchmark", + "id": 6 + }, + "scanInstructions": { + "type": "bytes", + "id": 7 + } + }, + "nested": { + "CisBenchmark": { + "fields": { + "profileLevel": { + "type": "int32", + "id": 1 + }, + "severity": { + "type": "grafeas.v1.Severity", + "id": 2 + } + } + } + } + }, + "ComplianceVersion": { + "fields": { + "cpeUri": { + "type": "string", + "id": 1 + }, + "version": { + "type": "string", + "id": 2 + } + } + }, + "ComplianceOccurrence": { + "fields": { + "nonCompliantFiles": { + "rule": "repeated", + "type": "NonCompliantFile", + "id": 2 + }, + "nonComplianceReason": { + "type": "string", + "id": 3 + } + } + }, + "NonCompliantFile": { + "fields": { + "path": { + "type": "string", + "id": 1 + }, + "displayCommand": { + "type": "string", + "id": 2 + }, + "reason": { + "type": "string", + "id": 3 + } + } + }, "DeploymentNote": { "fields": { "resourceUri": { @@ -913,6 +1351,43 @@ } } }, + "DSSEAttestationNote": { + "fields": { + "hint": { + "type": "DSSEHint", + "id": 1 + } + }, + "nested": { + "DSSEHint": { + "fields": { + "humanReadableName": { + "type": "string", + "id": 1 + } + } + } + } + }, + "DSSEAttestationOccurrence": { + "oneofs": { + "decodedPayload": { + "oneof": [ + "statement" + ] + } + }, + "fields": { + "envelope": { + "type": "Envelope", + "id": 1 + }, + "statement": { + "type": "InTotoStatement", + "id": 2 + } + } + }, "Grafeas": { "options": { "(google.api.default_host)": "containeranalysis.googleapis.com" @@ -1199,7 +1674,9 @@ "deployment", "discovery", "attestation", - "upgrade" + "upgrade", + "compliance", + "dsseAttestation" ] } }, @@ -1263,6 +1740,18 @@ "upgrade": { "type": "grafeas.v1.UpgradeOccurrence", "id": 15 + }, + "compliance": { + "type": "grafeas.v1.ComplianceOccurrence", + "id": 16 + }, + "dsseAttestation": { + "type": "grafeas.v1.DSSEAttestationOccurrence", + "id": 17 + }, + "envelope": { + "type": "grafeas.v1.Envelope", + "id": 18 } } }, @@ -1281,7 +1770,9 @@ "deployment", "discovery", "attestation", - "upgrade" + "upgrade", + "compliance", + "dsseAttestation" ] } }, @@ -1355,6 +1846,14 @@ "upgrade": { "type": "grafeas.v1.UpgradeNote", "id": 17 + }, + "compliance": { + "type": "grafeas.v1.ComplianceNote", + "id": 18 + }, + "dsseAttestation": { + "type": "grafeas.v1.DSSEAttestationNote", + "id": 19 } } }, diff --git a/packages/google-devtools-containeranalysis/src/v1/container_analysis_proto_list.json b/packages/google-devtools-containeranalysis/src/v1/container_analysis_proto_list.json index e44e77192bd..fc57e4e1abc 100644 --- a/packages/google-devtools-containeranalysis/src/v1/container_analysis_proto_list.json +++ b/packages/google-devtools-containeranalysis/src/v1/container_analysis_proto_list.json @@ -3,13 +3,18 @@ "../../protos/grafeas/v1/attestation.proto", "../../protos/grafeas/v1/build.proto", "../../protos/grafeas/v1/common.proto", + "../../protos/grafeas/v1/compliance.proto", "../../protos/grafeas/v1/cvss.proto", "../../protos/grafeas/v1/deployment.proto", "../../protos/grafeas/v1/discovery.proto", + "../../protos/grafeas/v1/dsse_attestation.proto", "../../protos/grafeas/v1/grafeas.proto", "../../protos/grafeas/v1/image.proto", + "../../protos/grafeas/v1/intoto_provenance.proto", + "../../protos/grafeas/v1/intoto_statement.proto", "../../protos/grafeas/v1/package.proto", "../../protos/grafeas/v1/provenance.proto", + "../../protos/grafeas/v1/slsa_provenance.proto", "../../protos/grafeas/v1/upgrade.proto", "../../protos/grafeas/v1/vulnerability.proto" ] diff --git a/packages/google-devtools-containeranalysis/src/v1/grafeas_proto_list.json b/packages/google-devtools-containeranalysis/src/v1/grafeas_proto_list.json index e44e77192bd..fc57e4e1abc 100644 --- a/packages/google-devtools-containeranalysis/src/v1/grafeas_proto_list.json +++ b/packages/google-devtools-containeranalysis/src/v1/grafeas_proto_list.json @@ -3,13 +3,18 @@ "../../protos/grafeas/v1/attestation.proto", "../../protos/grafeas/v1/build.proto", "../../protos/grafeas/v1/common.proto", + "../../protos/grafeas/v1/compliance.proto", "../../protos/grafeas/v1/cvss.proto", "../../protos/grafeas/v1/deployment.proto", "../../protos/grafeas/v1/discovery.proto", + "../../protos/grafeas/v1/dsse_attestation.proto", "../../protos/grafeas/v1/grafeas.proto", "../../protos/grafeas/v1/image.proto", + "../../protos/grafeas/v1/intoto_provenance.proto", + "../../protos/grafeas/v1/intoto_statement.proto", "../../protos/grafeas/v1/package.proto", "../../protos/grafeas/v1/provenance.proto", + "../../protos/grafeas/v1/slsa_provenance.proto", "../../protos/grafeas/v1/upgrade.proto", "../../protos/grafeas/v1/vulnerability.proto" ]