diff --git a/packages/google-cloud-eventarc-publishing/README.md b/packages/google-cloud-eventarc-publishing/README.md index d3a13d7e2f4..2a535cae642 100644 --- a/packages/google-cloud-eventarc-publishing/README.md +++ b/packages/google-cloud-eventarc-publishing/README.md @@ -44,7 +44,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. 1. [Select or create a Cloud Platform project][projects]. 1. [Enable billing for your project][billing]. 1. [Enable the Eventarc Publishing API API][enable_api]. -1. [Set up authentication with a service account][auth] so you can access the +1. [Set up authentication][auth] so you can access the API from your local workstation. ### Installing the client library @@ -62,6 +62,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | +| Publisher.publish | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-eventarc-publishing/samples/generated/v1/publisher.publish.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-eventarc-publishing/samples/generated/v1/publisher.publish.js,packages/google-cloud-eventarc-publishing/samples/README.md) | | Publisher.publish_channel_connection_events | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-eventarc-publishing/samples/generated/v1/publisher.publish_channel_connection_events.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-eventarc-publishing/samples/generated/v1/publisher.publish_channel_connection_events.js,packages/google-cloud-eventarc-publishing/samples/README.md) | | Publisher.publish_events | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-eventarc-publishing/samples/generated/v1/publisher.publish_events.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-eventarc-publishing/samples/generated/v1/publisher.publish_events.js,packages/google-cloud-eventarc-publishing/samples/README.md) | | Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-eventarc-publishing/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-eventarc-publishing/samples/quickstart.js,packages/google-cloud-eventarc-publishing/samples/README.md) | @@ -134,4 +135,4 @@ See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) [projects]: https://console.cloud.google.com/project [billing]: https://support.google.com/cloud/answer/6293499#enable-billing [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=eventarcpublishing.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/getting-started +[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local diff --git a/packages/google-cloud-eventarc-publishing/protos/google/cloud/eventarc/publishing/v1/cloud_event.proto b/packages/google-cloud-eventarc-publishing/protos/google/cloud/eventarc/publishing/v1/cloud_event.proto new file mode 100644 index 00000000000..bb9c42cbab2 --- /dev/null +++ b/packages/google-cloud-eventarc-publishing/protos/google/cloud/eventarc/publishing/v1/cloud_event.proto @@ -0,0 +1,95 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.eventarc.publishing.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Eventarc.Publishing.V1"; +option go_package = "cloud.google.com/go/eventarc/publishing/apiv1/publishingpb;publishingpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudEventProto"; +option java_package = "com.google.cloud.eventarc.publishing.v1"; +option php_namespace = "Google\\Cloud\\Eventarc\\Publishing\\V1"; +option ruby_package = "Google::Cloud::Eventarc::Publishing::V1"; + +// CloudEvent represents a vendor-neutral specification for defining the format +// of event data. +message CloudEvent { + // The following abstract data types are available for use in attributes. + message CloudEventAttributeValue { + // The value of the attribute. + oneof attr { + // Boolean value. + bool ce_boolean = 1; + + // Integer value. + int32 ce_integer = 2; + + // String value. + string ce_string = 3; + + // Bytes value. + bytes ce_bytes = 4; + + // URI value. + string ce_uri = 5; + + // URI-reference value. + string ce_uri_ref = 6; + + // Timestamp value. + google.protobuf.Timestamp ce_timestamp = 7; + } + } + + // Required. Identifies the event. Producers MUST ensure that source + id is + // unique for each distinct event. + string id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Identifies the context in which an event happened. + // URI-reference + string source = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The version of the CloudEvents specification which the event + // uses. + string spec_version = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. This attribute contains a value describing the type of event + // related to the originating occurrence. + string type = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Used for Optional & Extension Attributes + map attributes = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // The event payload. It should be encoded into a media format which is + // specified by the 'datacontenttype' attribute (e.g. application/json), and + // adheres to the dataschema format when those respective attributes are + // present. + oneof data { + // Optional. Binary data. + bytes binary_data = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Text data. + string text_data = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Proto data. + google.protobuf.Any proto_data = 8 [(google.api.field_behavior) = OPTIONAL]; + } +} diff --git a/packages/google-cloud-eventarc-publishing/protos/google/cloud/eventarc/publishing/v1/publisher.proto b/packages/google-cloud-eventarc-publishing/protos/google/cloud/eventarc/publishing/v1/publisher.proto index 25f7e0c055e..0037200cb74 100644 --- a/packages/google-cloud-eventarc-publishing/protos/google/cloud/eventarc/publishing/v1/publisher.proto +++ b/packages/google-cloud-eventarc-publishing/protos/google/cloud/eventarc/publishing/v1/publisher.proto @@ -11,12 +11,16 @@ // 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 google.cloud.eventarc.publishing.v1; import "google/api/annotations.proto"; import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/cloud/eventarc/publishing/v1/cloud_event.proto"; import "google/protobuf/any.proto"; option csharp_namespace = "Google.Cloud.Eventarc.Publishing.V1"; @@ -64,6 +68,7 @@ service Publisher { body: "*" }; } + // Publish events to a subscriber's channel. rpc PublishEvents(PublishEventsRequest) returns (PublishEventsResponse) { option (google.api.http) = { @@ -71,15 +76,26 @@ service Publisher { body: "*" }; } + + // Publish events to a message bus. + rpc Publish(PublishRequest) returns (PublishResponse) { + option (google.api.http) = { + post: "/v1/{message_bus=projects/*/locations/*/messageBuses/*}:publish" + body: "*" + }; + } } + // The request message for the PublishChannelConnectionEvents method. message PublishChannelConnectionEventsRequest { // The channel_connection that the events are published from. For example: // `projects/{partner_project_id}/locations/{location}/channelConnections/{channel_connection_id}`. string channel_connection = 1; + // The CloudEvents v1.0 events to publish. No other types are allowed. // If this field is set, then the `text_events` fields must not be set. repeated google.protobuf.Any events = 2; + // The text representation of events to publish. // CloudEvent v1.0 in JSON format is the only allowed type. Refer to // https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/json-format.md @@ -87,16 +103,20 @@ message PublishChannelConnectionEventsRequest { // If this field is set, then the `events` fields must not be set. repeated string text_events = 3; } + // The response message for the PublishChannelConnectionEvents method. message PublishChannelConnectionEventsResponse {} + // The request message for the PublishEvents method. message PublishEventsRequest { // The full name of the channel to publish to. For example: // `projects/{project}/locations/{location}/channels/{channel-id}`. string channel = 1; + // The CloudEvents v1.0 events to publish. No other types are allowed. // If this field is set, then the `text_events` fields must not be set. repeated google.protobuf.Any events = 2; + // The text representation of events to publish. // CloudEvent v1.0 in JSON format is the only allowed type. Refer to // https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/json-format.md @@ -104,5 +124,33 @@ message PublishEventsRequest { // If this field is set, then the `events` fields must not be set. repeated string text_events = 3; } + // The response message for the PublishEvents method. message PublishEventsResponse {} + +// The request message for the Publish method. +message PublishRequest { + // Required. The full name of the message bus to publish events to. Format: + // `projects/{project}/locations/{location}/messageBuses/{messageBus}`. + string message_bus = 1 [(google.api.field_behavior) = REQUIRED]; + + oneof format { + // The Protobuf format of the CloudEvent being published. Specification can + // be found here: + // https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/protobuf-format.md + CloudEvent proto_message = 2; + + // The JSON format of the CloudEvent being published. Specification can be + // found here: + // https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/json-format.md + string json_message = 3; + + // The Avro format of the CloudEvent being published. Specification can + // be found here: + // https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/avro-format.md + bytes avro_message = 4; + } +} + +// The response message for the Publish method. +message PublishResponse {} diff --git a/packages/google-cloud-eventarc-publishing/protos/protos.d.ts b/packages/google-cloud-eventarc-publishing/protos/protos.d.ts index 7f7af977f2a..ad816cb89fe 100644 --- a/packages/google-cloud-eventarc-publishing/protos/protos.d.ts +++ b/packages/google-cloud-eventarc-publishing/protos/protos.d.ts @@ -29,6 +29,287 @@ export namespace google { /** Namespace v1. */ namespace v1 { + /** Properties of a CloudEvent. */ + interface ICloudEvent { + + /** CloudEvent id */ + id?: (string|null); + + /** CloudEvent source */ + source?: (string|null); + + /** CloudEvent specVersion */ + specVersion?: (string|null); + + /** CloudEvent type */ + type?: (string|null); + + /** CloudEvent attributes */ + attributes?: ({ [k: string]: google.cloud.eventarc.publishing.v1.CloudEvent.ICloudEventAttributeValue }|null); + + /** CloudEvent binaryData */ + binaryData?: (Uint8Array|string|null); + + /** CloudEvent textData */ + textData?: (string|null); + + /** CloudEvent protoData */ + protoData?: (google.protobuf.IAny|null); + } + + /** Represents a CloudEvent. */ + class CloudEvent implements ICloudEvent { + + /** + * Constructs a new CloudEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.eventarc.publishing.v1.ICloudEvent); + + /** CloudEvent id. */ + public id: string; + + /** CloudEvent source. */ + public source: string; + + /** CloudEvent specVersion. */ + public specVersion: string; + + /** CloudEvent type. */ + public type: string; + + /** CloudEvent attributes. */ + public attributes: { [k: string]: google.cloud.eventarc.publishing.v1.CloudEvent.ICloudEventAttributeValue }; + + /** CloudEvent binaryData. */ + public binaryData?: (Uint8Array|string|null); + + /** CloudEvent textData. */ + public textData?: (string|null); + + /** CloudEvent protoData. */ + public protoData?: (google.protobuf.IAny|null); + + /** CloudEvent data. */ + public data?: ("binaryData"|"textData"|"protoData"); + + /** + * Creates a new CloudEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudEvent instance + */ + public static create(properties?: google.cloud.eventarc.publishing.v1.ICloudEvent): google.cloud.eventarc.publishing.v1.CloudEvent; + + /** + * Encodes the specified CloudEvent message. Does not implicitly {@link google.cloud.eventarc.publishing.v1.CloudEvent.verify|verify} messages. + * @param message CloudEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.eventarc.publishing.v1.ICloudEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudEvent message, length delimited. Does not implicitly {@link google.cloud.eventarc.publishing.v1.CloudEvent.verify|verify} messages. + * @param message CloudEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.eventarc.publishing.v1.ICloudEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudEvent + * @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): google.cloud.eventarc.publishing.v1.CloudEvent; + + /** + * Decodes a CloudEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudEvent + * @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)): google.cloud.eventarc.publishing.v1.CloudEvent; + + /** + * Verifies a CloudEvent 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 CloudEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.eventarc.publishing.v1.CloudEvent; + + /** + * Creates a plain object from a CloudEvent message. Also converts values to other types if specified. + * @param message CloudEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.eventarc.publishing.v1.CloudEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudEvent + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CloudEvent { + + /** Properties of a CloudEventAttributeValue. */ + interface ICloudEventAttributeValue { + + /** CloudEventAttributeValue ceBoolean */ + ceBoolean?: (boolean|null); + + /** CloudEventAttributeValue ceInteger */ + ceInteger?: (number|null); + + /** CloudEventAttributeValue ceString */ + ceString?: (string|null); + + /** CloudEventAttributeValue ceBytes */ + ceBytes?: (Uint8Array|string|null); + + /** CloudEventAttributeValue ceUri */ + ceUri?: (string|null); + + /** CloudEventAttributeValue ceUriRef */ + ceUriRef?: (string|null); + + /** CloudEventAttributeValue ceTimestamp */ + ceTimestamp?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CloudEventAttributeValue. */ + class CloudEventAttributeValue implements ICloudEventAttributeValue { + + /** + * Constructs a new CloudEventAttributeValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.eventarc.publishing.v1.CloudEvent.ICloudEventAttributeValue); + + /** CloudEventAttributeValue ceBoolean. */ + public ceBoolean?: (boolean|null); + + /** CloudEventAttributeValue ceInteger. */ + public ceInteger?: (number|null); + + /** CloudEventAttributeValue ceString. */ + public ceString?: (string|null); + + /** CloudEventAttributeValue ceBytes. */ + public ceBytes?: (Uint8Array|string|null); + + /** CloudEventAttributeValue ceUri. */ + public ceUri?: (string|null); + + /** CloudEventAttributeValue ceUriRef. */ + public ceUriRef?: (string|null); + + /** CloudEventAttributeValue ceTimestamp. */ + public ceTimestamp?: (google.protobuf.ITimestamp|null); + + /** CloudEventAttributeValue attr. */ + public attr?: ("ceBoolean"|"ceInteger"|"ceString"|"ceBytes"|"ceUri"|"ceUriRef"|"ceTimestamp"); + + /** + * Creates a new CloudEventAttributeValue instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudEventAttributeValue instance + */ + public static create(properties?: google.cloud.eventarc.publishing.v1.CloudEvent.ICloudEventAttributeValue): google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue; + + /** + * Encodes the specified CloudEventAttributeValue message. Does not implicitly {@link google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue.verify|verify} messages. + * @param message CloudEventAttributeValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.eventarc.publishing.v1.CloudEvent.ICloudEventAttributeValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudEventAttributeValue message, length delimited. Does not implicitly {@link google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue.verify|verify} messages. + * @param message CloudEventAttributeValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.eventarc.publishing.v1.CloudEvent.ICloudEventAttributeValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudEventAttributeValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudEventAttributeValue + * @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): google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue; + + /** + * Decodes a CloudEventAttributeValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudEventAttributeValue + * @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)): google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue; + + /** + * Verifies a CloudEventAttributeValue 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 CloudEventAttributeValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudEventAttributeValue + */ + public static fromObject(object: { [k: string]: any }): google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue; + + /** + * Creates a plain object from a CloudEventAttributeValue message. Also converts values to other types if specified. + * @param message CloudEventAttributeValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudEventAttributeValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudEventAttributeValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + /** Represents a Publisher */ class Publisher extends $protobuf.rpc.Service { @@ -76,6 +357,20 @@ export namespace google { * @returns Promise */ public publishEvents(request: google.cloud.eventarc.publishing.v1.IPublishEventsRequest): Promise; + + /** + * Calls Publish. + * @param request PublishRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PublishResponse + */ + public publish(request: google.cloud.eventarc.publishing.v1.IPublishRequest, callback: google.cloud.eventarc.publishing.v1.Publisher.PublishCallback): void; + + /** + * Calls Publish. + * @param request PublishRequest message or plain object + * @returns Promise + */ + public publish(request: google.cloud.eventarc.publishing.v1.IPublishRequest): Promise; } namespace Publisher { @@ -93,6 +388,13 @@ export namespace google { * @param [response] PublishEventsResponse */ type PublishEventsCallback = (error: (Error|null), response?: google.cloud.eventarc.publishing.v1.PublishEventsResponse) => void; + + /** + * Callback as used by {@link google.cloud.eventarc.publishing.v1.Publisher|publish}. + * @param error Error, if any + * @param [response] PublishResponse + */ + type PublishCallback = (error: (Error|null), response?: google.cloud.eventarc.publishing.v1.PublishResponse) => void; } /** Properties of a PublishChannelConnectionEventsRequest. */ @@ -494,6 +796,215 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Properties of a PublishRequest. */ + interface IPublishRequest { + + /** PublishRequest messageBus */ + messageBus?: (string|null); + + /** PublishRequest protoMessage */ + protoMessage?: (google.cloud.eventarc.publishing.v1.ICloudEvent|null); + + /** PublishRequest jsonMessage */ + jsonMessage?: (string|null); + + /** PublishRequest avroMessage */ + avroMessage?: (Uint8Array|string|null); + } + + /** Represents a PublishRequest. */ + class PublishRequest implements IPublishRequest { + + /** + * Constructs a new PublishRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.eventarc.publishing.v1.IPublishRequest); + + /** PublishRequest messageBus. */ + public messageBus: string; + + /** PublishRequest protoMessage. */ + public protoMessage?: (google.cloud.eventarc.publishing.v1.ICloudEvent|null); + + /** PublishRequest jsonMessage. */ + public jsonMessage?: (string|null); + + /** PublishRequest avroMessage. */ + public avroMessage?: (Uint8Array|string|null); + + /** PublishRequest format. */ + public format?: ("protoMessage"|"jsonMessage"|"avroMessage"); + + /** + * Creates a new PublishRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns PublishRequest instance + */ + public static create(properties?: google.cloud.eventarc.publishing.v1.IPublishRequest): google.cloud.eventarc.publishing.v1.PublishRequest; + + /** + * Encodes the specified PublishRequest message. Does not implicitly {@link google.cloud.eventarc.publishing.v1.PublishRequest.verify|verify} messages. + * @param message PublishRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.eventarc.publishing.v1.IPublishRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PublishRequest message, length delimited. Does not implicitly {@link google.cloud.eventarc.publishing.v1.PublishRequest.verify|verify} messages. + * @param message PublishRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.eventarc.publishing.v1.IPublishRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PublishRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PublishRequest + * @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): google.cloud.eventarc.publishing.v1.PublishRequest; + + /** + * Decodes a PublishRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PublishRequest + * @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)): google.cloud.eventarc.publishing.v1.PublishRequest; + + /** + * Verifies a PublishRequest 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 PublishRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PublishRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.eventarc.publishing.v1.PublishRequest; + + /** + * Creates a plain object from a PublishRequest message. Also converts values to other types if specified. + * @param message PublishRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.eventarc.publishing.v1.PublishRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PublishRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PublishRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PublishResponse. */ + interface IPublishResponse { + } + + /** Represents a PublishResponse. */ + class PublishResponse implements IPublishResponse { + + /** + * Constructs a new PublishResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.eventarc.publishing.v1.IPublishResponse); + + /** + * Creates a new PublishResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns PublishResponse instance + */ + public static create(properties?: google.cloud.eventarc.publishing.v1.IPublishResponse): google.cloud.eventarc.publishing.v1.PublishResponse; + + /** + * Encodes the specified PublishResponse message. Does not implicitly {@link google.cloud.eventarc.publishing.v1.PublishResponse.verify|verify} messages. + * @param message PublishResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.eventarc.publishing.v1.IPublishResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PublishResponse message, length delimited. Does not implicitly {@link google.cloud.eventarc.publishing.v1.PublishResponse.verify|verify} messages. + * @param message PublishResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.eventarc.publishing.v1.IPublishResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PublishResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PublishResponse + * @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): google.cloud.eventarc.publishing.v1.PublishResponse; + + /** + * Decodes a PublishResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PublishResponse + * @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)): google.cloud.eventarc.publishing.v1.PublishResponse; + + /** + * Verifies a PublishResponse 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 PublishResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PublishResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.eventarc.publishing.v1.PublishResponse; + + /** + * Creates a plain object from a PublishResponse message. Also converts values to other types if specified. + * @param message PublishResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.eventarc.publishing.v1.PublishResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PublishResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PublishResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } } } } @@ -502,6 +1013,19 @@ export namespace google { /** Namespace api. */ namespace api { + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7, + IDENTIFIER = 8 + } + /** Properties of a Http. */ interface IHttp { @@ -2348,6 +2872,115 @@ export namespace google { GA = 4, DEPRECATED = 5 } + + /** Properties of a FieldInfo. */ + interface IFieldInfo { + + /** FieldInfo format */ + format?: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format|null); + } + + /** Represents a FieldInfo. */ + class FieldInfo implements IFieldInfo { + + /** + * Constructs a new FieldInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IFieldInfo); + + /** FieldInfo format. */ + public format: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format); + + /** + * Creates a new FieldInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldInfo instance + */ + public static create(properties?: google.api.IFieldInfo): google.api.FieldInfo; + + /** + * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @param message FieldInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @param message FieldInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldInfo + * @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): google.api.FieldInfo; + + /** + * Decodes a FieldInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldInfo + * @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)): google.api.FieldInfo; + + /** + * Verifies a FieldInfo 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 FieldInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldInfo + */ + public static fromObject(object: { [k: string]: any }): google.api.FieldInfo; + + /** + * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. + * @param message FieldInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.FieldInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldInfo { + + /** Format enum. */ + enum Format { + FORMAT_UNSPECIFIED = 0, + UUID4 = 1, + IPV4 = 2, + IPV6 = 3, + IPV4_OR_IPV6 = 4 + } + } } /** Namespace protobuf. */ @@ -4510,6 +5143,12 @@ export namespace google { /** FieldOptions uninterpretedOption */ uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.fieldInfo */ + ".google.api.fieldInfo"?: (google.api.IFieldInfo|null); } /** Represents a FieldOptions. */ @@ -6443,206 +7082,309 @@ export namespace google { } } - /** Properties of a Duration. */ - interface IDuration { + /** Properties of an Any. */ + interface IAny { - /** Duration seconds */ + /** Any type_url */ + type_url?: (string|null); + + /** Any value */ + value?: (Uint8Array|string|null); + } + + /** Represents an Any. */ + class Any implements IAny { + + /** + * Constructs a new Any. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IAny); + + /** Any type_url. */ + public type_url: string; + + /** Any value. */ + public value: (Uint8Array|string); + + /** + * Creates a new Any instance using the specified properties. + * @param [properties] Properties to set + * @returns Any instance + */ + public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @param message Any message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Any message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Any + * @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): google.protobuf.Any; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Any + * @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)): google.protobuf.Any; + + /** + * Verifies an Any 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 Any message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Any + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @param message Any + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Any to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Any + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Timestamp. */ + interface ITimestamp { + + /** Timestamp seconds */ seconds?: (number|Long|string|null); - /** Duration nanos */ + /** Timestamp nanos */ nanos?: (number|null); } - /** Represents a Duration. */ - class Duration implements IDuration { + /** Represents a Timestamp. */ + class Timestamp implements ITimestamp { /** - * Constructs a new Duration. + * Constructs a new Timestamp. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IDuration); + constructor(properties?: google.protobuf.ITimestamp); - /** Duration seconds. */ + /** Timestamp seconds. */ public seconds: (number|Long|string); - /** Duration nanos. */ + /** Timestamp nanos. */ public nanos: number; /** - * Creates a new Duration instance using the specified properties. + * Creates a new Timestamp instance using the specified properties. * @param [properties] Properties to set - * @returns Duration instance + * @returns Timestamp instance */ - public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; + public static create(properties?: google.protobuf.ITimestamp): google.protobuf.Timestamp; /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. - * @param message Duration message or plain object to encode + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. + * @param message Timestamp message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.ITimestamp, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Duration message from the specified reader or buffer. + * Decodes a Timestamp message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Duration + * @returns Timestamp * @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): google.protobuf.Duration; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Timestamp; /** - * Decodes a Duration message from the specified reader or buffer, length delimited. + * Decodes a Timestamp message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Duration + * @returns Timestamp * @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)): google.protobuf.Duration; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Timestamp; /** - * Verifies a Duration message. + * Verifies a Timestamp 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 Duration message from a plain object. Also converts values to their respective internal types. + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Duration + * @returns Timestamp */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; + public static fromObject(object: { [k: string]: any }): google.protobuf.Timestamp; /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. - * @param message Duration + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. + * @param message Timestamp * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Timestamp, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Duration to JSON. + * Converts this Timestamp to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Duration + * Gets the default type url for Timestamp * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an Any. */ - interface IAny { + /** Properties of a Duration. */ + interface IDuration { - /** Any type_url */ - type_url?: (string|null); + /** Duration seconds */ + seconds?: (number|Long|string|null); - /** Any value */ - value?: (Uint8Array|string|null); + /** Duration nanos */ + nanos?: (number|null); } - /** Represents an Any. */ - class Any implements IAny { + /** Represents a Duration. */ + class Duration implements IDuration { /** - * Constructs a new Any. + * Constructs a new Duration. * @param [properties] Properties to set */ - constructor(properties?: google.protobuf.IAny); + constructor(properties?: google.protobuf.IDuration); - /** Any type_url. */ - public type_url: string; + /** Duration seconds. */ + public seconds: (number|Long|string); - /** Any value. */ - public value: (Uint8Array|string); + /** Duration nanos. */ + public nanos: number; /** - * Creates a new Any instance using the specified properties. + * Creates a new Duration instance using the specified properties. * @param [properties] Properties to set - * @returns Any instance + * @returns Duration instance */ - public static create(properties?: google.protobuf.IAny): google.protobuf.Any; + public static create(properties?: google.protobuf.IDuration): google.protobuf.Duration; /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. - * @param message Any message or plain object to encode + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * @param message Duration message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.protobuf.IAny, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.protobuf.IDuration, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Any message from the specified reader or buffer. + * Decodes a Duration message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Any + * @returns Duration * @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): google.protobuf.Any; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Duration; /** - * Decodes an Any message from the specified reader or buffer, length delimited. + * Decodes a Duration message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Any + * @returns Duration * @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)): google.protobuf.Any; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Duration; /** - * Verifies an Any message. + * Verifies a Duration 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 Any message from a plain object. Also converts values to their respective internal types. + * Creates a Duration message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Any + * @returns Duration */ - public static fromObject(object: { [k: string]: any }): google.protobuf.Any; + public static fromObject(object: { [k: string]: any }): google.protobuf.Duration; /** - * Creates a plain object from an Any message. Also converts values to other types if specified. - * @param message Any + * Creates a plain object from a Duration message. Also converts values to other types if specified. + * @param message Duration * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.protobuf.Any, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.protobuf.Duration, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Any to JSON. + * Converts this Duration to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Any + * Gets the default type url for Duration * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ diff --git a/packages/google-cloud-eventarc-publishing/protos/protos.js b/packages/google-cloud-eventarc-publishing/protos/protos.js index 5e038a14316..716620e29b9 100644 --- a/packages/google-cloud-eventarc-publishing/protos/protos.js +++ b/packages/google-cloud-eventarc-publishing/protos/protos.js @@ -75,6 +75,858 @@ */ var v1 = {}; + v1.CloudEvent = (function() { + + /** + * Properties of a CloudEvent. + * @memberof google.cloud.eventarc.publishing.v1 + * @interface ICloudEvent + * @property {string|null} [id] CloudEvent id + * @property {string|null} [source] CloudEvent source + * @property {string|null} [specVersion] CloudEvent specVersion + * @property {string|null} [type] CloudEvent type + * @property {Object.|null} [attributes] CloudEvent attributes + * @property {Uint8Array|null} [binaryData] CloudEvent binaryData + * @property {string|null} [textData] CloudEvent textData + * @property {google.protobuf.IAny|null} [protoData] CloudEvent protoData + */ + + /** + * Constructs a new CloudEvent. + * @memberof google.cloud.eventarc.publishing.v1 + * @classdesc Represents a CloudEvent. + * @implements ICloudEvent + * @constructor + * @param {google.cloud.eventarc.publishing.v1.ICloudEvent=} [properties] Properties to set + */ + function CloudEvent(properties) { + this.attributes = {}; + 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]]; + } + + /** + * CloudEvent id. + * @member {string} id + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent + * @instance + */ + CloudEvent.prototype.id = ""; + + /** + * CloudEvent source. + * @member {string} source + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent + * @instance + */ + CloudEvent.prototype.source = ""; + + /** + * CloudEvent specVersion. + * @member {string} specVersion + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent + * @instance + */ + CloudEvent.prototype.specVersion = ""; + + /** + * CloudEvent type. + * @member {string} type + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent + * @instance + */ + CloudEvent.prototype.type = ""; + + /** + * CloudEvent attributes. + * @member {Object.} attributes + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent + * @instance + */ + CloudEvent.prototype.attributes = $util.emptyObject; + + /** + * CloudEvent binaryData. + * @member {Uint8Array|null|undefined} binaryData + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent + * @instance + */ + CloudEvent.prototype.binaryData = null; + + /** + * CloudEvent textData. + * @member {string|null|undefined} textData + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent + * @instance + */ + CloudEvent.prototype.textData = null; + + /** + * CloudEvent protoData. + * @member {google.protobuf.IAny|null|undefined} protoData + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent + * @instance + */ + CloudEvent.prototype.protoData = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CloudEvent data. + * @member {"binaryData"|"textData"|"protoData"|undefined} data + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent + * @instance + */ + Object.defineProperty(CloudEvent.prototype, "data", { + get: $util.oneOfGetter($oneOfFields = ["binaryData", "textData", "protoData"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CloudEvent instance using the specified properties. + * @function create + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent + * @static + * @param {google.cloud.eventarc.publishing.v1.ICloudEvent=} [properties] Properties to set + * @returns {google.cloud.eventarc.publishing.v1.CloudEvent} CloudEvent instance + */ + CloudEvent.create = function create(properties) { + return new CloudEvent(properties); + }; + + /** + * Encodes the specified CloudEvent message. Does not implicitly {@link google.cloud.eventarc.publishing.v1.CloudEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent + * @static + * @param {google.cloud.eventarc.publishing.v1.ICloudEvent} message CloudEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudEvent.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.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.source); + if (message.specVersion != null && Object.hasOwnProperty.call(message, "specVersion")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.specVersion); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.type); + if (message.attributes != null && Object.hasOwnProperty.call(message, "attributes")) + for (var keys = Object.keys(message.attributes), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue.encode(message.attributes[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + if (message.binaryData != null && Object.hasOwnProperty.call(message, "binaryData")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.binaryData); + if (message.textData != null && Object.hasOwnProperty.call(message, "textData")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.textData); + if (message.protoData != null && Object.hasOwnProperty.call(message, "protoData")) + $root.google.protobuf.Any.encode(message.protoData, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CloudEvent message, length delimited. Does not implicitly {@link google.cloud.eventarc.publishing.v1.CloudEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent + * @static + * @param {google.cloud.eventarc.publishing.v1.ICloudEvent} message CloudEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.eventarc.publishing.v1.CloudEvent} CloudEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudEvent.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.google.cloud.eventarc.publishing.v1.CloudEvent(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.id = reader.string(); + break; + } + case 2: { + message.source = reader.string(); + break; + } + case 3: { + message.specVersion = reader.string(); + break; + } + case 4: { + message.type = reader.string(); + break; + } + case 5: { + if (message.attributes === $util.emptyObject) + message.attributes = {}; + 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.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.attributes[key] = value; + break; + } + case 6: { + message.binaryData = reader.bytes(); + break; + } + case 7: { + message.textData = reader.string(); + break; + } + case 8: { + message.protoData = $root.google.protobuf.Any.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.eventarc.publishing.v1.CloudEvent} CloudEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudEvent message. + * @function verify + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.source != null && message.hasOwnProperty("source")) + if (!$util.isString(message.source)) + return "source: string expected"; + if (message.specVersion != null && message.hasOwnProperty("specVersion")) + if (!$util.isString(message.specVersion)) + return "specVersion: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.attributes != null && message.hasOwnProperty("attributes")) { + if (!$util.isObject(message.attributes)) + return "attributes: object expected"; + var key = Object.keys(message.attributes); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue.verify(message.attributes[key[i]]); + if (error) + return "attributes." + error; + } + } + if (message.binaryData != null && message.hasOwnProperty("binaryData")) { + properties.data = 1; + if (!(message.binaryData && typeof message.binaryData.length === "number" || $util.isString(message.binaryData))) + return "binaryData: buffer expected"; + } + if (message.textData != null && message.hasOwnProperty("textData")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + if (!$util.isString(message.textData)) + return "textData: string expected"; + } + if (message.protoData != null && message.hasOwnProperty("protoData")) { + if (properties.data === 1) + return "data: multiple values"; + properties.data = 1; + { + var error = $root.google.protobuf.Any.verify(message.protoData); + if (error) + return "protoData." + error; + } + } + return null; + }; + + /** + * Creates a CloudEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.eventarc.publishing.v1.CloudEvent} CloudEvent + */ + CloudEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.eventarc.publishing.v1.CloudEvent) + return object; + var message = new $root.google.cloud.eventarc.publishing.v1.CloudEvent(); + if (object.id != null) + message.id = String(object.id); + if (object.source != null) + message.source = String(object.source); + if (object.specVersion != null) + message.specVersion = String(object.specVersion); + if (object.type != null) + message.type = String(object.type); + if (object.attributes) { + if (typeof object.attributes !== "object") + throw TypeError(".google.cloud.eventarc.publishing.v1.CloudEvent.attributes: object expected"); + message.attributes = {}; + for (var keys = Object.keys(object.attributes), i = 0; i < keys.length; ++i) { + if (typeof object.attributes[keys[i]] !== "object") + throw TypeError(".google.cloud.eventarc.publishing.v1.CloudEvent.attributes: object expected"); + message.attributes[keys[i]] = $root.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue.fromObject(object.attributes[keys[i]]); + } + } + if (object.binaryData != null) + if (typeof object.binaryData === "string") + $util.base64.decode(object.binaryData, message.binaryData = $util.newBuffer($util.base64.length(object.binaryData)), 0); + else if (object.binaryData.length >= 0) + message.binaryData = object.binaryData; + if (object.textData != null) + message.textData = String(object.textData); + if (object.protoData != null) { + if (typeof object.protoData !== "object") + throw TypeError(".google.cloud.eventarc.publishing.v1.CloudEvent.protoData: object expected"); + message.protoData = $root.google.protobuf.Any.fromObject(object.protoData); + } + return message; + }; + + /** + * Creates a plain object from a CloudEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent + * @static + * @param {google.cloud.eventarc.publishing.v1.CloudEvent} message CloudEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.attributes = {}; + if (options.defaults) { + object.id = ""; + object.source = ""; + object.specVersion = ""; + object.type = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.source != null && message.hasOwnProperty("source")) + object.source = message.source; + if (message.specVersion != null && message.hasOwnProperty("specVersion")) + object.specVersion = message.specVersion; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + var keys2; + if (message.attributes && (keys2 = Object.keys(message.attributes)).length) { + object.attributes = {}; + for (var j = 0; j < keys2.length; ++j) + object.attributes[keys2[j]] = $root.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue.toObject(message.attributes[keys2[j]], options); + } + if (message.binaryData != null && message.hasOwnProperty("binaryData")) { + object.binaryData = options.bytes === String ? $util.base64.encode(message.binaryData, 0, message.binaryData.length) : options.bytes === Array ? Array.prototype.slice.call(message.binaryData) : message.binaryData; + if (options.oneofs) + object.data = "binaryData"; + } + if (message.textData != null && message.hasOwnProperty("textData")) { + object.textData = message.textData; + if (options.oneofs) + object.data = "textData"; + } + if (message.protoData != null && message.hasOwnProperty("protoData")) { + object.protoData = $root.google.protobuf.Any.toObject(message.protoData, options); + if (options.oneofs) + object.data = "protoData"; + } + return object; + }; + + /** + * Converts this CloudEvent to JSON. + * @function toJSON + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent + * @instance + * @returns {Object.} JSON object + */ + CloudEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudEvent + * @function getTypeUrl + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudEvent.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.eventarc.publishing.v1.CloudEvent"; + }; + + CloudEvent.CloudEventAttributeValue = (function() { + + /** + * Properties of a CloudEventAttributeValue. + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent + * @interface ICloudEventAttributeValue + * @property {boolean|null} [ceBoolean] CloudEventAttributeValue ceBoolean + * @property {number|null} [ceInteger] CloudEventAttributeValue ceInteger + * @property {string|null} [ceString] CloudEventAttributeValue ceString + * @property {Uint8Array|null} [ceBytes] CloudEventAttributeValue ceBytes + * @property {string|null} [ceUri] CloudEventAttributeValue ceUri + * @property {string|null} [ceUriRef] CloudEventAttributeValue ceUriRef + * @property {google.protobuf.ITimestamp|null} [ceTimestamp] CloudEventAttributeValue ceTimestamp + */ + + /** + * Constructs a new CloudEventAttributeValue. + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent + * @classdesc Represents a CloudEventAttributeValue. + * @implements ICloudEventAttributeValue + * @constructor + * @param {google.cloud.eventarc.publishing.v1.CloudEvent.ICloudEventAttributeValue=} [properties] Properties to set + */ + function CloudEventAttributeValue(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]]; + } + + /** + * CloudEventAttributeValue ceBoolean. + * @member {boolean|null|undefined} ceBoolean + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue + * @instance + */ + CloudEventAttributeValue.prototype.ceBoolean = null; + + /** + * CloudEventAttributeValue ceInteger. + * @member {number|null|undefined} ceInteger + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue + * @instance + */ + CloudEventAttributeValue.prototype.ceInteger = null; + + /** + * CloudEventAttributeValue ceString. + * @member {string|null|undefined} ceString + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue + * @instance + */ + CloudEventAttributeValue.prototype.ceString = null; + + /** + * CloudEventAttributeValue ceBytes. + * @member {Uint8Array|null|undefined} ceBytes + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue + * @instance + */ + CloudEventAttributeValue.prototype.ceBytes = null; + + /** + * CloudEventAttributeValue ceUri. + * @member {string|null|undefined} ceUri + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue + * @instance + */ + CloudEventAttributeValue.prototype.ceUri = null; + + /** + * CloudEventAttributeValue ceUriRef. + * @member {string|null|undefined} ceUriRef + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue + * @instance + */ + CloudEventAttributeValue.prototype.ceUriRef = null; + + /** + * CloudEventAttributeValue ceTimestamp. + * @member {google.protobuf.ITimestamp|null|undefined} ceTimestamp + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue + * @instance + */ + CloudEventAttributeValue.prototype.ceTimestamp = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CloudEventAttributeValue attr. + * @member {"ceBoolean"|"ceInteger"|"ceString"|"ceBytes"|"ceUri"|"ceUriRef"|"ceTimestamp"|undefined} attr + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue + * @instance + */ + Object.defineProperty(CloudEventAttributeValue.prototype, "attr", { + get: $util.oneOfGetter($oneOfFields = ["ceBoolean", "ceInteger", "ceString", "ceBytes", "ceUri", "ceUriRef", "ceTimestamp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CloudEventAttributeValue instance using the specified properties. + * @function create + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue + * @static + * @param {google.cloud.eventarc.publishing.v1.CloudEvent.ICloudEventAttributeValue=} [properties] Properties to set + * @returns {google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue} CloudEventAttributeValue instance + */ + CloudEventAttributeValue.create = function create(properties) { + return new CloudEventAttributeValue(properties); + }; + + /** + * Encodes the specified CloudEventAttributeValue message. Does not implicitly {@link google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue.verify|verify} messages. + * @function encode + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue + * @static + * @param {google.cloud.eventarc.publishing.v1.CloudEvent.ICloudEventAttributeValue} message CloudEventAttributeValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudEventAttributeValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ceBoolean != null && Object.hasOwnProperty.call(message, "ceBoolean")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.ceBoolean); + if (message.ceInteger != null && Object.hasOwnProperty.call(message, "ceInteger")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.ceInteger); + if (message.ceString != null && Object.hasOwnProperty.call(message, "ceString")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.ceString); + if (message.ceBytes != null && Object.hasOwnProperty.call(message, "ceBytes")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.ceBytes); + if (message.ceUri != null && Object.hasOwnProperty.call(message, "ceUri")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.ceUri); + if (message.ceUriRef != null && Object.hasOwnProperty.call(message, "ceUriRef")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.ceUriRef); + if (message.ceTimestamp != null && Object.hasOwnProperty.call(message, "ceTimestamp")) + $root.google.protobuf.Timestamp.encode(message.ceTimestamp, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CloudEventAttributeValue message, length delimited. Does not implicitly {@link google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue + * @static + * @param {google.cloud.eventarc.publishing.v1.CloudEvent.ICloudEventAttributeValue} message CloudEventAttributeValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudEventAttributeValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudEventAttributeValue message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue} CloudEventAttributeValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudEventAttributeValue.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.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.ceBoolean = reader.bool(); + break; + } + case 2: { + message.ceInteger = reader.int32(); + break; + } + case 3: { + message.ceString = reader.string(); + break; + } + case 4: { + message.ceBytes = reader.bytes(); + break; + } + case 5: { + message.ceUri = reader.string(); + break; + } + case 6: { + message.ceUriRef = reader.string(); + break; + } + case 7: { + message.ceTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudEventAttributeValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue} CloudEventAttributeValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudEventAttributeValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudEventAttributeValue message. + * @function verify + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudEventAttributeValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.ceBoolean != null && message.hasOwnProperty("ceBoolean")) { + properties.attr = 1; + if (typeof message.ceBoolean !== "boolean") + return "ceBoolean: boolean expected"; + } + if (message.ceInteger != null && message.hasOwnProperty("ceInteger")) { + if (properties.attr === 1) + return "attr: multiple values"; + properties.attr = 1; + if (!$util.isInteger(message.ceInteger)) + return "ceInteger: integer expected"; + } + if (message.ceString != null && message.hasOwnProperty("ceString")) { + if (properties.attr === 1) + return "attr: multiple values"; + properties.attr = 1; + if (!$util.isString(message.ceString)) + return "ceString: string expected"; + } + if (message.ceBytes != null && message.hasOwnProperty("ceBytes")) { + if (properties.attr === 1) + return "attr: multiple values"; + properties.attr = 1; + if (!(message.ceBytes && typeof message.ceBytes.length === "number" || $util.isString(message.ceBytes))) + return "ceBytes: buffer expected"; + } + if (message.ceUri != null && message.hasOwnProperty("ceUri")) { + if (properties.attr === 1) + return "attr: multiple values"; + properties.attr = 1; + if (!$util.isString(message.ceUri)) + return "ceUri: string expected"; + } + if (message.ceUriRef != null && message.hasOwnProperty("ceUriRef")) { + if (properties.attr === 1) + return "attr: multiple values"; + properties.attr = 1; + if (!$util.isString(message.ceUriRef)) + return "ceUriRef: string expected"; + } + if (message.ceTimestamp != null && message.hasOwnProperty("ceTimestamp")) { + if (properties.attr === 1) + return "attr: multiple values"; + properties.attr = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.ceTimestamp); + if (error) + return "ceTimestamp." + error; + } + } + return null; + }; + + /** + * Creates a CloudEventAttributeValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue} CloudEventAttributeValue + */ + CloudEventAttributeValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue) + return object; + var message = new $root.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue(); + if (object.ceBoolean != null) + message.ceBoolean = Boolean(object.ceBoolean); + if (object.ceInteger != null) + message.ceInteger = object.ceInteger | 0; + if (object.ceString != null) + message.ceString = String(object.ceString); + if (object.ceBytes != null) + if (typeof object.ceBytes === "string") + $util.base64.decode(object.ceBytes, message.ceBytes = $util.newBuffer($util.base64.length(object.ceBytes)), 0); + else if (object.ceBytes.length >= 0) + message.ceBytes = object.ceBytes; + if (object.ceUri != null) + message.ceUri = String(object.ceUri); + if (object.ceUriRef != null) + message.ceUriRef = String(object.ceUriRef); + if (object.ceTimestamp != null) { + if (typeof object.ceTimestamp !== "object") + throw TypeError(".google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue.ceTimestamp: object expected"); + message.ceTimestamp = $root.google.protobuf.Timestamp.fromObject(object.ceTimestamp); + } + return message; + }; + + /** + * Creates a plain object from a CloudEventAttributeValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue + * @static + * @param {google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue} message CloudEventAttributeValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudEventAttributeValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.ceBoolean != null && message.hasOwnProperty("ceBoolean")) { + object.ceBoolean = message.ceBoolean; + if (options.oneofs) + object.attr = "ceBoolean"; + } + if (message.ceInteger != null && message.hasOwnProperty("ceInteger")) { + object.ceInteger = message.ceInteger; + if (options.oneofs) + object.attr = "ceInteger"; + } + if (message.ceString != null && message.hasOwnProperty("ceString")) { + object.ceString = message.ceString; + if (options.oneofs) + object.attr = "ceString"; + } + if (message.ceBytes != null && message.hasOwnProperty("ceBytes")) { + object.ceBytes = options.bytes === String ? $util.base64.encode(message.ceBytes, 0, message.ceBytes.length) : options.bytes === Array ? Array.prototype.slice.call(message.ceBytes) : message.ceBytes; + if (options.oneofs) + object.attr = "ceBytes"; + } + if (message.ceUri != null && message.hasOwnProperty("ceUri")) { + object.ceUri = message.ceUri; + if (options.oneofs) + object.attr = "ceUri"; + } + if (message.ceUriRef != null && message.hasOwnProperty("ceUriRef")) { + object.ceUriRef = message.ceUriRef; + if (options.oneofs) + object.attr = "ceUriRef"; + } + if (message.ceTimestamp != null && message.hasOwnProperty("ceTimestamp")) { + object.ceTimestamp = $root.google.protobuf.Timestamp.toObject(message.ceTimestamp, options); + if (options.oneofs) + object.attr = "ceTimestamp"; + } + return object; + }; + + /** + * Converts this CloudEventAttributeValue to JSON. + * @function toJSON + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue + * @instance + * @returns {Object.} JSON object + */ + CloudEventAttributeValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudEventAttributeValue + * @function getTypeUrl + * @memberof google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudEventAttributeValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue"; + }; + + return CloudEventAttributeValue; + })(); + + return CloudEvent; + })(); + v1.Publisher = (function() { /** @@ -173,6 +1025,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.eventarc.publishing.v1.Publisher|publish}. + * @memberof google.cloud.eventarc.publishing.v1.Publisher + * @typedef PublishCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.eventarc.publishing.v1.PublishResponse} [response] PublishResponse + */ + + /** + * Calls Publish. + * @function publish + * @memberof google.cloud.eventarc.publishing.v1.Publisher + * @instance + * @param {google.cloud.eventarc.publishing.v1.IPublishRequest} request PublishRequest message or plain object + * @param {google.cloud.eventarc.publishing.v1.Publisher.PublishCallback} callback Node-style callback called with the error, if any, and PublishResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Publisher.prototype.publish = function publish(request, callback) { + return this.rpcCall(publish, $root.google.cloud.eventarc.publishing.v1.PublishRequest, $root.google.cloud.eventarc.publishing.v1.PublishResponse, request, callback); + }, "name", { value: "Publish" }); + + /** + * Calls Publish. + * @function publish + * @memberof google.cloud.eventarc.publishing.v1.Publisher + * @instance + * @param {google.cloud.eventarc.publishing.v1.IPublishRequest} request PublishRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return Publisher; })(); @@ -1102,17 +1987,504 @@ return PublishEventsResponse; })(); - return v1; - })(); - - return publishing; - })(); + v1.PublishRequest = (function() { - return eventarc; - })(); + /** + * Properties of a PublishRequest. + * @memberof google.cloud.eventarc.publishing.v1 + * @interface IPublishRequest + * @property {string|null} [messageBus] PublishRequest messageBus + * @property {google.cloud.eventarc.publishing.v1.ICloudEvent|null} [protoMessage] PublishRequest protoMessage + * @property {string|null} [jsonMessage] PublishRequest jsonMessage + * @property {Uint8Array|null} [avroMessage] PublishRequest avroMessage + */ - return cloud; - })(); + /** + * Constructs a new PublishRequest. + * @memberof google.cloud.eventarc.publishing.v1 + * @classdesc Represents a PublishRequest. + * @implements IPublishRequest + * @constructor + * @param {google.cloud.eventarc.publishing.v1.IPublishRequest=} [properties] Properties to set + */ + function PublishRequest(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]]; + } + + /** + * PublishRequest messageBus. + * @member {string} messageBus + * @memberof google.cloud.eventarc.publishing.v1.PublishRequest + * @instance + */ + PublishRequest.prototype.messageBus = ""; + + /** + * PublishRequest protoMessage. + * @member {google.cloud.eventarc.publishing.v1.ICloudEvent|null|undefined} protoMessage + * @memberof google.cloud.eventarc.publishing.v1.PublishRequest + * @instance + */ + PublishRequest.prototype.protoMessage = null; + + /** + * PublishRequest jsonMessage. + * @member {string|null|undefined} jsonMessage + * @memberof google.cloud.eventarc.publishing.v1.PublishRequest + * @instance + */ + PublishRequest.prototype.jsonMessage = null; + + /** + * PublishRequest avroMessage. + * @member {Uint8Array|null|undefined} avroMessage + * @memberof google.cloud.eventarc.publishing.v1.PublishRequest + * @instance + */ + PublishRequest.prototype.avroMessage = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * PublishRequest format. + * @member {"protoMessage"|"jsonMessage"|"avroMessage"|undefined} format + * @memberof google.cloud.eventarc.publishing.v1.PublishRequest + * @instance + */ + Object.defineProperty(PublishRequest.prototype, "format", { + get: $util.oneOfGetter($oneOfFields = ["protoMessage", "jsonMessage", "avroMessage"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new PublishRequest instance using the specified properties. + * @function create + * @memberof google.cloud.eventarc.publishing.v1.PublishRequest + * @static + * @param {google.cloud.eventarc.publishing.v1.IPublishRequest=} [properties] Properties to set + * @returns {google.cloud.eventarc.publishing.v1.PublishRequest} PublishRequest instance + */ + PublishRequest.create = function create(properties) { + return new PublishRequest(properties); + }; + + /** + * Encodes the specified PublishRequest message. Does not implicitly {@link google.cloud.eventarc.publishing.v1.PublishRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.eventarc.publishing.v1.PublishRequest + * @static + * @param {google.cloud.eventarc.publishing.v1.IPublishRequest} message PublishRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublishRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageBus != null && Object.hasOwnProperty.call(message, "messageBus")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.messageBus); + if (message.protoMessage != null && Object.hasOwnProperty.call(message, "protoMessage")) + $root.google.cloud.eventarc.publishing.v1.CloudEvent.encode(message.protoMessage, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.jsonMessage != null && Object.hasOwnProperty.call(message, "jsonMessage")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.jsonMessage); + if (message.avroMessage != null && Object.hasOwnProperty.call(message, "avroMessage")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.avroMessage); + return writer; + }; + + /** + * Encodes the specified PublishRequest message, length delimited. Does not implicitly {@link google.cloud.eventarc.publishing.v1.PublishRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.eventarc.publishing.v1.PublishRequest + * @static + * @param {google.cloud.eventarc.publishing.v1.IPublishRequest} message PublishRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublishRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PublishRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.eventarc.publishing.v1.PublishRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.eventarc.publishing.v1.PublishRequest} PublishRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublishRequest.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.google.cloud.eventarc.publishing.v1.PublishRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.messageBus = reader.string(); + break; + } + case 2: { + message.protoMessage = $root.google.cloud.eventarc.publishing.v1.CloudEvent.decode(reader, reader.uint32()); + break; + } + case 3: { + message.jsonMessage = reader.string(); + break; + } + case 4: { + message.avroMessage = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PublishRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.eventarc.publishing.v1.PublishRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.eventarc.publishing.v1.PublishRequest} PublishRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublishRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PublishRequest message. + * @function verify + * @memberof google.cloud.eventarc.publishing.v1.PublishRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PublishRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.messageBus != null && message.hasOwnProperty("messageBus")) + if (!$util.isString(message.messageBus)) + return "messageBus: string expected"; + if (message.protoMessage != null && message.hasOwnProperty("protoMessage")) { + properties.format = 1; + { + var error = $root.google.cloud.eventarc.publishing.v1.CloudEvent.verify(message.protoMessage); + if (error) + return "protoMessage." + error; + } + } + if (message.jsonMessage != null && message.hasOwnProperty("jsonMessage")) { + if (properties.format === 1) + return "format: multiple values"; + properties.format = 1; + if (!$util.isString(message.jsonMessage)) + return "jsonMessage: string expected"; + } + if (message.avroMessage != null && message.hasOwnProperty("avroMessage")) { + if (properties.format === 1) + return "format: multiple values"; + properties.format = 1; + if (!(message.avroMessage && typeof message.avroMessage.length === "number" || $util.isString(message.avroMessage))) + return "avroMessage: buffer expected"; + } + return null; + }; + + /** + * Creates a PublishRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.eventarc.publishing.v1.PublishRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.eventarc.publishing.v1.PublishRequest} PublishRequest + */ + PublishRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.eventarc.publishing.v1.PublishRequest) + return object; + var message = new $root.google.cloud.eventarc.publishing.v1.PublishRequest(); + if (object.messageBus != null) + message.messageBus = String(object.messageBus); + if (object.protoMessage != null) { + if (typeof object.protoMessage !== "object") + throw TypeError(".google.cloud.eventarc.publishing.v1.PublishRequest.protoMessage: object expected"); + message.protoMessage = $root.google.cloud.eventarc.publishing.v1.CloudEvent.fromObject(object.protoMessage); + } + if (object.jsonMessage != null) + message.jsonMessage = String(object.jsonMessage); + if (object.avroMessage != null) + if (typeof object.avroMessage === "string") + $util.base64.decode(object.avroMessage, message.avroMessage = $util.newBuffer($util.base64.length(object.avroMessage)), 0); + else if (object.avroMessage.length >= 0) + message.avroMessage = object.avroMessage; + return message; + }; + + /** + * Creates a plain object from a PublishRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.eventarc.publishing.v1.PublishRequest + * @static + * @param {google.cloud.eventarc.publishing.v1.PublishRequest} message PublishRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PublishRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.messageBus = ""; + if (message.messageBus != null && message.hasOwnProperty("messageBus")) + object.messageBus = message.messageBus; + if (message.protoMessage != null && message.hasOwnProperty("protoMessage")) { + object.protoMessage = $root.google.cloud.eventarc.publishing.v1.CloudEvent.toObject(message.protoMessage, options); + if (options.oneofs) + object.format = "protoMessage"; + } + if (message.jsonMessage != null && message.hasOwnProperty("jsonMessage")) { + object.jsonMessage = message.jsonMessage; + if (options.oneofs) + object.format = "jsonMessage"; + } + if (message.avroMessage != null && message.hasOwnProperty("avroMessage")) { + object.avroMessage = options.bytes === String ? $util.base64.encode(message.avroMessage, 0, message.avroMessage.length) : options.bytes === Array ? Array.prototype.slice.call(message.avroMessage) : message.avroMessage; + if (options.oneofs) + object.format = "avroMessage"; + } + return object; + }; + + /** + * Converts this PublishRequest to JSON. + * @function toJSON + * @memberof google.cloud.eventarc.publishing.v1.PublishRequest + * @instance + * @returns {Object.} JSON object + */ + PublishRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PublishRequest + * @function getTypeUrl + * @memberof google.cloud.eventarc.publishing.v1.PublishRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PublishRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.eventarc.publishing.v1.PublishRequest"; + }; + + return PublishRequest; + })(); + + v1.PublishResponse = (function() { + + /** + * Properties of a PublishResponse. + * @memberof google.cloud.eventarc.publishing.v1 + * @interface IPublishResponse + */ + + /** + * Constructs a new PublishResponse. + * @memberof google.cloud.eventarc.publishing.v1 + * @classdesc Represents a PublishResponse. + * @implements IPublishResponse + * @constructor + * @param {google.cloud.eventarc.publishing.v1.IPublishResponse=} [properties] Properties to set + */ + function PublishResponse(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]]; + } + + /** + * Creates a new PublishResponse instance using the specified properties. + * @function create + * @memberof google.cloud.eventarc.publishing.v1.PublishResponse + * @static + * @param {google.cloud.eventarc.publishing.v1.IPublishResponse=} [properties] Properties to set + * @returns {google.cloud.eventarc.publishing.v1.PublishResponse} PublishResponse instance + */ + PublishResponse.create = function create(properties) { + return new PublishResponse(properties); + }; + + /** + * Encodes the specified PublishResponse message. Does not implicitly {@link google.cloud.eventarc.publishing.v1.PublishResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.eventarc.publishing.v1.PublishResponse + * @static + * @param {google.cloud.eventarc.publishing.v1.IPublishResponse} message PublishResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublishResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified PublishResponse message, length delimited. Does not implicitly {@link google.cloud.eventarc.publishing.v1.PublishResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.eventarc.publishing.v1.PublishResponse + * @static + * @param {google.cloud.eventarc.publishing.v1.IPublishResponse} message PublishResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublishResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PublishResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.eventarc.publishing.v1.PublishResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.eventarc.publishing.v1.PublishResponse} PublishResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublishResponse.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.google.cloud.eventarc.publishing.v1.PublishResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PublishResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.eventarc.publishing.v1.PublishResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.eventarc.publishing.v1.PublishResponse} PublishResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublishResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PublishResponse message. + * @function verify + * @memberof google.cloud.eventarc.publishing.v1.PublishResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PublishResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a PublishResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.eventarc.publishing.v1.PublishResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.eventarc.publishing.v1.PublishResponse} PublishResponse + */ + PublishResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.eventarc.publishing.v1.PublishResponse) + return object; + return new $root.google.cloud.eventarc.publishing.v1.PublishResponse(); + }; + + /** + * Creates a plain object from a PublishResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.eventarc.publishing.v1.PublishResponse + * @static + * @param {google.cloud.eventarc.publishing.v1.PublishResponse} message PublishResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PublishResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this PublishResponse to JSON. + * @function toJSON + * @memberof google.cloud.eventarc.publishing.v1.PublishResponse + * @instance + * @returns {Object.} JSON object + */ + PublishResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PublishResponse + * @function getTypeUrl + * @memberof google.cloud.eventarc.publishing.v1.PublishResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PublishResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.eventarc.publishing.v1.PublishResponse"; + }; + + return PublishResponse; + })(); + + return v1; + })(); + + return publishing; + })(); + + return eventarc; + })(); + + return cloud; + })(); google.api = (function() { @@ -1123,6 +2495,34 @@ */ var api = {}; + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + * @property {number} NON_EMPTY_DEFAULT=7 NON_EMPTY_DEFAULT value + * @property {number} IDENTIFIER=8 IDENTIFIER value + */ + api.FieldBehavior = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FIELD_BEHAVIOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "OPTIONAL"] = 1; + values[valuesById[2] = "REQUIRED"] = 2; + values[valuesById[3] = "OUTPUT_ONLY"] = 3; + values[valuesById[4] = "INPUT_ONLY"] = 4; + values[valuesById[5] = "IMMUTABLE"] = 5; + values[valuesById[6] = "UNORDERED_LIST"] = 6; + values[valuesById[7] = "NON_EMPTY_DEFAULT"] = 7; + values[valuesById[8] = "IDENTIFIER"] = 8; + return values; + })(); + api.Http = (function() { /** @@ -6015,6 +7415,263 @@ return values; })(); + api.FieldInfo = (function() { + + /** + * Properties of a FieldInfo. + * @memberof google.api + * @interface IFieldInfo + * @property {google.api.FieldInfo.Format|null} [format] FieldInfo format + */ + + /** + * Constructs a new FieldInfo. + * @memberof google.api + * @classdesc Represents a FieldInfo. + * @implements IFieldInfo + * @constructor + * @param {google.api.IFieldInfo=} [properties] Properties to set + */ + function FieldInfo(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]]; + } + + /** + * FieldInfo format. + * @member {google.api.FieldInfo.Format} format + * @memberof google.api.FieldInfo + * @instance + */ + FieldInfo.prototype.format = 0; + + /** + * Creates a new FieldInfo instance using the specified properties. + * @function create + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo=} [properties] Properties to set + * @returns {google.api.FieldInfo} FieldInfo instance + */ + FieldInfo.create = function create(properties) { + return new FieldInfo(properties); + }; + + /** + * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @function encode + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.format); + return writer; + }; + + /** + * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldInfo message from the specified reader or buffer. + * @function decode + * @memberof google.api.FieldInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.FieldInfo} FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldInfo.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.google.api.FieldInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.format = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.FieldInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.FieldInfo} FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldInfo message. + * @function verify + * @memberof google.api.FieldInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.format != null && message.hasOwnProperty("format")) + switch (message.format) { + default: + return "format: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.FieldInfo + * @static + * @param {Object.} object Plain object + * @returns {google.api.FieldInfo} FieldInfo + */ + FieldInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.FieldInfo) + return object; + var message = new $root.google.api.FieldInfo(); + switch (object.format) { + default: + if (typeof object.format === "number") { + message.format = object.format; + break; + } + break; + case "FORMAT_UNSPECIFIED": + case 0: + message.format = 0; + break; + case "UUID4": + case 1: + message.format = 1; + break; + case "IPV4": + case 2: + message.format = 2; + break; + case "IPV6": + case 3: + message.format = 3; + break; + case "IPV4_OR_IPV6": + case 4: + message.format = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.FieldInfo + * @static + * @param {google.api.FieldInfo} message FieldInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; + if (message.format != null && message.hasOwnProperty("format")) + object.format = options.enums === String ? $root.google.api.FieldInfo.Format[message.format] === undefined ? message.format : $root.google.api.FieldInfo.Format[message.format] : message.format; + return object; + }; + + /** + * Converts this FieldInfo to JSON. + * @function toJSON + * @memberof google.api.FieldInfo + * @instance + * @returns {Object.} JSON object + */ + FieldInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldInfo + * @function getTypeUrl + * @memberof google.api.FieldInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.FieldInfo"; + }; + + /** + * Format enum. + * @name google.api.FieldInfo.Format + * @enum {number} + * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value + * @property {number} UUID4=1 UUID4 value + * @property {number} IPV4=2 IPV4 value + * @property {number} IPV6=3 IPV6 value + * @property {number} IPV4_OR_IPV6=4 IPV4_OR_IPV6 value + */ + FieldInfo.Format = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "UUID4"] = 1; + values[valuesById[2] = "IPV4"] = 2; + values[valuesById[3] = "IPV6"] = 3; + values[valuesById[4] = "IPV4_OR_IPV6"] = 4; + return values; + })(); + + return FieldInfo; + })(); + return api; })(); @@ -12114,6 +13771,8 @@ * @property {Array.|null} [editionDefaults] FieldOptions editionDefaults * @property {google.protobuf.IFeatureSet|null} [features] FieldOptions features * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {Array.|null} [".google.api.fieldBehavior"] FieldOptions .google.api.fieldBehavior + * @property {google.api.IFieldInfo|null} [".google.api.fieldInfo"] FieldOptions .google.api.fieldInfo */ /** @@ -12128,6 +13787,7 @@ this.targets = []; this.editionDefaults = []; this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12238,6 +13898,22 @@ */ FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldInfo. + * @member {google.api.IFieldInfo|null|undefined} .google.api.fieldInfo + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldInfo"] = null; + /** * Creates a new FieldOptions instance using the specified properties. * @function create @@ -12291,6 +13967,14 @@ if (message.uninterpretedOption != null && message.uninterpretedOption.length) for (var i = 0; i < message.uninterpretedOption.length; ++i) $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) { + writer.uint32(/* id 1052, wireType 2 =*/8418).fork(); + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.int32(message[".google.api.fieldBehavior"][i]); + writer.ldelim(); + } + if (message[".google.api.fieldInfo"] != null && Object.hasOwnProperty.call(message, ".google.api.fieldInfo")) + $root.google.api.FieldInfo.encode(message[".google.api.fieldInfo"], writer.uint32(/* id 291403980, wireType 2 =*/2331231842).fork()).ldelim(); return writer; }; @@ -12388,6 +14072,21 @@ message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); break; } + case 1052: { + if (!(message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length)) + message[".google.api.fieldBehavior"] = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message[".google.api.fieldBehavior"].push(reader.int32()); + } else + message[".google.api.fieldBehavior"].push(reader.int32()); + break; + } + case 291403980: { + message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -12511,6 +14210,30 @@ return "uninterpretedOption." + error; } } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) { + var error = $root.google.api.FieldInfo.verify(message[".google.api.fieldInfo"]); + if (error) + return ".google.api.fieldInfo." + error; + } return null; }; @@ -12666,15 +14389,69 @@ throw TypeError(".google.protobuf.FieldOptions.features: object expected"); message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + break; + } + } + if (object[".google.api.fieldInfo"] != null) { + if (typeof object[".google.api.fieldInfo"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldInfo: object expected"); + message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.fromObject(object[".google.api.fieldInfo"]); } return message; }; @@ -12696,6 +14473,7 @@ object.targets = []; object.editionDefaults = []; object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; } if (options.defaults) { object.ctype = options.enums === String ? "STRING" : 0; @@ -12708,6 +14486,7 @@ object.debugRedact = false; object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; object.features = null; + object[".google.api.fieldInfo"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; @@ -12744,6 +14523,13 @@ for (var j = 0; j < message.uninterpretedOption.length; ++j) object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) + object[".google.api.fieldInfo"] = $root.google.api.FieldInfo.toObject(message[".google.api.fieldInfo"], options); return object; }; @@ -17810,28 +19596,264 @@ return Annotation; })(); - return GeneratedCodeInfo; + return GeneratedCodeInfo; + })(); + + protobuf.Any = (function() { + + /** + * Properties of an Any. + * @memberof google.protobuf + * @interface IAny + * @property {string|null} [type_url] Any type_url + * @property {Uint8Array|null} [value] Any value + */ + + /** + * Constructs a new Any. + * @memberof google.protobuf + * @classdesc Represents an Any. + * @implements IAny + * @constructor + * @param {google.protobuf.IAny=} [properties] Properties to set + */ + function Any(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]]; + } + + /** + * Any type_url. + * @member {string} type_url + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.type_url = ""; + + /** + * Any value. + * @member {Uint8Array} value + * @memberof google.protobuf.Any + * @instance + */ + Any.prototype.value = $util.newBuffer([]); + + /** + * Creates a new Any instance using the specified properties. + * @function create + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny=} [properties] Properties to set + * @returns {google.protobuf.Any} Any instance + */ + Any.create = function create(properties) { + return new Any(properties); + }; + + /** + * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Any.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Any message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.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.google.protobuf.Any(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Any message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Any + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Any} Any + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Any.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Any message. + * @function verify + * @memberof google.protobuf.Any + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Any.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type_url != null && message.hasOwnProperty("type_url")) + if (!$util.isString(message.type_url)) + return "type_url: 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 Any message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Any + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Any} Any + */ + Any.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Any) + return object; + var message = new $root.google.protobuf.Any(); + if (object.type_url != null) + message.type_url = String(object.type_url); + 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 >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from an Any message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Any + * @static + * @param {google.protobuf.Any} message Any + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Any.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type_url = ""; + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + } + if (message.type_url != null && message.hasOwnProperty("type_url")) + object.type_url = message.type_url; + 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 Any to JSON. + * @function toJSON + * @memberof google.protobuf.Any + * @instance + * @returns {Object.} JSON object + */ + Any.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Any + * @function getTypeUrl + * @memberof google.protobuf.Any + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Any"; + }; + + return Any; })(); - protobuf.Duration = (function() { + protobuf.Timestamp = (function() { /** - * Properties of a Duration. + * Properties of a Timestamp. * @memberof google.protobuf - * @interface IDuration - * @property {number|Long|null} [seconds] Duration seconds - * @property {number|null} [nanos] Duration nanos + * @interface ITimestamp + * @property {number|Long|null} [seconds] Timestamp seconds + * @property {number|null} [nanos] Timestamp nanos */ /** - * Constructs a new Duration. + * Constructs a new Timestamp. * @memberof google.protobuf - * @classdesc Represents a Duration. - * @implements IDuration + * @classdesc Represents a Timestamp. + * @implements ITimestamp * @constructor - * @param {google.protobuf.IDuration=} [properties] Properties to set + * @param {google.protobuf.ITimestamp=} [properties] Properties to set */ - function Duration(properties) { + function Timestamp(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -17839,43 +19861,43 @@ } /** - * Duration seconds. + * Timestamp seconds. * @member {number|Long} seconds - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Timestamp * @instance */ - Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Duration nanos. + * Timestamp nanos. * @member {number} nanos - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Timestamp * @instance */ - Duration.prototype.nanos = 0; + Timestamp.prototype.nanos = 0; /** - * Creates a new Duration instance using the specified properties. + * Creates a new Timestamp instance using the specified properties. * @function create - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.IDuration=} [properties] Properties to set - * @returns {google.protobuf.Duration} Duration instance + * @param {google.protobuf.ITimestamp=} [properties] Properties to set + * @returns {google.protobuf.Timestamp} Timestamp instance */ - Duration.create = function create(properties) { - return new Duration(properties); + Timestamp.create = function create(properties) { + return new Timestamp(properties); }; /** - * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * Encodes the specified Timestamp message. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. * @function encode - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Duration.encode = function encode(message, writer) { + Timestamp.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) @@ -17886,33 +19908,33 @@ }; /** - * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. + * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link google.protobuf.Timestamp.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.IDuration} message Duration message or plain object to encode + * @param {google.protobuf.ITimestamp} message Timestamp message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Duration.encodeDelimited = function encodeDelimited(message, writer) { + Timestamp.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Duration message from the specified reader or buffer. + * Decodes a Timestamp message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Timestamp * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Duration} Duration + * @returns {google.protobuf.Timestamp} Timestamp * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Duration.decode = function decode(reader, length) { + Timestamp.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.google.protobuf.Duration(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Timestamp(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -17933,30 +19955,30 @@ }; /** - * Decodes a Duration message from the specified reader or buffer, length delimited. + * Decodes a Timestamp message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Timestamp * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Duration} Duration + * @returns {google.protobuf.Timestamp} Timestamp * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Duration.decodeDelimited = function decodeDelimited(reader) { + Timestamp.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Duration message. + * Verifies a Timestamp message. * @function verify - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Timestamp * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Duration.verify = function verify(message) { + Timestamp.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.seconds != null && message.hasOwnProperty("seconds")) @@ -17969,17 +19991,17 @@ }; /** - * Creates a Duration message from a plain object. Also converts values to their respective internal types. + * Creates a Timestamp message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Timestamp * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Duration} Duration + * @returns {google.protobuf.Timestamp} Timestamp */ - Duration.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Duration) + Timestamp.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Timestamp) return object; - var message = new $root.google.protobuf.Duration(); + var message = new $root.google.protobuf.Timestamp(); if (object.seconds != null) if ($util.Long) (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; @@ -17995,15 +20017,15 @@ }; /** - * Creates a plain object from a Duration message. Also converts values to other types if specified. + * Creates a plain object from a Timestamp message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Timestamp * @static - * @param {google.protobuf.Duration} message Duration + * @param {google.protobuf.Timestamp} message Timestamp * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Duration.toObject = function toObject(message, options) { + Timestamp.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -18026,53 +20048,53 @@ }; /** - * Converts this Duration to JSON. + * Converts this Timestamp to JSON. * @function toJSON - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Timestamp * @instance * @returns {Object.} JSON object */ - Duration.prototype.toJSON = function toJSON() { + Timestamp.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Duration + * Gets the default type url for Timestamp * @function getTypeUrl - * @memberof google.protobuf.Duration + * @memberof google.protobuf.Timestamp * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Timestamp.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Duration"; + return typeUrlPrefix + "/google.protobuf.Timestamp"; }; - return Duration; + return Timestamp; })(); - protobuf.Any = (function() { + protobuf.Duration = (function() { /** - * Properties of an Any. + * Properties of a Duration. * @memberof google.protobuf - * @interface IAny - * @property {string|null} [type_url] Any type_url - * @property {Uint8Array|null} [value] Any value + * @interface IDuration + * @property {number|Long|null} [seconds] Duration seconds + * @property {number|null} [nanos] Duration nanos */ /** - * Constructs a new Any. + * Constructs a new Duration. * @memberof google.protobuf - * @classdesc Represents an Any. - * @implements IAny + * @classdesc Represents a Duration. + * @implements IDuration * @constructor - * @param {google.protobuf.IAny=} [properties] Properties to set + * @param {google.protobuf.IDuration=} [properties] Properties to set */ - function Any(properties) { + function Duration(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -18080,89 +20102,89 @@ } /** - * Any type_url. - * @member {string} type_url - * @memberof google.protobuf.Any + * Duration seconds. + * @member {number|Long} seconds + * @memberof google.protobuf.Duration * @instance */ - Any.prototype.type_url = ""; + Duration.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Any value. - * @member {Uint8Array} value - * @memberof google.protobuf.Any + * Duration nanos. + * @member {number} nanos + * @memberof google.protobuf.Duration * @instance */ - Any.prototype.value = $util.newBuffer([]); + Duration.prototype.nanos = 0; /** - * Creates a new Any instance using the specified properties. + * Creates a new Duration instance using the specified properties. * @function create - * @memberof google.protobuf.Any + * @memberof google.protobuf.Duration * @static - * @param {google.protobuf.IAny=} [properties] Properties to set - * @returns {google.protobuf.Any} Any instance + * @param {google.protobuf.IDuration=} [properties] Properties to set + * @returns {google.protobuf.Duration} Duration instance */ - Any.create = function create(properties) { - return new Any(properties); + Duration.create = function create(properties) { + return new Duration(properties); }; /** - * Encodes the specified Any message. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * Encodes the specified Duration message. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. * @function encode - * @memberof google.protobuf.Any + * @memberof google.protobuf.Duration * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {google.protobuf.IDuration} message Duration message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Any.encode = function encode(message, writer) { + Duration.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.type_url != null && Object.hasOwnProperty.call(message, "type_url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type_url); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.value); + if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds); + if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos); return writer; }; /** - * Encodes the specified Any message, length delimited. Does not implicitly {@link google.protobuf.Any.verify|verify} messages. + * Encodes the specified Duration message, length delimited. Does not implicitly {@link google.protobuf.Duration.verify|verify} messages. * @function encodeDelimited - * @memberof google.protobuf.Any + * @memberof google.protobuf.Duration * @static - * @param {google.protobuf.IAny} message Any message or plain object to encode + * @param {google.protobuf.IDuration} message Duration message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Any.encodeDelimited = function encodeDelimited(message, writer) { + Duration.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Any message from the specified reader or buffer. + * Decodes a Duration message from the specified reader or buffer. * @function decode - * @memberof google.protobuf.Any + * @memberof google.protobuf.Duration * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.Any} Any + * @returns {google.protobuf.Duration} Duration * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Any.decode = function decode(reader, length) { + Duration.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.google.protobuf.Any(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Duration(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.type_url = reader.string(); + message.seconds = reader.int64(); break; } case 2: { - message.value = reader.bytes(); + message.nanos = reader.int32(); break; } default: @@ -18174,120 +20196,125 @@ }; /** - * Decodes an Any message from the specified reader or buffer, length delimited. + * Decodes a Duration message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.protobuf.Any + * @memberof google.protobuf.Duration * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.Any} Any + * @returns {google.protobuf.Duration} Duration * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Any.decodeDelimited = function decodeDelimited(reader) { + Duration.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Any message. + * Verifies a Duration message. * @function verify - * @memberof google.protobuf.Any + * @memberof google.protobuf.Duration * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Any.verify = function verify(message) { + Duration.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.type_url != null && message.hasOwnProperty("type_url")) - if (!$util.isString(message.type_url)) - return "type_url: 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"; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high))) + return "seconds: integer|Long expected"; + if (message.nanos != null && message.hasOwnProperty("nanos")) + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; return null; }; /** - * Creates an Any message from a plain object. Also converts values to their respective internal types. + * Creates a Duration message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.protobuf.Any + * @memberof google.protobuf.Duration * @static * @param {Object.} object Plain object - * @returns {google.protobuf.Any} Any + * @returns {google.protobuf.Duration} Duration */ - Any.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.Any) + Duration.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Duration) return object; - var message = new $root.google.protobuf.Any(); - if (object.type_url != null) - message.type_url = String(object.type_url); - 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 >= 0) - message.value = object.value; + var message = new $root.google.protobuf.Duration(); + if (object.seconds != null) + if ($util.Long) + (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false; + else if (typeof object.seconds === "string") + message.seconds = parseInt(object.seconds, 10); + else if (typeof object.seconds === "number") + message.seconds = object.seconds; + else if (typeof object.seconds === "object") + message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber(); + if (object.nanos != null) + message.nanos = object.nanos | 0; return message; }; /** - * Creates a plain object from an Any message. Also converts values to other types if specified. + * Creates a plain object from a Duration message. Also converts values to other types if specified. * @function toObject - * @memberof google.protobuf.Any + * @memberof google.protobuf.Duration * @static - * @param {google.protobuf.Any} message Any + * @param {google.protobuf.Duration} message Duration * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Any.toObject = function toObject(message, options) { + Duration.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.type_url = ""; - if (options.bytes === String) - object.value = ""; - else { - object.value = []; - if (options.bytes !== Array) - object.value = $util.newBuffer(object.value); - } + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.seconds = options.longs === String ? "0" : 0; + object.nanos = 0; } - if (message.type_url != null && message.hasOwnProperty("type_url")) - object.type_url = message.type_url; - 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; + if (message.seconds != null && message.hasOwnProperty("seconds")) + if (typeof message.seconds === "number") + object.seconds = options.longs === String ? String(message.seconds) : message.seconds; + else + object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds; + if (message.nanos != null && message.hasOwnProperty("nanos")) + object.nanos = message.nanos; return object; }; /** - * Converts this Any to JSON. + * Converts this Duration to JSON. * @function toJSON - * @memberof google.protobuf.Any + * @memberof google.protobuf.Duration * @instance * @returns {Object.} JSON object */ - Any.prototype.toJSON = function toJSON() { + Duration.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Any + * Gets the default type url for Duration * @function getTypeUrl - * @memberof google.protobuf.Any + * @memberof google.protobuf.Duration * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Any.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Duration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.protobuf.Any"; + return typeUrlPrefix + "/google.protobuf.Duration"; }; - return Any; + return Duration; })(); return protobuf; diff --git a/packages/google-cloud-eventarc-publishing/protos/protos.json b/packages/google-cloud-eventarc-publishing/protos/protos.json index e04ca44956e..ff02b2b7bd8 100644 --- a/packages/google-cloud-eventarc-publishing/protos/protos.json +++ b/packages/google-cloud-eventarc-publishing/protos/protos.json @@ -1,4 +1,7 @@ { + "options": { + "syntax": "proto3" + }, "nested": { "google": { "nested": { @@ -19,6 +22,123 @@ "ruby_package": "Google::Cloud::Eventarc::Publishing::V1" }, "nested": { + "CloudEvent": { + "oneofs": { + "data": { + "oneof": [ + "binaryData", + "textData", + "protoData" + ] + } + }, + "fields": { + "id": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "source": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "specVersion": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "type": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "attributes": { + "keyType": "string", + "type": "CloudEventAttributeValue", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "binaryData": { + "type": "bytes", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "textData": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "protoData": { + "type": "google.protobuf.Any", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "CloudEventAttributeValue": { + "oneofs": { + "attr": { + "oneof": [ + "ceBoolean", + "ceInteger", + "ceString", + "ceBytes", + "ceUri", + "ceUriRef", + "ceTimestamp" + ] + } + }, + "fields": { + "ceBoolean": { + "type": "bool", + "id": 1 + }, + "ceInteger": { + "type": "int32", + "id": 2 + }, + "ceString": { + "type": "string", + "id": 3 + }, + "ceBytes": { + "type": "bytes", + "id": 4 + }, + "ceUri": { + "type": "string", + "id": 5 + }, + "ceUriRef": { + "type": "string", + "id": 6 + }, + "ceTimestamp": { + "type": "google.protobuf.Timestamp", + "id": 7 + } + } + } + } + }, "Publisher": { "options": { "(google.api.default_host)": "eventarcpublishing.googleapis.com", @@ -56,6 +176,22 @@ } } ] + }, + "Publish": { + "requestType": "PublishRequest", + "responseType": "PublishResponse", + "options": { + "(google.api.http).post": "/v1/{message_bus=projects/*/locations/*/messageBuses/*}:publish", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{message_bus=projects/*/locations/*/messageBuses/*}:publish", + "body": "*" + } + } + ] } } }, @@ -100,6 +236,41 @@ }, "PublishEventsResponse": { "fields": {} + }, + "PublishRequest": { + "oneofs": { + "format": { + "oneof": [ + "protoMessage", + "jsonMessage", + "avroMessage" + ] + } + }, + "fields": { + "messageBus": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "protoMessage": { + "type": "CloudEvent", + "id": 2 + }, + "jsonMessage": { + "type": "string", + "id": 3 + }, + "avroMessage": { + "type": "bytes", + "id": 4 + } + } + }, + "PublishResponse": { + "fields": {} } } } @@ -111,14 +282,33 @@ }, "api": { "options": { - "go_package": "google.golang.org/genproto/googleapis/api;api", + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", "java_multiple_files": true, - "java_outer_classname": "LaunchStageProto", + "java_outer_classname": "FieldInfoProto", "java_package": "com.google.api", "objc_class_prefix": "GAPI", "cc_enable_arenas": true }, "nested": { + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7, + "IDENTIFIER": 8 + } + }, "http": { "type": "HttpRule", "id": 72295728, @@ -500,6 +690,30 @@ "GA": 4, "DEPRECATED": 5 } + }, + "fieldInfo": { + "type": "google.api.FieldInfo", + "id": 291403980, + "extend": "google.protobuf.FieldOptions" + }, + "FieldInfo": { + "fields": { + "format": { + "type": "Format", + "id": 1 + } + }, + "nested": { + "Format": { + "values": { + "FORMAT_UNSPECIFIED": 0, + "UUID4": 1, + "IPV4": 2, + "IPV6": 3, + "IPV4_OR_IPV6": 4 + } + } + } } } }, @@ -1778,7 +1992,19 @@ } } }, - "Duration": { + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Timestamp": { "fields": { "seconds": { "type": "int64", @@ -1790,14 +2016,14 @@ } } }, - "Any": { + "Duration": { "fields": { - "type_url": { - "type": "string", + "seconds": { + "type": "int64", "id": 1 }, - "value": { - "type": "bytes", + "nanos": { + "type": "int32", "id": 2 } } diff --git a/packages/google-cloud-eventarc-publishing/samples/README.md b/packages/google-cloud-eventarc-publishing/samples/README.md index b57f36df85f..94ae3c13f68 100644 --- a/packages/google-cloud-eventarc-publishing/samples/README.md +++ b/packages/google-cloud-eventarc-publishing/samples/README.md @@ -12,6 +12,7 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) + * [Publisher.publish](#publisher.publish) * [Publisher.publish_channel_connection_events](#publisher.publish_channel_connection_events) * [Publisher.publish_events](#publisher.publish_events) * [Quickstart](#quickstart) @@ -31,6 +32,23 @@ Before running the samples, make sure you've followed the steps outlined in +### Publisher.publish + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-eventarc-publishing/samples/generated/v1/publisher.publish.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-eventarc-publishing/samples/generated/v1/publisher.publish.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-eventarc-publishing/samples/generated/v1/publisher.publish.js` + + +----- + + + + ### Publisher.publish_channel_connection_events View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-eventarc-publishing/samples/generated/v1/publisher.publish_channel_connection_events.js). diff --git a/packages/google-cloud-eventarc-publishing/samples/generated/v1/publisher.publish.js b/packages/google-cloud-eventarc-publishing/samples/generated/v1/publisher.publish.js new file mode 100644 index 00000000000..e32138911d2 --- /dev/null +++ b/packages/google-cloud-eventarc-publishing/samples/generated/v1/publisher.publish.js @@ -0,0 +1,80 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://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. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(messageBus) { + // [START eventarcpublishing_v1_generated_Publisher_Publish_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The full name of the message bus to publish events to. Format: + * `projects/{project}/locations/{location}/messageBuses/{messageBus}`. + */ + // const messageBus = 'abc123' + /** + * The Protobuf format of the CloudEvent being published. Specification can + * be found here: + * https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/protobuf-format.md + */ + // const protoMessage = {} + /** + * The JSON format of the CloudEvent being published. Specification can be + * found here: + * https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/json-format.md + */ + // const jsonMessage = 'abc123' + /** + * The Avro format of the CloudEvent being published. Specification can + * be found here: + * https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/avro-format.md + */ + // const avroMessage = Buffer.from('string') + + // Imports the Publishing library + const {PublisherClient} = require('@google-cloud/eventarc-publishing').v1; + + // Instantiates a client + const publishingClient = new PublisherClient(); + + async function callPublish() { + // Construct request + const request = { + messageBus, + }; + + // Run request + const response = await publishingClient.publish(request); + console.log(response); + } + + callPublish(); + // [END eventarcpublishing_v1_generated_Publisher_Publish_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-eventarc-publishing/samples/generated/v1/snippet_metadata_google.cloud.eventarc.publishing.v1.json b/packages/google-cloud-eventarc-publishing/samples/generated/v1/snippet_metadata_google.cloud.eventarc.publishing.v1.json index 7a61118dbff..547b27ce214 100644 --- a/packages/google-cloud-eventarc-publishing/samples/generated/v1/snippet_metadata_google.cloud.eventarc.publishing.v1.json +++ b/packages/google-cloud-eventarc-publishing/samples/generated/v1/snippet_metadata_google.cloud.eventarc.publishing.v1.json @@ -106,6 +106,58 @@ } } } + }, + { + "regionTag": "eventarcpublishing_v1_generated_Publisher_Publish_async", + "title": "Publisher publish Sample", + "origin": "API_DEFINITION", + "description": " Publish events to a message bus.", + "canonical": true, + "file": "publisher.publish.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "Publish", + "fullName": "google.cloud.eventarc.publishing.v1.Publisher.Publish", + "async": true, + "parameters": [ + { + "name": "message_bus", + "type": "TYPE_STRING" + }, + { + "name": "proto_message", + "type": ".google.cloud.eventarc.publishing.v1.CloudEvent" + }, + { + "name": "json_message", + "type": "TYPE_STRING" + }, + { + "name": "avro_message", + "type": "TYPE_BYTES" + } + ], + "resultType": ".google.cloud.eventarc.publishing.v1.PublishResponse", + "client": { + "shortName": "PublisherClient", + "fullName": "google.cloud.eventarc.publishing.v1.PublisherClient" + }, + "method": { + "shortName": "Publish", + "fullName": "google.cloud.eventarc.publishing.v1.Publisher.Publish", + "service": { + "shortName": "Publisher", + "fullName": "google.cloud.eventarc.publishing.v1.Publisher" + } + } + } } ] } \ No newline at end of file diff --git a/packages/google-cloud-eventarc-publishing/src/v1/gapic_metadata.json b/packages/google-cloud-eventarc-publishing/src/v1/gapic_metadata.json index 159d743f3b8..ec79a2d0cd8 100644 --- a/packages/google-cloud-eventarc-publishing/src/v1/gapic_metadata.json +++ b/packages/google-cloud-eventarc-publishing/src/v1/gapic_metadata.json @@ -19,6 +19,11 @@ "methods": [ "publishEvents" ] + }, + "Publish": { + "methods": [ + "publish" + ] } } }, @@ -34,6 +39,11 @@ "methods": [ "publishEvents" ] + }, + "Publish": { + "methods": [ + "publish" + ] } } } diff --git a/packages/google-cloud-eventarc-publishing/src/v1/publisher_client.ts b/packages/google-cloud-eventarc-publishing/src/v1/publisher_client.ts index aafd7a6d0a0..fc2226e1381 100644 --- a/packages/google-cloud-eventarc-publishing/src/v1/publisher_client.ts +++ b/packages/google-cloud-eventarc-publishing/src/v1/publisher_client.ts @@ -267,6 +267,7 @@ export class PublisherClient { const publisherStubMethods = [ 'publishChannelConnectionEvents', 'publishEvents', + 'publish', ]; for (const methodName of publisherStubMethods) { const callPromise = this.publisherStub.then( @@ -597,6 +598,109 @@ export class PublisherClient { this.initialize(); return this.innerApiCalls.publishEvents(request, options, callback); } + /** + * Publish events to a message bus. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.messageBus + * Required. The full name of the message bus to publish events to. Format: + * `projects/{project}/locations/{location}/messageBuses/{messageBus}`. + * @param {google.cloud.eventarc.publishing.v1.CloudEvent} request.protoMessage + * The Protobuf format of the CloudEvent being published. Specification can + * be found here: + * https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/protobuf-format.md + * @param {string} request.jsonMessage + * The JSON format of the CloudEvent being published. Specification can be + * found here: + * https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/json-format.md + * @param {Buffer} request.avroMessage + * The Avro format of the CloudEvent being published. Specification can + * be found here: + * https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/avro-format.md + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.eventarc.publishing.v1.PublishResponse|PublishResponse}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example include:samples/generated/v1/publisher.publish.js + * region_tag:eventarcpublishing_v1_generated_Publisher_Publish_async + */ + publish( + request?: protos.google.cloud.eventarc.publishing.v1.IPublishRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.eventarc.publishing.v1.IPublishResponse, + protos.google.cloud.eventarc.publishing.v1.IPublishRequest | undefined, + {} | undefined, + ] + >; + publish( + request: protos.google.cloud.eventarc.publishing.v1.IPublishRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.eventarc.publishing.v1.IPublishResponse, + | protos.google.cloud.eventarc.publishing.v1.IPublishRequest + | null + | undefined, + {} | null | undefined + > + ): void; + publish( + request: protos.google.cloud.eventarc.publishing.v1.IPublishRequest, + callback: Callback< + protos.google.cloud.eventarc.publishing.v1.IPublishResponse, + | protos.google.cloud.eventarc.publishing.v1.IPublishRequest + | null + | undefined, + {} | null | undefined + > + ): void; + publish( + request?: protos.google.cloud.eventarc.publishing.v1.IPublishRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.eventarc.publishing.v1.IPublishResponse, + | protos.google.cloud.eventarc.publishing.v1.IPublishRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.eventarc.publishing.v1.IPublishResponse, + | protos.google.cloud.eventarc.publishing.v1.IPublishRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.eventarc.publishing.v1.IPublishResponse, + protos.google.cloud.eventarc.publishing.v1.IPublishRequest | undefined, + {} | undefined, + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + message_bus: request.messageBus ?? '', + }); + this.initialize(); + return this.innerApiCalls.publish(request, options, callback); + } /** * Terminate the gRPC channel and close the client. diff --git a/packages/google-cloud-eventarc-publishing/src/v1/publisher_client_config.json b/packages/google-cloud-eventarc-publishing/src/v1/publisher_client_config.json index 55c6b093fce..d364c8bb2b7 100644 --- a/packages/google-cloud-eventarc-publishing/src/v1/publisher_client_config.json +++ b/packages/google-cloud-eventarc-publishing/src/v1/publisher_client_config.json @@ -28,6 +28,11 @@ "PublishEvents": { "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "Publish": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-eventarc-publishing/src/v1/publisher_proto_list.json b/packages/google-cloud-eventarc-publishing/src/v1/publisher_proto_list.json index d2912b54f3e..d651cd130b2 100644 --- a/packages/google-cloud-eventarc-publishing/src/v1/publisher_proto_list.json +++ b/packages/google-cloud-eventarc-publishing/src/v1/publisher_proto_list.json @@ -1,3 +1,4 @@ [ + "../../protos/google/cloud/eventarc/publishing/v1/cloud_event.proto", "../../protos/google/cloud/eventarc/publishing/v1/publisher.proto" ] diff --git a/packages/google-cloud-eventarc-publishing/test/gapic_publisher_v1.ts b/packages/google-cloud-eventarc-publishing/test/gapic_publisher_v1.ts index 525e32c3db9..afe4367b455 100644 --- a/packages/google-cloud-eventarc-publishing/test/gapic_publisher_v1.ts +++ b/packages/google-cloud-eventarc-publishing/test/gapic_publisher_v1.ts @@ -509,4 +509,131 @@ describe('v1.PublisherClient', () => { await assert.rejects(client.publishEvents(request), expectedError); }); }); + + describe('publish', () => { + it('invokes publish without error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.eventarc.publishing.v1.PublishRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.eventarc.publishing.v1.PublishRequest', + ['messageBus'] + ); + request.messageBus = defaultValue1; + const expectedHeaderRequestParams = `message_bus=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.eventarc.publishing.v1.PublishResponse() + ); + client.innerApiCalls.publish = stubSimpleCall(expectedResponse); + const [response] = await client.publish(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.publish as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.publish as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes publish without error using callback', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.eventarc.publishing.v1.PublishRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.eventarc.publishing.v1.PublishRequest', + ['messageBus'] + ); + request.messageBus = defaultValue1; + const expectedHeaderRequestParams = `message_bus=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.eventarc.publishing.v1.PublishResponse() + ); + client.innerApiCalls.publish = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.publish( + request, + ( + err?: Error | null, + result?: protos.google.cloud.eventarc.publishing.v1.IPublishResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.publish as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.publish as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes publish with error', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.eventarc.publishing.v1.PublishRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.eventarc.publishing.v1.PublishRequest', + ['messageBus'] + ); + request.messageBus = defaultValue1; + const expectedHeaderRequestParams = `message_bus=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.publish = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.publish(request), expectedError); + const actualRequest = (client.innerApiCalls.publish as SinonStub).getCall( + 0 + ).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.publish as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes publish with closed client', async () => { + const client = new publisherModule.v1.PublisherClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.eventarc.publishing.v1.PublishRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.eventarc.publishing.v1.PublishRequest', + ['messageBus'] + ); + request.messageBus = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.publish(request), expectedError); + }); + }); }); diff --git a/packages/google-cloud-securitycentermanagement/README.md b/packages/google-cloud-securitycentermanagement/README.md index 60e13ef2af0..e0eb83c6a6e 100644 --- a/packages/google-cloud-securitycentermanagement/README.md +++ b/packages/google-cloud-securitycentermanagement/README.md @@ -44,7 +44,7 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. 1. [Select or create a Cloud Platform project][projects]. 1. [Enable billing for your project][billing]. 1. [Enable the Security Center Management API API][enable_api]. -1. [Set up authentication with a service account][auth] so you can access the +1. [Set up authentication][auth] so you can access the API from your local workstation. ### Installing the client library @@ -207,4 +207,4 @@ See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) [projects]: https://console.cloud.google.com/project [billing]: https://support.google.com/cloud/answer/6293499#enable-billing [enable_api]: https://console.cloud.google.com/flows/enableapi?apiid=securitycentermanagement.googleapis.com -[auth]: https://cloud.google.com/docs/authentication/getting-started +[auth]: https://cloud.google.com/docs/authentication/external/set-up-adc-local diff --git a/packages/google-cloud-securitycentermanagement/protos/google/cloud/securitycentermanagement/v1/security_center_management.proto b/packages/google-cloud-securitycentermanagement/protos/google/cloud/securitycentermanagement/v1/security_center_management.proto index dca152b5bc4..ff623fef501 100644 --- a/packages/google-cloud-securitycentermanagement/protos/google/cloud/securitycentermanagement/v1/security_center_management.proto +++ b/packages/google-cloud-securitycentermanagement/protos/google/cloud/securitycentermanagement/v1/security_center_management.proto @@ -50,10 +50,11 @@ service SecurityCenterManagement { option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - // Returns a list of all EffectiveSecurityHealthAnalyticsCustomModules for the - // given parent. This includes resident modules defined at the scope of the - // parent, and inherited modules, inherited from CRM ancestors (no - // descendants). + // Returns a list of all + // [EffectiveSecurityHealthAnalyticsCustomModule][google.cloud.securitycentermanagement.v1.EffectiveSecurityHealthAnalyticsCustomModule] + // resources for the given parent. This includes resident modules defined at + // the scope of the parent, and inherited modules, inherited from ancestor + // organizations, folders, and projects (no descendants). rpc ListEffectiveSecurityHealthAnalyticsCustomModules( ListEffectiveSecurityHealthAnalyticsCustomModulesRequest) returns (ListEffectiveSecurityHealthAnalyticsCustomModulesResponse) { @@ -69,7 +70,8 @@ service SecurityCenterManagement { option (google.api.method_signature) = "parent"; } - // Gets details of a single EffectiveSecurityHealthAnalyticsCustomModule. + // Gets details of a single + // [EffectiveSecurityHealthAnalyticsCustomModule][google.cloud.securitycentermanagement.v1.EffectiveSecurityHealthAnalyticsCustomModule]. rpc GetEffectiveSecurityHealthAnalyticsCustomModule( GetEffectiveSecurityHealthAnalyticsCustomModuleRequest) returns (EffectiveSecurityHealthAnalyticsCustomModule) { @@ -85,9 +87,11 @@ service SecurityCenterManagement { option (google.api.method_signature) = "name"; } - // Returns a list of all SecurityHealthAnalyticsCustomModules for the given - // parent. This includes resident modules defined at the scope of the parent, - // and inherited modules, inherited from CRM ancestors (no descendants). + // Returns a list of all + // [SecurityHealthAnalyticsCustomModule][google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule] + // resources for the given parent. This includes resident modules defined at + // the scope of the parent, and inherited modules, inherited from ancestor + // organizations, folders, and projects (no descendants). rpc ListSecurityHealthAnalyticsCustomModules( ListSecurityHealthAnalyticsCustomModulesRequest) returns (ListSecurityHealthAnalyticsCustomModulesResponse) { @@ -103,8 +107,10 @@ service SecurityCenterManagement { option (google.api.method_signature) = "parent"; } - // Returns a list of all resident SecurityHealthAnalyticsCustomModules under - // the given CRM parent and all of the parent's CRM descendants. + // Returns a list of all resident + // [SecurityHealthAnalyticsCustomModule][google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule] + // resources under the given organization, folder, or project and all of its + // descendants. rpc ListDescendantSecurityHealthAnalyticsCustomModules( ListDescendantSecurityHealthAnalyticsCustomModulesRequest) returns (ListDescendantSecurityHealthAnalyticsCustomModulesResponse) { @@ -120,7 +126,8 @@ service SecurityCenterManagement { option (google.api.method_signature) = "parent"; } - // Retrieves a SecurityHealthAnalyticsCustomModule. + // Retrieves a + // [SecurityHealthAnalyticsCustomModule][google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule]. rpc GetSecurityHealthAnalyticsCustomModule( GetSecurityHealthAnalyticsCustomModuleRequest) returns (SecurityHealthAnalyticsCustomModule) { @@ -136,10 +143,12 @@ service SecurityCenterManagement { option (google.api.method_signature) = "name"; } - // Creates a resident SecurityHealthAnalyticsCustomModule at the scope of the - // given CRM parent, and also creates inherited - // SecurityHealthAnalyticsCustomModules for all CRM descendants of the given - // parent. These modules are enabled by default. + // Creates a resident + // [SecurityHealthAnalyticsCustomModule][google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule] + // at the scope of the given organization, folder, or project, and also + // creates inherited `SecurityHealthAnalyticsCustomModule` resources for all + // folders and projects that are descendants of the given parent. These + // modules are enabled by default. rpc CreateSecurityHealthAnalyticsCustomModule( CreateSecurityHealthAnalyticsCustomModuleRequest) returns (SecurityHealthAnalyticsCustomModule) { @@ -159,11 +168,13 @@ service SecurityCenterManagement { "parent,security_health_analytics_custom_module"; } - // Updates the SecurityHealthAnalyticsCustomModule under the given name based - // on the given update mask. Updating the enablement state is supported on - // both resident and inherited modules (though resident modules cannot have an - // enablement state of "inherited"). Updating the display name and custom - // config of a module is supported on resident modules only. + // Updates the + // [SecurityHealthAnalyticsCustomModule][google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule] + // under the given name based on the given update mask. Updating the + // enablement state is supported on both resident and inherited modules + // (though resident modules cannot have an enablement state of "inherited"). + // Updating the display name and custom configuration of a module is supported + // on resident modules only. rpc UpdateSecurityHealthAnalyticsCustomModule( UpdateSecurityHealthAnalyticsCustomModuleRequest) returns (SecurityHealthAnalyticsCustomModule) { @@ -183,9 +194,10 @@ service SecurityCenterManagement { "security_health_analytics_custom_module,update_mask"; } - // Deletes the specified SecurityHealthAnalyticsCustomModule and all of its - // descendants in the CRM hierarchy. This method is only supported for - // resident custom modules. + // Deletes the specified + // [SecurityHealthAnalyticsCustomModule][google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule] + // and all of its descendants in the resource hierarchy. This method is only + // supported for resident custom modules. rpc DeleteSecurityHealthAnalyticsCustomModule( DeleteSecurityHealthAnalyticsCustomModuleRequest) returns (google.protobuf.Empty) { @@ -201,7 +213,9 @@ service SecurityCenterManagement { option (google.api.method_signature) = "name"; } - // Simulates a given SecurityHealthAnalyticsCustomModule and Resource. + // Simulates the result of using a + // [SecurityHealthAnalyticsCustomModule][google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule] + // to check a resource. rpc SimulateSecurityHealthAnalyticsCustomModule( SimulateSecurityHealthAnalyticsCustomModuleRequest) returns (SimulateSecurityHealthAnalyticsCustomModuleResponse) { @@ -238,13 +252,18 @@ service SecurityCenterManagement { option (google.api.method_signature) = "parent"; } - // Gets an effective ETD custom module. Retrieves the effective module at the - // given level. The difference between an EffectiveCustomModule and a - // CustomModule is that the fields for an EffectiveCustomModule are computed - // from ancestors if needed. For example, the enablement_state for a - // CustomModule can be either ENABLED, DISABLED, or INHERITED. Where as the - // enablement_state for an EffectiveCustomModule is always computed to ENABLED - // or DISABLED (the effective enablement_state). + // Gets the effective Event Threat Detection custom module at the given level. + // + // The difference between an + // [EffectiveEventThreatDetectionCustomModule][google.cloud.securitycentermanagement.v1.EffectiveEventThreatDetectionCustomModule] + // and an + // [EventThreatDetectionCustomModule][google.cloud.securitycentermanagement.v1.EventThreatDetectionCustomModule] + // is that the fields for an `EffectiveEventThreatDetectionCustomModule` are + // computed from ancestors if needed. For example, the enablement state for an + // `EventThreatDetectionCustomModule` can be `ENABLED`, `DISABLED`, or + // `INHERITED`. In contrast, the enablement state for an + // `EffectiveEventThreatDetectionCustomModule` is always computed as `ENABLED` + // or `DISABLED`. rpc GetEffectiveEventThreatDetectionCustomModule( GetEffectiveEventThreatDetectionCustomModuleRequest) returns (EffectiveEventThreatDetectionCustomModule) { @@ -260,9 +279,9 @@ service SecurityCenterManagement { option (google.api.method_signature) = "name"; } - // Lists all Event Threat Detection custom modules for the given - // Resource Manager parent. This includes resident modules defined at the - // scope of the parent along with modules inherited from ancestors. + // Lists all Event Threat Detection custom modules for the given organization, + // folder, or project. This includes resident modules defined at the scope of + // the parent along with modules inherited from ancestors. rpc ListEventThreatDetectionCustomModules( ListEventThreatDetectionCustomModulesRequest) returns (ListEventThreatDetectionCustomModulesResponse) { @@ -278,8 +297,8 @@ service SecurityCenterManagement { option (google.api.method_signature) = "parent"; } - // Lists all resident Event Threat Detection custom modules under the - // given Resource Manager parent and its descendants. + // Lists all resident Event Threat Detection custom modules for the given + // organization, folder, or project and its descendants. rpc ListDescendantEventThreatDetectionCustomModules( ListDescendantEventThreatDetectionCustomModulesRequest) returns (ListDescendantEventThreatDetectionCustomModulesResponse) { @@ -312,9 +331,9 @@ service SecurityCenterManagement { } // Creates a resident Event Threat Detection custom module at the scope of the - // given Resource Manager parent, and also creates inherited custom modules - // for all descendants of the given parent. These modules are enabled by - // default. + // given organization, folder, or project, and creates inherited custom + // modules for all descendants of the given parent. These modules are enabled + // by default. rpc CreateEventThreatDetectionCustomModule( CreateEventThreatDetectionCustomModuleRequest) returns (EventThreatDetectionCustomModule) { @@ -360,8 +379,8 @@ service SecurityCenterManagement { } // Deletes the specified Event Threat Detection custom module and all of its - // descendants in the Resource Manager hierarchy. This method is only - // supported for resident custom modules. + // descendants in the resource hierarchy. This method is only supported for + // resident custom modules. rpc DeleteEventThreatDetectionCustomModule( DeleteEventThreatDetectionCustomModuleRequest) returns (google.protobuf.Empty) { @@ -450,7 +469,7 @@ service SecurityCenterManagement { // settings information such as top-level enablement in addition to individual // module settings. Service settings can be configured at the organization, // folder, or project level. Service settings at the organization or folder -// level are inherited by those in child folders and projects. +// level are inherited by those in descendant folders and projects. message SecurityCenterService { option (google.api.resource) = { type: "securitycentermanagement.googleapis.com/SecurityCenterService" @@ -463,29 +482,27 @@ message SecurityCenterService { // The settings for individual modules. message ModuleSettings { - // Optional. The intended state of enablement for the module at its level of + // Optional. The intended enablement state for the module at its level of // the resource hierarchy. EnablementState intended_enablement_state = 1 [(google.api.field_behavior) = OPTIONAL]; // Output only. The effective enablement state for the module at its level - // of the resource hierarchy. If the intended state is set to INHERITED, the - // effective state will be inherited from the enablement state of an - // ancestor. This state may - // differ from the intended enablement state due to billing eligibility or - // onboarding status. + // of the resource hierarchy. If the intended state is set to `INHERITED`, + // the effective state will be inherited from the enablement state of an + // ancestor. This state may differ from the intended enablement state due to + // billing eligibility or onboarding status. EnablementState effective_enablement_state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; } - // Represents the possible intended states of enablement for a service or - // module. + // Represents the possible enablement states for a service or module. enum EnablementState { // Default value. This value is unused. ENABLEMENT_STATE_UNSPECIFIED = 0; - // State is inherited from the parent resource. Not a valid effective - // enablement state. + // State is inherited from the parent resource. Valid as an intended + // enablement state, but not as an effective enablement state. INHERITED = 1; // State is enabled. @@ -494,70 +511,67 @@ message SecurityCenterService { // State is disabled. DISABLED = 3; - // SCC is configured to ingest findings from this service but not enable - // this service. Not a valid intended_enablement_state (that is, this is a - // readonly state). + // Security Command Center is configured to ingest findings from this + // service, but not to enable this service. This state indicates that + // Security Command Center is misconfigured. You can't set this state + // yourself. INGEST_ONLY = 4; } - // Identifier. The name of the service. - // - // Its format is: + // Identifier. The name of the service, in one of the following formats: // - // * organizations/{organization}/locations/{location}/securityCenterServices/{service} - // * folders/{folder}/locations/{location}/securityCenterServices/{service} - // * projects/{project}/locations/{location}/securityCenterServices/{service} + // * `organizations/{organization}/locations/{location}/securityCenterServices/{service}` + // * `folders/{folder}/locations/{location}/securityCenterServices/{service}` + // * `projects/{project}/locations/{location}/securityCenterServices/{service}` // - // The possible values for id {service} are: + // The following values are valid for `{service}`: // - // * container-threat-detection - // * event-threat-detection - // * security-health-analytics - // * vm-threat-detection - // * web-security-scanner + // * `container-threat-detection` + // * `event-threat-detection` + // * `security-health-analytics` + // * `vm-threat-detection` + // * `web-security-scanner` string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - // Optional. The intended state of enablement for the service at its level of - // the resource hierarchy. A DISABLED state will override all module - // enablement_states to DISABLED. + // Optional. The intended enablement state for the service at its level of the + // resource hierarchy. A `DISABLED` state will override all module enablement + // states to `DISABLED`. EnablementState intended_enablement_state = 2 [(google.api.field_behavior) = OPTIONAL]; // Output only. The effective enablement state for the service at its level of - // the resource hierarchy. If the intended state is set to INHERITED, the + // the resource hierarchy. If the intended state is set to `INHERITED`, the // effective state will be inherited from the enablement state of an ancestor. // This state may differ from the intended enablement state due to billing // eligibility or onboarding status. EnablementState effective_enablement_state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Optional. The configurations including the state of enablement for the - // service's different modules. The absence of a module in the map implies its + // Optional. The module configurations, including the enablement state for the + // service's modules. The absence of a module in the map implies that its // configuration is inherited from its parents. map modules = 4 [(google.api.field_behavior) = OPTIONAL]; // Output only. The time the service was last updated. This could be due to an - // explicit user update or due to a side effect of another system change such + // explicit user update or due to a side effect of another system change, such // as billing subscription expiry. google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Optional. Additional service specific configuration. Not all services will + // Optional. Additional service-specific configuration. Not all services will // utilize this field. google.protobuf.Struct service_config = 6 [(google.api.field_behavior) = OPTIONAL]; } -// An EffectiveSecurityHealthAnalyticsCustomModule is the representation of -// a Security Health Analytics custom module at a specified level of the -// resource hierarchy: organization, folder, or project. If a custom module is -// inherited from a parent organization or folder, the value of the -// `enablementState` property in EffectiveSecurityHealthAnalyticsCustomModule is -// set to the value that is effective in the parent, instead of `INHERITED`. -// For example, if the module is enabled in a parent organization or folder, the -// effective enablement_state for the module in all child folders or projects is -// also `enabled`. EffectiveSecurityHealthAnalyticsCustomModule is read-only. +// The representation of a Security Health Analytics custom module at a +// specified level of the resource hierarchy: organization, folder, or project. +// If a custom module is inherited from an ancestor organization or folder, then +// the enablement state is set to the value that is effective in the parent, not +// to `INHERITED`. For example, if the module is enabled in an organization or +// folder, then the effective enablement state for the module is `ENABLED` in +// all descendant folders or projects. message EffectiveSecurityHealthAnalyticsCustomModule { option (google.api.resource) = { type: "securitycentermanagement.googleapis.com/EffectiveSecurityHealthAnalyticsCustomModule" @@ -570,7 +584,7 @@ message EffectiveSecurityHealthAnalyticsCustomModule { // The enablement state of the module. enum EnablementState { - // Unspecified enablement state. + // Default value. This value is unused. ENABLEMENT_STATE_UNSPECIFIED = 0; // The module is enabled at the given level. @@ -580,18 +594,18 @@ message EffectiveSecurityHealthAnalyticsCustomModule { DISABLED = 2; } - // Identifier. The full resource name of the custom module, specified in one - // of the following formats: + // Identifier. The full resource name of the custom module, in one of the + // following formats: // - // * `organizations/organization/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` - // * `folders/folder/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` - // * `projects/project/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` + // * `organizations/organization/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` + // * `folders/folder/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` + // * `projects/project/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` string name = 1 [(google.api.field_behavior) = IDENTIFIER]; // Output only. The user-specified configuration for the module. CustomConfig custom_config = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. The effective state of enablement for the module at the given + // Output only. The effective enablement state for the module at the given // level of the hierarchy. EnablementState enablement_state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -602,15 +616,15 @@ message EffectiveSecurityHealthAnalyticsCustomModule { string display_name = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; } -// Request message for listing effective Security Health Analytics custom -// modules. +// Request message for +// [SecurityCenterManagement.ListEffectiveSecurityHealthAnalyticsCustomModules][google.cloud.securitycentermanagement.v1.SecurityCenterManagement.ListEffectiveSecurityHealthAnalyticsCustomModules]. message ListEffectiveSecurityHealthAnalyticsCustomModulesRequest { - // Required. Name of parent to list effective custom modules. specified in one - // of the following formats: + // Required. Name of parent to list effective custom modules, in one of the + // following formats: + // // * `organizations/{organization}/locations/{location}` // * `folders/{folder}/locations/{location}` - // or - // `projects/{project}/locations/{location}` + // * `projects/{project}/locations/{location}` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -622,29 +636,35 @@ message ListEffectiveSecurityHealthAnalyticsCustomModulesRequest { // Default is 10, minimum is 1, maximum is 1000. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The value returned by the last call indicating a continuation. + // Optional. A pagination token returned from a previous request. Provide this + // token to retrieve the next page of results. + // + // When paginating, the rest of the request must match the request that + // generated the page token. string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; } -// Response message for listing effective Security Health Analytics custom -// modules. +// Response message for +// [SecurityCenterManagement.ListEffectiveSecurityHealthAnalyticsCustomModules][google.cloud.securitycentermanagement.v1.SecurityCenterManagement.ListEffectiveSecurityHealthAnalyticsCustomModules]. message ListEffectiveSecurityHealthAnalyticsCustomModulesResponse { - // The list of EffectiveSecurityHealthAnalyticsCustomModule + // The list of effective Security Health Analytics custom modules. repeated EffectiveSecurityHealthAnalyticsCustomModule effective_security_health_analytics_custom_modules = 1; - // A token identifying a page of results the server should return. + // A pagination token. To retrieve the next page of results, call the method + // again with this token. string next_page_token = 2; } -// Message for getting a EffectiveSecurityHealthAnalyticsCustomModule +// Request message for +// [SecurityCenterManagement.GetEffectiveSecurityHealthAnalyticsCustomModule][google.cloud.securitycentermanagement.v1.SecurityCenterManagement.GetEffectiveSecurityHealthAnalyticsCustomModule]. message GetEffectiveSecurityHealthAnalyticsCustomModuleRequest { // Required. The full resource name of the custom module, specified in one of // the following formats: // - // * `organizations/organization/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` - // * `folders/folder/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` - // * `projects/project/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` + // * `organizations/organization/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` + // * `folders/folder/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` + // * `projects/project/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -657,7 +677,7 @@ message GetEffectiveSecurityHealthAnalyticsCustomModuleRequest { // including its full module name, display name, enablement state, and last // updated time. You can create a custom module at the organization, folder, or // project level. Custom modules that you create at the organization or folder -// level are inherited by the child folders and projects. +// level are inherited by the descendant folders and projects. message SecurityHealthAnalyticsCustomModule { option (google.api.resource) = { type: "securitycentermanagement.googleapis.com/SecurityHealthAnalyticsCustomModule" @@ -670,34 +690,35 @@ message SecurityHealthAnalyticsCustomModule { // Possible enablement states of a custom module. enum EnablementState { - // Unspecified enablement state. + // Default value. This value is unused. ENABLEMENT_STATE_UNSPECIFIED = 0; - // The module is enabled at the given CRM resource. + // The module is enabled at the given organization, folder, or project. ENABLED = 1; - // The module is disabled at the given CRM resource. + // The module is disabled at the given organization, folder, or project. DISABLED = 2; // State is inherited from an ancestor module. The module will either - // be effectively ENABLED or DISABLED based on its closest non-inherited - // ancestor module in the CRM hierarchy. Attempting to set a top level - // module (module with no parent) to the INHERITED state will result in an - // INVALID_ARGUMENT error. + // be effectively `ENABLED` or `DISABLED` based on its closest non-inherited + // ancestor module in the resource hierarchy. If you try to set a top-level + // module (a module with no parent) to the `INHERITED` state, you receive an + // `INVALID_ARGUMENT` error. INHERITED = 3; } - // Identifier. The full resource name of the custom module, specified in one - // of the following formats: - // * `organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}` - // * `folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}` - // * `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}` + // Identifier. The full resource name of the custom module, in one of the + // following formats: + // + // * `organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` + // * `folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` + // * `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` string name = 1 [(google.api.field_behavior) = IDENTIFIER]; // Optional. The display name of the Security Health Analytics custom module. // This display name becomes the finding category for all findings that are - // returned by this custom module. The display name must be between 1 and - // 128 characters, start with a lowercase letter, and contain alphanumeric + // returned by this custom module. The display name must be between 1 and 128 + // characters, start with a lowercase letter, and contain alphanumeric // characters or underscores only. string display_name = 2 [(google.api.field_behavior) = OPTIONAL]; @@ -722,7 +743,7 @@ message SecurityHealthAnalyticsCustomModule { } ]; - // Optional. The user specified custom configuration for the module. + // Optional. The user-specified custom configuration for the module. CustomConfig custom_config = 7 [(google.api.field_behavior) = OPTIONAL]; } @@ -732,8 +753,7 @@ message SecurityHealthAnalyticsCustomModule { message CustomConfig { // A set of optional name-value pairs that define custom source properties to // return with each finding that is generated by the custom module. The custom - // source properties that are defined here are included in the finding JSON - // under `sourceProperties`. + // source properties that are defined here are included in the finding. message CustomOutputSpec { // An individual name-value pair that defines a custom source property. message Property { @@ -759,7 +779,7 @@ message CustomConfig { // Defines the valid value options for the severity of a finding. enum Severity { - // Unspecified severity. + // Default value. This value is unused. SEVERITY_UNSPECIFIED = 0; // Critical severity. @@ -775,8 +795,9 @@ message CustomConfig { LOW = 4; } - // Optional. The CEL expression to evaluate to produce findings. When the - // expression evaluates to true against a resource, a finding is generated. + // Optional. The Common Expression Language (CEL) expression to evaluate to + // produce findings. When the expression evaluates to `true` against a + // resource, a finding is generated. google.type.Expr predicate = 1 [(google.api.field_behavior) = OPTIONAL]; // Optional. Custom output properties. @@ -800,15 +821,15 @@ message CustomConfig { // Optional. An explanation of the recommended steps that security teams can // take to resolve the detected issue. This explanation is returned with each - // finding generated by this module in the `nextSteps` property of the finding - // JSON. + // finding generated by this module. string recommendation = 6 [(google.api.field_behavior) = OPTIONAL]; } -// Request message for listing Security Health Analytics custom modules. +// Request message for +// [SecurityCenterManagement.ListSecurityHealthAnalyticsCustomModules][google.cloud.securitycentermanagement.v1.SecurityCenterManagement.ListSecurityHealthAnalyticsCustomModules]. message ListSecurityHealthAnalyticsCustomModulesRequest { - // Required. Name of parent organization, folder, or project in which to list - // custom modules, specified in one of the following formats: + // Required. Name of the parent organization, folder, or project in which to + // list custom modules, in one of the following formats: // // * `organizations/{organization}/locations/{location}` // * `folders/{folder}/locations/{location}` @@ -824,25 +845,31 @@ message ListSecurityHealthAnalyticsCustomModulesRequest { // Default is 10, minimum is 1, maximum is 1000. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. A token identifying a page of results the server should return. + // Optional. A pagination token returned from a previous request. Provide this + // token to retrieve the next page of results. + // + // When paginating, the rest of the request must match the request that + // generated the page token. string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; } -// Response message for listing Security Health Analytics custom modules. +// Response message for +// [SecurityCenterManagement.ListSecurityHealthAnalyticsCustomModules][google.cloud.securitycentermanagement.v1.SecurityCenterManagement.ListSecurityHealthAnalyticsCustomModules]. message ListSecurityHealthAnalyticsCustomModulesResponse { - // The list of SecurityHealthAnalyticsCustomModules + // The list of Security Health Analytics custom modules. repeated SecurityHealthAnalyticsCustomModule security_health_analytics_custom_modules = 1; - // A token identifying a page of results the server should return. + // A pagination token. To retrieve the next page of results, call the method + // again with this token. string next_page_token = 2; } -// Request message for listing descendant Security Health Analytics custom -// modules. +// Request message for +// [SecurityCenterManagement.ListDescendantSecurityHealthAnalyticsCustomModules][google.cloud.securitycentermanagement.v1.SecurityCenterManagement.ListDescendantSecurityHealthAnalyticsCustomModules]. message ListDescendantSecurityHealthAnalyticsCustomModulesRequest { // Required. Name of the parent organization, folder, or project in which to - // list custom modules, specified in one of the following formats: + // list custom modules, in one of the following formats: // // * `organizations/{organization}/locations/{location}` // * `folders/{folder}/locations/{location}` @@ -858,24 +885,31 @@ message ListDescendantSecurityHealthAnalyticsCustomModulesRequest { // Default is 10, minimum is 1, maximum is 1000. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. A token identifying a page of results the server should return. + // Optional. A pagination token returned from a previous request. Provide this + // token to retrieve the next page of results. + // + // When paginating, the rest of the request must match the request that + // generated the page token. string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; } -// Response message for listing descendant Security Health Analytics custom -// modules. +// Response message for +// [SecurityCenterManagement.ListDescendantSecurityHealthAnalyticsCustomModules][google.cloud.securitycentermanagement.v1.SecurityCenterManagement.ListDescendantSecurityHealthAnalyticsCustomModules]. message ListDescendantSecurityHealthAnalyticsCustomModulesResponse { // The list of SecurityHealthAnalyticsCustomModules repeated SecurityHealthAnalyticsCustomModule security_health_analytics_custom_modules = 1; - // A token identifying a page of results the server should return. + // A pagination token. To retrieve the next page of results, call the method + // again with this token. string next_page_token = 2; } -// Message for getting a SecurityHealthAnalyticsCustomModule +// Request message for +// [SecurityCenterManagement.GetSecurityHealthAnalyticsCustomModule][google.cloud.securitycentermanagement.v1.SecurityCenterManagement.GetSecurityHealthAnalyticsCustomModule]. message GetSecurityHealthAnalyticsCustomModuleRequest { - // Required. Name of the resource + // Required. Name of the resource, in the format + // `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}`. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -884,10 +918,11 @@ message GetSecurityHealthAnalyticsCustomModuleRequest { ]; } -// Message for creating a SecurityHealthAnalyticsCustomModule +// Request message for +// [SecurityCenterManagement.CreateSecurityHealthAnalyticsCustomModule][google.cloud.securitycentermanagement.v1.SecurityCenterManagement.CreateSecurityHealthAnalyticsCustomModule]. message CreateSecurityHealthAnalyticsCustomModuleRequest { // Required. Name of the parent organization, folder, or project of the - // module, specified in one of the following formats: + // module, in one of the following formats: // // * `organizations/{organization}/locations/{location}` // * `folders/{folder}/locations/{location}` @@ -899,53 +934,68 @@ message CreateSecurityHealthAnalyticsCustomModuleRequest { } ]; - // Required. The resource being created + // Required. The resource being created. SecurityHealthAnalyticsCustomModule security_health_analytics_custom_module = 2 [(google.api.field_behavior) = REQUIRED]; - // Optional. When set to true, only validations (including IAM checks) will - // done for the request (no module will be created). An OK response indicates - // the request is valid while an error response indicates the request is - // invalid. Note that a subsequent request to actually create the module could - // still fail because: - // 1. the state could have changed (e.g. IAM permission lost) or - // 2. A failure occurred during creation of the module. - // Defaults to false. + // Optional. When set to `true`, the request will be validated (including IAM + // checks), but no module will be created. An `OK` response indicates that the + // request is valid, while an error response indicates that the request is + // invalid. + // + // If the request is valid, a subsequent request to create the module could + // still fail for one of the following reasons: + // + // * The state of your cloud resources changed; for example, you lost a + // required IAM permission + // * An error occurred during creation of the module + // + // Defaults to `false`. bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; } -// Message for updating a SecurityHealthAnalyticsCustomModule +// Request message for +// [SecurityCenterManagement.UpdateSecurityHealthAnalyticsCustomModule][google.cloud.securitycentermanagement.v1.SecurityCenterManagement.UpdateSecurityHealthAnalyticsCustomModule]. message UpdateSecurityHealthAnalyticsCustomModuleRequest { - // Required. The list of fields to be updated. The only fields that can be - // updated are `enablement_state` and `custom_config`. If empty or set to the - // wildcard value `*`, both `enablement_state` and `custom_config` are - // updated. + // Required. The fields to update. The following values are valid: + // + // * `custom_config` + // * `enablement_state` + // + // If you omit this field or set it to the wildcard value `*`, then all + // eligible fields are updated. google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; - // Required. The resource being updated + // Required. The resource being updated. SecurityHealthAnalyticsCustomModule security_health_analytics_custom_module = 2 [(google.api.field_behavior) = REQUIRED]; - // Optional. When set to true, only validations (including IAM checks) will - // done for the request (module will not be updated). An OK response indicates - // the request is valid while an error response indicates the request is - // invalid. Note that a subsequent request to actually update the module could - // still fail because 1. the state could have changed (e.g. IAM permission - // lost) or - // 2. A failure occurred while trying to update the module. + // Optional. When set to `true`, the request will be validated (including IAM + // checks), but no module will be updated. An `OK` response indicates that the + // request is valid, while an error response indicates that the request is + // invalid. + // + // If the request is valid, a subsequent request to update the module could + // still fail for one of the following reasons: + // + // * The state of your cloud resources changed; for example, you lost a + // required IAM permission + // * An error occurred during creation of the module + // + // Defaults to `false`. bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; } -// Message for deleting a SecurityHealthAnalyticsCustomModule +// Request message for +// [SecurityCenterManagement.DeleteSecurityHealthAnalyticsCustomModule][google.cloud.securitycentermanagement.v1.SecurityCenterManagement.DeleteSecurityHealthAnalyticsCustomModule]. message DeleteSecurityHealthAnalyticsCustomModuleRequest { - // Required. The resource name of the SHA custom module. - // - // Its format is: + // Required. The resource name of the SHA custom module, in one of the + // following formats: // - // * `organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}`. - // * `folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}`. - // * `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}`. + // * `organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` + // * `folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` + // * `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -953,42 +1003,52 @@ message DeleteSecurityHealthAnalyticsCustomModuleRequest { } ]; - // Optional. When set to true, only validations (including IAM checks) will - // done for the request (module will not be deleted). An OK response indicates - // the request is valid while an error response indicates the request is - // invalid. Note that a subsequent request to actually delete the module could - // still fail because 1. the state could have changed (e.g. IAM permission - // lost) or - // 2. A failure occurred while trying to delete the module. + // Optional. When set to `true`, the request will be validated (including IAM + // checks), but no module will be deleted. An `OK` response indicates that the + // request is valid, while an error response indicates that the request is + // invalid. + // + // If the request is valid, a subsequent request to delete the module could + // still fail for one of the following reasons: + // + // * The state of your cloud resources changed; for example, you lost a + // required IAM permission + // * An error occurred during deletion of the module + // + // Defaults to `false`. bool validate_only = 2 [(google.api.field_behavior) = OPTIONAL]; } -// Request message to simulate a CustomConfig against a given test resource. -// Maximum size of the request is 4 MB by default. +// Request message for +// [SecurityCenterManagement.SimulateSecurityHealthAnalyticsCustomModule][google.cloud.securitycentermanagement.v1.SecurityCenterManagement.SimulateSecurityHealthAnalyticsCustomModule]. +// The maximum size of the request is 4 MiB. message SimulateSecurityHealthAnalyticsCustomModuleRequest { - // Manually constructed resource name. If the custom module evaluates against - // only the resource data, you can omit the `iam_policy_data` field. If it - // evaluates only the `iam_policy_data` field, you can omit the resource data. + // Manually constructed information about a resource. message SimulatedResource { - // Required. The type of the resource, for example, + // Required. The type of the resource. For example, // `compute.googleapis.com/Disk`. string resource_type = 1 [(google.api.field_behavior) = REQUIRED]; // Optional. A representation of the Google Cloud resource. Should match the // Google Cloud resource JSON format. + // + // If the custom module evaluates only the IAM allow policy, then you can + // omit this field. google.protobuf.Struct resource_data = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. A representation of the IAM policy. + // Optional. A representation of the IAM allow policy. + // + // If the custom module evaluates only the resource data, then you can omit + // this field. google.iam.v1.Policy iam_policy_data = 3 [(google.api.field_behavior) = OPTIONAL]; } // Required. The relative resource name of the organization, project, or - // folder. For more information about relative resource names, see [Relative - // Resource - // Name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) - // Example: `organizations/{organization_id}`. + // folder. For more information about relative resource names, see [AIP-122: + // Resource names](https://google.aip.dev/122). Example: + // `organizations/{organization_id}`. string parent = 1 [(google.api.field_behavior) = REQUIRED]; // Required. The custom configuration that you need to test. @@ -998,8 +1058,8 @@ message SimulateSecurityHealthAnalyticsCustomModuleRequest { SimulatedResource resource = 3 [(google.api.field_behavior) = REQUIRED]; } -// A subset of the fields of the Security Center Finding proto. The minimum set -// of fields needed to represent a simulated finding from a SHA custom module. +// The minimum set of fields needed to represent a simulated finding from a +// Security Health Analytics custom module. message SimulatedFinding { option (google.api.resource) = { type: "securitycenter.googleapis.com/Finding" @@ -1012,97 +1072,92 @@ message SimulatedFinding { // The state of the finding. enum State { - // Unspecified state. + // Default value. This value is unused. STATE_UNSPECIFIED = 0; // The finding requires attention and has not been addressed yet. ACTIVE = 1; - // The finding has been fixed, triaged as a non-issue or otherwise addressed - // and is no longer active. + // The finding has been fixed, triaged as a non-issue, or otherwise + // addressed and is no longer active. INACTIVE = 2; } // The severity of the finding. enum Severity { - // This value is used for findings when a source doesn't write a severity - // value. + // Default value. This value is unused. SEVERITY_UNSPECIFIED = 0; - // Vulnerability: - // A critical vulnerability is easily discoverable by an external actor, - // exploitable, and results in the direct ability to execute arbitrary code, - // exfiltrate data, and otherwise gain additional access and privileges to - // cloud resources and workloads. Examples include publicly accessible - // unprotected user data and public SSH access with weak or no - // passwords. + // For vulnerabilities: A critical vulnerability is easily discoverable by + // an external actor, exploitable, and results in the direct ability to + // execute arbitrary code, exfiltrate data, and otherwise gain additional + // access and privileges to cloud resources and workloads. Examples include + // publicly accessible unprotected user data and public SSH access with weak + // or no passwords. // - // Threat: - // Indicates a threat that is able to access, modify, or delete data or - // execute unauthorized code within existing resources. + // For threats: Indicates a threat that is able to access, modify, or delete + // data or execute unauthorized code within existing resources. CRITICAL = 1; - // Vulnerability: - // A high risk vulnerability can be easily discovered and exploited in - // combination with other vulnerabilities in order to gain direct access and - // the ability to execute arbitrary code, exfiltrate data, and otherwise - // gain additional access and privileges to cloud resources and workloads. - // An example is a database with weak or no passwords that is only - // accessible internally. This database could easily be compromised by an - // actor that had access to the internal network. + // For vulnerabilities: A high-risk vulnerability can be easily discovered + // and exploited in combination with other vulnerabilities in order to gain + // direct access and the ability to execute arbitrary code, exfiltrate data, + // and otherwise gain additional access and privileges to cloud resources + // and workloads. An example is a database with weak or no passwords that is + // only accessible internally. This database could easily be compromised by + // an actor that had access to the internal network. // - // Threat: - // Indicates a threat that is able to create new computational resources in - // an environment but not able to access data or execute code in existing - // resources. + // For threats: Indicates a threat that is able to create new computational + // resources in an environment but not able to access data or execute code + // in existing resources. HIGH = 2; - // Vulnerability: - // A medium risk vulnerability could be used by an actor to gain access to - // resources or privileges that enable them to eventually (through multiple - // steps or a complex exploit) gain access and the ability to execute - // arbitrary code or exfiltrate data. An example is a service account with - // access to more projects than it should have. If an actor gains access to - // the service account, they could potentially use that access to manipulate - // a project the service account was not intended to. + // For vulnerabilities: A medium-risk vulnerability could be used by an + // actor to gain access to resources or privileges that enable them to + // eventually (through multiple steps or a complex exploit) gain access and + // the ability to execute arbitrary code or exfiltrate data. An example is a + // service account with access to more projects than it should have. If an + // actor gains access to the service account, they could potentially use + // that access to manipulate a project the service account was not intended + // to. // - // Threat: - // Indicates a threat that is able to cause operational impact but may not - // access data or execute unauthorized code. + // For threats: Indicates a threat that is able to cause operational impact + // but may not access data or execute unauthorized code. MEDIUM = 3; - // Vulnerability: - // A low risk vulnerability hampers a security organization's ability to - // detect vulnerabilities or active threats in their deployment, or prevents - // the root cause investigation of security issues. An example is monitoring - // and logs being disabled for resource configurations and access. + // For vulnerabilities: A low-risk vulnerability hampers a security + // organization's ability to detect vulnerabilities or active threats in + // their deployment, or prevents the root cause investigation of security + // issues. An example is monitoring and logs being disabled for resource + // configurations and access. // - // Threat: - // Indicates a threat that has obtained minimal access to an environment but - // is not able to access data, execute code, or create resources. + // For threats: Indicates a threat that has obtained minimal access to an + // environment but is not able to access data, execute code, or create + // resources. LOW = 4; } - // Represents what kind of Finding it is. + // Represents what kind of finding it is. enum FindingClass { - // Unspecified finding class. + // Default value. This value is unused. FINDING_CLASS_UNSPECIFIED = 0; // Describes unwanted or malicious activity. THREAT = 1; // Describes a potential weakness in software that increases risk to - // Confidentiality & Integrity & Availability. + // confidentiality, integrity, and availability. VULNERABILITY = 2; - // Describes a potential weakness in cloud resource/asset configuration that - // increases risk. + // Describes a potential weakness in cloud resource or asset configuration + // that increases risk. MISCONFIGURATION = 3; // Describes a security observation that is for informational purposes. OBSERVATION = 4; - // Describes an error that prevents some SCC functionality. + // Describes an error that prevents Security Command Center from working + // correctly. SCC_ERROR = 5; // Describes a potential security risk due to a change in the security @@ -1114,50 +1169,51 @@ message SimulatedFinding { TOXIC_COMBINATION = 7; } - // Identifier. The [relative resource - // name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) - // of the finding. Example: - // `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}`, - // `folders/{folder_id}/sources/{source_id}/findings/{finding_id}`, - // `projects/{project_id}/sources/{source_id}/findings/{finding_id}`. + // Identifier. The [relative resource name](https://google.aip.dev/122) of the + // finding, in one of the following formats: + // + // * `organizations/{organization_id}/sources/{source_id}/findings/{finding_id}` + // * `folders/{folder_id}/sources/{source_id}/findings/{finding_id}` + // * `projects/{project_id}/sources/{source_id}/findings/{finding_id}` string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - // The relative resource name of the source the finding belongs to. See: - // https://cloud.google.com/apis/design/resource_names#relative_resource_name - // This field is immutable after creation time. - // For example: - // `organizations/{organization_id}/sources/{source_id}` + // The [relative resource name](https://google.aip.dev/122) of the source the + // finding belongs to. For example, + // `organizations/{organization_id}/sources/{source_id}`. This field is + // immutable after creation time. string parent = 2; - // For findings on Google Cloud resources, the full resource - // name of the Google Cloud resource this finding is for. See: - // https://cloud.google.com/apis/design/resource_names#full_resource_name - // When the finding is for a non-Google Cloud resource, the resourceName can - // be a customer or partner defined string. This field is immutable after - // creation time. + // For findings on Google Cloud resources, the + // [full resource name](https://google.aip.dev/122#full-resource-names) of the + // Google Cloud resource this finding is for. When the finding is for a + // non-Google Cloud resource, the value can be a customer or partner defined + // string. This field is immutable after creation time. string resource_name = 3; - // The additional taxonomy group within findings from a given source. - // This field is immutable after creation time. - // Example: "XSS_FLASH_INJECTION" + // The additional taxonomy group within findings from a given source. For + // example, `XSS_FLASH_INJECTION`. This field is immutable after creation + // time. string category = 4; // Output only. The state of the finding. State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Source specific properties. These properties are managed by the source - // that writes the finding. The key names in the source_properties map must be - // between 1 and 255 characters, and must start with a letter and contain - // alphanumeric characters or underscores only. + // Source-specific properties. These properties are managed by the source + // that writes the finding. The key names must be between 1 and 255 + // characters; they must start with a letter and contain alphanumeric + // characters or underscores only. map source_properties = 6; // The time the finding was first detected. If an existing finding is updated, - // then this is the time the update occurred. + // then this is the time the update occurred. If the finding is later + // resolved, then this time reflects when the finding was resolved. + // // For example, if the finding represents an open firewall, this property // captures the time the detector believes the firewall became open. The - // accuracy is determined by the detector. If the finding is later resolved, - // then this time reflects when the finding was resolved. This must not - // be set to a value greater than the current timestamp. + // accuracy is determined by the detector. + // + // The event time must not be set to a value greater than the current + // timestamp. google.protobuf.Timestamp event_time = 7; // The severity of the finding. This field is managed by the source that @@ -1168,14 +1224,15 @@ message SimulatedFinding { FindingClass finding_class = 9; } -// Response message for simulating a `SecurityHealthAnalyticsCustomModule` -// against a given resource. +// Response message for +// [SecurityCenterManagement.SimulateSecurityHealthAnalyticsCustomModule][google.cloud.securitycentermanagement.v1.SecurityCenterManagement.SimulateSecurityHealthAnalyticsCustomModule]. message SimulateSecurityHealthAnalyticsCustomModuleResponse { // Possible test result. message SimulatedResult { + // The result of the simulation. oneof result { - // Finding that would be published for the test case, - // if a violation is detected. + // Finding that would be published for the test case if a violation is + // detected. SimulatedFinding finding = 1; // Indicates that the test case does not trigger any violation. @@ -1190,13 +1247,13 @@ message SimulateSecurityHealthAnalyticsCustomModuleResponse { SimulatedResult result = 1; } -// An EffectiveEventThreatDetectionCustomModule is the representation of -// EventThreatDetectionCustomModule at a given level taking hierarchy into -// account and resolving various fields accordingly. e.g. if the module is -// enabled at the ancestor level, effective modules at all descendant levels -// will have enablement_state set to ENABLED. Similarly, if module.inherited is -// set, then effective module's config will contain the ancestor's config -// details. EffectiveEventThreatDetectionCustomModule is read-only. +// The representation of an +// [EventThreatDetectionCustomModule][google.cloud.securitycentermanagement.v1.EventThreatDetectionCustomModule] +// at a given level, taking hierarchy into account and resolving various fields +// accordingly. For example, if the module is enabled at the ancestor level, +// then effective modules at all descendant levels will have their enablement +// state set to `ENABLED`. Similarly, if `module.inherited` is set, then the +// effective module's configuration will reflect the ancestor's configuration. message EffectiveEventThreatDetectionCustomModule { option (google.api.resource) = { type: "securitycentermanagement.googleapis.com/EffectiveEventThreatDetectionCustomModule" @@ -1209,7 +1266,7 @@ message EffectiveEventThreatDetectionCustomModule { // The enablement state of the module. enum EnablementState { - // Unspecified enablement state. + // Default value. This value is unused. ENABLEMENT_STATE_UNSPECIFIED = 0; // The module is enabled at the given level. @@ -1219,16 +1276,15 @@ message EffectiveEventThreatDetectionCustomModule { DISABLED = 2; } - // Identifier. The resource name of the ETD custom module. - // - // Its format is: + // Identifier. The resource name of the Event Threat Detection custom module, + // in one of the following formats: // - // * `organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. - // * `folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. - // * `projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. + // * `organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` + // * `folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` + // * `projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - // Output only. Config for the effective module. + // Output only. Configuration for the effective module. google.protobuf.Struct config = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The effective state of enablement for the module at the given @@ -1236,24 +1292,25 @@ message EffectiveEventThreatDetectionCustomModule { EnablementState enablement_state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. Type for the module. e.g. CONFIGURABLE_BAD_IP. + // Output only. Type for the module (for example, `CONFIGURABLE_BAD_IP`). string type = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. The human readable name to be displayed for the module. + // Output only. The human-readable name of the module. string display_name = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. The description for the module. + // Output only. A description of the module. string description = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; } -// Request message for listing effective Event Threat Detection custom -// modules. +// Request message for +// [SecurityCenterManagement.ListEffectiveEventThreatDetectionCustomModules][google.cloud.securitycentermanagement.v1.SecurityCenterManagement.ListEffectiveEventThreatDetectionCustomModules]. message ListEffectiveEventThreatDetectionCustomModulesRequest { - // Required. Name of parent to list effective custom modules. Its format is - // `organizations/{organization}/locations/{location}`, - // `folders/{folder}/locations/{location}`, - // or - // `projects/{project}/locations/{location}` + // Required. Name of parent to list effective custom modules, in one of the + // following formats: + // + // * `organizations/{organization}/locations/{location}` + // * `folders/{folder}/locations/{location}` + // * `projects/{project}/locations/{location}` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1265,30 +1322,35 @@ message ListEffectiveEventThreatDetectionCustomModulesRequest { // Default is 10, minimum is 1, maximum is 1000. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The value returned by the last call indicating a continuation + // Optional. A pagination token returned from a previous request. Provide this + // token to retrieve the next page of results. + // + // When paginating, the rest of the request must match the request that + // generated the page token. string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; } -// Response message for listing effective Event Threat Detection custom -// modules. +// Response message for +// [SecurityCenterManagement.ListEffectiveEventThreatDetectionCustomModules][google.cloud.securitycentermanagement.v1.SecurityCenterManagement.ListEffectiveEventThreatDetectionCustomModules]. message ListEffectiveEventThreatDetectionCustomModulesResponse { - // The list of EffectiveEventThreatDetectionCustomModules + // The list of effective Event Threat Detection custom modules. repeated EffectiveEventThreatDetectionCustomModule effective_event_threat_detection_custom_modules = 1; - // A token identifying a page of results the server should return. + // A pagination token. To retrieve the next page of results, call the method + // again with this token. string next_page_token = 2; } -// Message for getting a EffectiveEventThreatDetectionCustomModule +// Request message for +// [SecurityCenterManagement.GetEffectiveEventThreatDetectionCustomModule][google.cloud.securitycentermanagement.v1.SecurityCenterManagement.GetEffectiveEventThreatDetectionCustomModule]. message GetEffectiveEventThreatDetectionCustomModuleRequest { - // Required. The resource name of the ETD custom module. - // - // Its format is: + // Required. The resource name of the Event Threat Detection custom module, in + // one of the following formats: // - // * `organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. - // * `folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. - // * `projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. + // * `organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` + // * `folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` + // * `projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1297,9 +1359,9 @@ message GetEffectiveEventThreatDetectionCustomModuleRequest { ]; } -// An event threat detection custom module is a Cloud SCC resource that contains -// the configuration and enablement state of a custom module, which enables ETD -// to write certain findings to Cloud SCC. +// A Security Command Center resource that contains the configuration and +// enablement state of a custom module, which enables Event Threat Detection to +// write certain findings to Security Command Center. message EventThreatDetectionCustomModule { option (google.api.resource) = { type: "securitycentermanagement.googleapis.com/EventThreatDetectionCustomModule" @@ -1321,32 +1383,31 @@ message EventThreatDetectionCustomModule { // The module is disabled at the given level. DISABLED = 2; - // State is inherited from an ancestor module. The module will either - // be effectively ENABLED or DISABLED based on its closest non-inherited - // ancestor module in the CRM hierarchy. Attempting to set a top level - // module (module with no parent) to the INHERITED state will result in an - // error. + // State is inherited from an ancestor module. The module will either be + // effectively `ENABLED` or `DISABLED` based on its closest non-inherited + // ancestor module in the CRM hierarchy. If you try to set a top-level + // module (a module with no parent) to the `INHERITED` state, you receive an + // `INVALID_ARGUMENT` error. INHERITED = 3; } - // Identifier. The resource name of the ETD custom module. + // Identifier. The resource name of the Event Threat Detection custom module, + // in one of the following formats: // - // Its format is: - // - // * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. - // * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. - // * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. + // * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` + // * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` + // * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - // Optional. Config for the module. For the resident module, its config value - // is defined at this level. For the inherited module, its config value is - // inherited from the ancestor module. + // Optional. Configuration for the module. For the resident module, its + // configuration value is defined at this level. For the inherited module, its + // configuration value is inherited from the ancestor module. google.protobuf.Struct config = 2 [(google.api.field_behavior) = OPTIONAL]; // Output only. The closest ancestor module that this module inherits the // enablement state from. If empty, indicates that the custom module was // created in the requesting parent organization, folder, or project. The - // format is the same as the EventThreatDetectionCustomModule resource name. + // format is the same as the custom module's resource name. string ancestor_module = 3 [ (google.api.field_behavior) = OUTPUT_ONLY, (google.api.resource_reference) = { @@ -1358,13 +1419,13 @@ message EventThreatDetectionCustomModule { // hierarchy. EnablementState enablement_state = 4 [(google.api.field_behavior) = OPTIONAL]; - // Optional. Type for the module. e.g. CONFIGURABLE_BAD_IP. + // Optional. Type for the module. For example, `CONFIGURABLE_BAD_IP`. string type = 5 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The human readable name to be displayed for the module. + // Optional. The human-readable name of the module. string display_name = 6 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The description for the module. + // Optional. A description of the module. string description = 7 [(google.api.field_behavior) = OPTIONAL]; // Output only. The time the module was last updated. @@ -1375,13 +1436,15 @@ message EventThreatDetectionCustomModule { string last_editor = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; } -// Request message for listing Event Threat Detection custom modules. +// Request message for +// [SecurityCenterManagement.ListEventThreatDetectionCustomModules][google.cloud.securitycentermanagement.v1.SecurityCenterManagement.ListEventThreatDetectionCustomModules]. message ListEventThreatDetectionCustomModulesRequest { - // Required. Name of parent to list custom modules. Its format is - // `organizations/{organization}/locations/{location}`, - // `folders/{folder}/locations/{location}`, - // or - // `projects/{project}/locations/{location}` + // Required. Name of parent to list custom modules, in one of the following + // formats: + // + // * `organizations/{organization}/locations/{location}` + // * `folders/{folder}/locations/{location}` + // * `projects/{project}/locations/{location}` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1390,38 +1453,39 @@ message ListEventThreatDetectionCustomModulesRequest { ]; // Optional. The maximum number of modules to return. The service may return - // fewer than this value. If unspecified, at most 10 configs will be returned. + // fewer than this value. If unspecified, at most 10 modules will be returned. // The maximum value is 1000; values above 1000 will be coerced to 1000. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. A page token, received from a previous - // `ListEventThreatDetectionCustomModules` call. Provide this to retrieve the - // subsequent page. + // Optional. A pagination token returned from a previous request. Provide this + // token to retrieve the next page of results. // - // When paginating, all other parameters provided to - // `ListEventThreatDetectionCustomModules` must match the call that provided - // the page token. + // When paginating, the rest of the request must match the request that + // generated the page token. string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; } -// Response message for listing Event Threat Detection custom modules. +// Response message for +// [SecurityCenterManagement.ListEventThreatDetectionCustomModules][google.cloud.securitycentermanagement.v1.SecurityCenterManagement.ListEventThreatDetectionCustomModules]. message ListEventThreatDetectionCustomModulesResponse { - // The list of EventThreatDetectionCustomModules + // The list of custom modules. repeated EventThreatDetectionCustomModule event_threat_detection_custom_modules = 1; - // A token identifying a page of results the server should return. + // A pagination token. To retrieve the next page of results, call the method + // again with this token. string next_page_token = 2; } -// Request message for listing descendant Event Threat Detection custom -// modules. +// Request message for +// [SecurityCenterManagement.ListDescendantEventThreatDetectionCustomModules][google.cloud.securitycentermanagement.v1.SecurityCenterManagement.ListDescendantEventThreatDetectionCustomModules]. message ListDescendantEventThreatDetectionCustomModulesRequest { - // Required. Name of parent to list custom modules. Its format is - // `organizations/{organization}/locations/{location}`, - // `folders/{folder}/locations/{location}`, - // or - // `projects/{project}/locations/{location}` + // Required. Name of parent to list custom modules, in one of the following + // formats: + // + // * `organizations/{organization}/locations/{location}` + // * `folders/{folder}/locations/{location}` + // * `projects/{project}/locations/{location}` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1434,30 +1498,35 @@ message ListDescendantEventThreatDetectionCustomModulesRequest { // The maximum value is 1000; values above 1000 will be coerced to 1000. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. A token identifying a page of results the server should return. + // Optional. A pagination token returned from a previous request. Provide this + // token to retrieve the next page of results. + // + // When paginating, the rest of the request must match the request that + // generated the page token. string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; } -// Response message for listing descendant Event Threat Detection custom -// modules. +// Response message for +// [SecurityCenterManagement.ListDescendantEventThreatDetectionCustomModules][google.cloud.securitycentermanagement.v1.SecurityCenterManagement.ListDescendantEventThreatDetectionCustomModules]. message ListDescendantEventThreatDetectionCustomModulesResponse { - // The list of EventThreatDetectionCustomModules + // The list of custom modules. repeated EventThreatDetectionCustomModule event_threat_detection_custom_modules = 1; - // A token identifying a page of results the server should return. + // A pagination token. To retrieve the next page of results, call the method + // again with this token. string next_page_token = 2; } -// Message for getting a EventThreatDetectionCustomModule +// Request message for +// [SecurityCenterManagement.GetEventThreatDetectionCustomModule][google.cloud.securitycentermanagement.v1.SecurityCenterManagement.GetEventThreatDetectionCustomModule]. message GetEventThreatDetectionCustomModuleRequest { - // Required. The resource name of the ETD custom module. - // - // Its format is: + // Required. The resource name of the Event Threat Detection custom module, in + // one of the following formats: // - // * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. - // * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. - // * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. + // * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` + // * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` + // * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1466,13 +1535,14 @@ message GetEventThreatDetectionCustomModuleRequest { ]; } -// Message for creating a EventThreatDetectionCustomModule +// Request message for +// [SecurityCenterManagement.CreateEventThreatDetectionCustomModule][google.cloud.securitycentermanagement.v1.SecurityCenterManagement.CreateEventThreatDetectionCustomModule]. message CreateEventThreatDetectionCustomModuleRequest { - // Required. Name of parent for the module. Its format is - // `organizations/{organization}/locations/{location}`, - // `folders/{folder}/locations/{location}`, - // or - // `projects/{project}/locations/{location}` + // Required. Name of parent for the module, in one of the following formats: + // + // * `organizations/{organization}/locations/{location}` + // * `folders/{folder}/locations/{location}` + // * `projects/{project}/locations/{location}` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1481,54 +1551,62 @@ message CreateEventThreatDetectionCustomModuleRequest { ]; // Required. The module to create. The - // event_threat_detection_custom_module.name will be ignored and server - // generated. + // [EventThreatDetectionCustomModule.name][google.cloud.securitycentermanagement.v1.EventThreatDetectionCustomModule.name] + // field is ignored; Security Command Center generates the name. EventThreatDetectionCustomModule event_threat_detection_custom_module = 3 [(google.api.field_behavior) = REQUIRED]; - // Optional. When set to true, only validations (including IAM checks) will - // done for the request (no module will be created). An OK response indicates - // the request is valid while an error response indicates the request is - // invalid. Note that a subsequent request to actually create the module could - // still fail because 1. the state could have changed (e.g. IAM permission - // lost) or - // 2. A failure occurred during creation of the module. + // Optional. When set to `true`, the request will be validated (including IAM + // checks), but no module will be created. An `OK` response indicates that the + // request is valid, while an error response indicates that the request is + // invalid. + // + // If the request is valid, a subsequent request to create the module could + // still fail for one of the following reasons: + // + // * The state of your cloud resources changed; for example, you lost a + // required IAM permission + // * An error occurred during creation of the module + // + // Defaults to `false`. bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; } // Message for updating a EventThreatDetectionCustomModule message UpdateEventThreatDetectionCustomModuleRequest { - // Required. Field mask is used to specify the fields to be overwritten in the - // EventThreatDetectionCustomModule resource by the update. - // The fields specified in the update_mask are relative to the resource, not - // the full request. A field will be overwritten if it is in the mask. If the - // user does not provide a mask then all fields will be overwritten. + // Required. The fields to update. If omitted, then all fields are updated. google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; - // Required. The module being updated + // Required. The module being updated. EventThreatDetectionCustomModule event_threat_detection_custom_module = 2 [(google.api.field_behavior) = REQUIRED]; - // Optional. When set to true, only validations (including IAM checks) will - // done for the request (module will not be updated). An OK response indicates - // the request is valid while an error response indicates the request is - // invalid. Note that a subsequent request to actually update the module could - // still fail because 1. the state could have changed (e.g. IAM permission - // lost) or - // 2. A failure occurred while trying to update the module. + // Optional. When set to `true`, the request will be validated (including IAM + // checks), but no module will be updated. An `OK` response indicates that the + // request is valid, while an error response indicates that the request is + // invalid. + // + // If the request is valid, a subsequent request to update the module could + // still fail for one of the following reasons: + // + // * The state of your cloud resources changed; for example, you lost a + // required IAM permission + // * An error occurred during creation of the module + // + // Defaults to `false`. bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; } -// Message for deleting a EventThreatDetectionCustomModule +// Request message for +// [SecurityCenterManagement.DeleteEventThreatDetectionCustomModule][google.cloud.securitycentermanagement.v1.SecurityCenterManagement.DeleteEventThreatDetectionCustomModule]. message DeleteEventThreatDetectionCustomModuleRequest { - // Required. The resource name of the ETD custom module. - // - // Its format is: + // Required. The resource name of the Event Threat Detection custom module, in + // one of the following formats: // - // * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. - // * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. - // * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. + // * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` + // * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` + // * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1536,23 +1614,29 @@ message DeleteEventThreatDetectionCustomModuleRequest { } ]; - // Optional. When set to true, only validations (including IAM checks) will - // done for the request (module will not be deleted). An OK response indicates - // the request is valid while an error response indicates the request is - // invalid. Note that a subsequent request to actually delete the module could - // still fail because 1. the state could have changed (e.g. IAM permission - // lost) or - // 2. A failure occurred while trying to delete the module. + // Optional. When set to `true`, the request will be validated (including IAM + // checks), but no module will be deleted. An `OK` response indicates that the + // request is valid, while an error response indicates that the request is + // invalid. + // + // If the request is valid, a subsequent request to delete the module could + // still fail for one of the following reasons: + // + // * The state of your cloud resources changed; for example, you lost a + // required IAM permission + // * An error occurred during creation of the module + // + // Defaults to `false`. bool validate_only = 2 [(google.api.field_behavior) = OPTIONAL]; } -// Request to validate an Event Threat Detection custom module. +// Request message for +// [SecurityCenterManagement.ValidateEventThreatDetectionCustomModule][google.cloud.securitycentermanagement.v1.SecurityCenterManagement.ValidateEventThreatDetectionCustomModule]. message ValidateEventThreatDetectionCustomModuleRequest { - // Required. Resource name of the parent to validate the Custom Module under. - // - // Its format is: + // Required. Resource name of the parent to validate the custom modules under, + // in one of the following formats: // - // * `organizations/{organization}/locations/{location}`. + // * `organizations/{organization}/locations/{location}` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1564,39 +1648,41 @@ message ValidateEventThreatDetectionCustomModuleRequest { // messages. string raw_text = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. The type of the module (e.g. CONFIGURABLE_BAD_IP). + // Required. The type of the module. For example, `CONFIGURABLE_BAD_IP`. string type = 3 [(google.api.field_behavior) = REQUIRED]; } -// Response to validating an Event Threat Detection custom module. +// Response message for +// [SecurityCenterManagement.ValidateEventThreatDetectionCustomModule][google.cloud.securitycentermanagement.v1.SecurityCenterManagement.ValidateEventThreatDetectionCustomModule]. message ValidateEventThreatDetectionCustomModuleResponse { // An error encountered while validating the uploaded configuration of an - // Event Threat Detection Custom Module. + // Event Threat Detection custom module. message CustomModuleValidationError { - // A description of the error, suitable for human consumption. Required. + // A human-readable description of the error. string description = 1; - // The path, in RFC 8901 JSON Pointer format, to the field that failed - // validation. This may be left empty if no specific field is affected. + // The path, in [RFC 6901: JSON + // Pointer](https://datatracker.ietf.org/doc/html/rfc6901) format, to the + // field that failed validation. Omitted if no specific field is affected. string field_path = 2; // The initial position of the error in the uploaded text version of the - // module. This field may be omitted if no specific position applies, or if - // one could not be computed. + // module. Omitted if no specific position applies, or if the position could + // not be computed. optional Position start = 3; - // The end position of the error in the uploaded text version of the - // module. This field may be omitted if no specific position applies, or if - // one could not be computed.. + // The end position of the error in the uploaded text version of the module. + // Omitted if no specific position applies, or if the position could not be + // computed. optional Position end = 4; } // A position in the uploaded text version of a module. message Position { - // The line position in the text + // The line position in the text. int32 line_number = 1; - // The column position in the line + // The column position in the line. int32 column_number = 2; } @@ -1605,23 +1691,23 @@ message ValidateEventThreatDetectionCustomModuleResponse { repeated CustomModuleValidationError errors = 2; } -// Request message for getting a Security Command Center service. +// Request message for +// [SecurityCenterManagement.GetSecurityCenterService][google.cloud.securitycentermanagement.v1.SecurityCenterManagement.GetSecurityCenterService]. message GetSecurityCenterServiceRequest { - // Required. The Security Command Center service to retrieve. - // - // Formats: + // Required. The Security Command Center service to retrieve, in one of the + // following formats: // - // * organizations/{organization}/locations/{location}/securityCenterServices/{service} - // * folders/{folder}/locations/{location}/securityCenterServices/{service} - // * projects/{project}/locations/{location}/securityCenterServices/{service} + // * organizations/{organization}/locations/{location}/securityCenterServices/{service} + // * folders/{folder}/locations/{location}/securityCenterServices/{service} + // * projects/{project}/locations/{location}/securityCenterServices/{service} // - // The possible values for id {service} are: + // The following values are valid for `{service}`: // - // * container-threat-detection - // * event-threat-detection - // * security-health-analytics - // * vm-threat-detection - // * web-security-scanner + // * `container-threat-detection` + // * `event-threat-detection` + // * `security-health-analytics` + // * `vm-threat-detection` + // * `web-security-scanner` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1629,20 +1715,20 @@ message GetSecurityCenterServiceRequest { } ]; - // Flag that, when set, will be used to filter the ModuleSettings that are - // in scope. The default setting is that all modules will be shown. + // Set to `true` to show only modules that are in scope. By default, all + // modules are shown. bool show_eligible_modules_only = 2; } -// Request message for listing Security Command Center services. +// Request message for +// [SecurityCenterManagement.ListSecurityCenterServices][google.cloud.securitycentermanagement.v1.SecurityCenterManagement.ListSecurityCenterServices]. message ListSecurityCenterServicesRequest { - // Required. The name of the parent to list Security Command Center services. - // - // Formats: + // Required. The name of the parent to list Security Command Center services, + // in one of the following formats: // - // * organizations/{organization}/locations/{location} - // * folders/{folder}/locations/{location} - // * projects/{project}/locations/{location} + // * `organizations/{organization}/locations/{location}` + // * `folders/{folder}/locations/{location}` + // * `projects/{project}/locations/{location}` string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -1654,42 +1740,57 @@ message ListSecurityCenterServicesRequest { // Default is 10, minimum is 1, maximum is 1000. int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - // Optional. The value returned by the last call indicating a continuation. + // Optional. A pagination token returned from a previous request. Provide this + // token to retrieve the next page of results. + // + // When paginating, the rest of the request must match the request that + // generated the page token. string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - // Flag that, when set, will be used to filter the ModuleSettings that are - // in scope. The default setting is that all modules will be shown. + // Flag that, when set, is used to filter the module settings that are shown. + // The default setting is that all modules are shown. bool show_eligible_modules_only = 4; } -// Response message for listing Security Command Center services. +// Response message for +// [SecurityCenterManagement.ListSecurityCenterServices][google.cloud.securitycentermanagement.v1.SecurityCenterManagement.ListSecurityCenterServices]. message ListSecurityCenterServicesResponse { // The list of services. repeated SecurityCenterService security_center_services = 1; - // A token identifying a page of results the server should return. + // A pagination token. To retrieve the next page of results, call the method + // again with this token. string next_page_token = 2; } -// Request message for updating a Security Command Center service. +// Request message for +// [SecurityCenterManagement.UpdateSecurityCenterService][google.cloud.securitycentermanagement.v1.SecurityCenterManagement.UpdateSecurityCenterService]. message UpdateSecurityCenterServiceRequest { // Required. The updated service. SecurityCenterService security_center_service = 1 [(google.api.field_behavior) = REQUIRED]; - // Required. The list of fields to be updated. Possible values: + // Required. The fields to update. Accepts the following values: + // + // * `intended_enablement_state` + // * `modules` // - // * "intended_enablement_state" - // * "modules" + // If omitted, then all eligible fields are updated. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; - // Optional. When set to true, only validations (including IAM checks) will be - // done for the request (service will not be updated). An OK response - // indicates that the request is valid, while an error response indicates that - // the request is invalid. Note that a subsequent request to actually update - // the service could still fail for one of the following reasons: - // - The state could have changed (e.g. IAM permission lost). - // - A failure occurred while trying to delete the module. + // Optional. When set to `true`, the request will be validated (including IAM + // checks), but no service will be updated. An `OK` response indicates that + // the request is valid, while an error response indicates that the request is + // invalid. + // + // If the request is valid, a subsequent request to update the service could + // still fail for one of the following reasons: + // + // * The state of your cloud resources changed; for example, you lost a + // required IAM permission + // * An error occurred during update of the service + // + // Defaults to `false`. bool validate_only = 3 [(google.api.field_behavior) = OPTIONAL]; } diff --git a/packages/google-cloud-securitycentermanagement/protos/protos.json b/packages/google-cloud-securitycentermanagement/protos/protos.json index 60e69ef3ba8..ce4eadc57e5 100644 --- a/packages/google-cloud-securitycentermanagement/protos/protos.json +++ b/packages/google-cloud-securitycentermanagement/protos/protos.json @@ -1,4 +1,7 @@ { + "options": { + "syntax": "proto3" + }, "nested": { "google": { "nested": { diff --git a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.create_event_threat_detection_custom_module.js b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.create_event_threat_detection_custom_module.js index 180851154a6..6609ecee720 100644 --- a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.create_event_threat_detection_custom_module.js +++ b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.create_event_threat_detection_custom_module.js @@ -29,27 +29,29 @@ function main(parent, eventThreatDetectionCustomModule) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Name of parent for the module. Its format is - * `organizations/{organization}/locations/{location}`, - * `folders/{folder}/locations/{location}`, - * or - * `projects/{project}/locations/{location}` + * Required. Name of parent for the module, in one of the following formats: + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` + * * `projects/{project}/locations/{location}` */ // const parent = 'abc123' /** * Required. The module to create. The - * event_threat_detection_custom_module.name will be ignored and server - * generated. + * EventThreatDetectionCustomModule.name google.cloud.securitycentermanagement.v1.EventThreatDetectionCustomModule.name + * field is ignored; Security Command Center generates the name. */ // const eventThreatDetectionCustomModule = {} /** - * Optional. When set to true, only validations (including IAM checks) will - * done for the request (no module will be created). An OK response indicates - * the request is valid while an error response indicates the request is - * invalid. Note that a subsequent request to actually create the module could - * still fail because 1. the state could have changed (e.g. IAM permission - * lost) or - * 2. A failure occurred during creation of the module. + * Optional. When set to `true`, the request will be validated (including IAM + * checks), but no module will be created. An `OK` response indicates that the + * request is valid, while an error response indicates that the request is + * invalid. + * If the request is valid, a subsequent request to create the module could + * still fail for one of the following reasons: + * * The state of your cloud resources changed; for example, you lost a + * required IAM permission + * * An error occurred during creation of the module + * Defaults to `false`. */ // const validateOnly = true diff --git a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.create_security_health_analytics_custom_module.js b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.create_security_health_analytics_custom_module.js index 69c49f66617..5c6e5cfb7ab 100644 --- a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.create_security_health_analytics_custom_module.js +++ b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.create_security_health_analytics_custom_module.js @@ -30,25 +30,27 @@ function main(parent, securityHealthAnalyticsCustomModule) { */ /** * Required. Name of the parent organization, folder, or project of the - * module, specified in one of the following formats: + * module, in one of the following formats: * * `organizations/{organization}/locations/{location}` * * `folders/{folder}/locations/{location}` * * `projects/{project}/locations/{location}` */ // const parent = 'abc123' /** - * Required. The resource being created + * Required. The resource being created. */ // const securityHealthAnalyticsCustomModule = {} /** - * Optional. When set to true, only validations (including IAM checks) will - * done for the request (no module will be created). An OK response indicates - * the request is valid while an error response indicates the request is - * invalid. Note that a subsequent request to actually create the module could - * still fail because: - * 1. the state could have changed (e.g. IAM permission lost) or - * 2. A failure occurred during creation of the module. - * Defaults to false. + * Optional. When set to `true`, the request will be validated (including IAM + * checks), but no module will be created. An `OK` response indicates that the + * request is valid, while an error response indicates that the request is + * invalid. + * If the request is valid, a subsequent request to create the module could + * still fail for one of the following reasons: + * * The state of your cloud resources changed; for example, you lost a + * required IAM permission + * * An error occurred during creation of the module + * Defaults to `false`. */ // const validateOnly = true diff --git a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.delete_event_threat_detection_custom_module.js b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.delete_event_threat_detection_custom_module.js index 814515c6da3..cfffc386d9c 100644 --- a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.delete_event_threat_detection_custom_module.js +++ b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.delete_event_threat_detection_custom_module.js @@ -29,21 +29,24 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The resource name of the ETD custom module. - * Its format is: - * * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. - * * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. - * * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. + * Required. The resource name of the Event Threat Detection custom module, in + * one of the following formats: + * * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` + * * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` + * * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` */ // const name = 'abc123' /** - * Optional. When set to true, only validations (including IAM checks) will - * done for the request (module will not be deleted). An OK response indicates - * the request is valid while an error response indicates the request is - * invalid. Note that a subsequent request to actually delete the module could - * still fail because 1. the state could have changed (e.g. IAM permission - * lost) or - * 2. A failure occurred while trying to delete the module. + * Optional. When set to `true`, the request will be validated (including IAM + * checks), but no module will be deleted. An `OK` response indicates that the + * request is valid, while an error response indicates that the request is + * invalid. + * If the request is valid, a subsequent request to delete the module could + * still fail for one of the following reasons: + * * The state of your cloud resources changed; for example, you lost a + * required IAM permission + * * An error occurred during creation of the module + * Defaults to `false`. */ // const validateOnly = true diff --git a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.delete_security_health_analytics_custom_module.js b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.delete_security_health_analytics_custom_module.js index 08ee6c87020..6fee6373e18 100644 --- a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.delete_security_health_analytics_custom_module.js +++ b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.delete_security_health_analytics_custom_module.js @@ -29,21 +29,24 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The resource name of the SHA custom module. - * Its format is: - * * `organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}`. - * * `folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}`. - * * `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}`. + * Required. The resource name of the SHA custom module, in one of the + * following formats: + * * `organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` + * * `folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` + * * `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` */ // const name = 'abc123' /** - * Optional. When set to true, only validations (including IAM checks) will - * done for the request (module will not be deleted). An OK response indicates - * the request is valid while an error response indicates the request is - * invalid. Note that a subsequent request to actually delete the module could - * still fail because 1. the state could have changed (e.g. IAM permission - * lost) or - * 2. A failure occurred while trying to delete the module. + * Optional. When set to `true`, the request will be validated (including IAM + * checks), but no module will be deleted. An `OK` response indicates that the + * request is valid, while an error response indicates that the request is + * invalid. + * If the request is valid, a subsequent request to delete the module could + * still fail for one of the following reasons: + * * The state of your cloud resources changed; for example, you lost a + * required IAM permission + * * An error occurred during deletion of the module + * Defaults to `false`. */ // const validateOnly = true diff --git a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.get_effective_event_threat_detection_custom_module.js b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.get_effective_event_threat_detection_custom_module.js index 6b956def594..678c53d4e09 100644 --- a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.get_effective_event_threat_detection_custom_module.js +++ b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.get_effective_event_threat_detection_custom_module.js @@ -29,11 +29,11 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The resource name of the ETD custom module. - * Its format is: - * * `organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. - * * `folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. - * * `projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. + * Required. The resource name of the Event Threat Detection custom module, in + * one of the following formats: + * * `organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` + * * `folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` + * * `projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` */ // const name = 'abc123' diff --git a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.get_effective_security_health_analytics_custom_module.js b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.get_effective_security_health_analytics_custom_module.js index 426af370fb7..11d87d6e337 100644 --- a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.get_effective_security_health_analytics_custom_module.js +++ b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.get_effective_security_health_analytics_custom_module.js @@ -31,9 +31,9 @@ function main(name) { /** * Required. The full resource name of the custom module, specified in one of * the following formats: - * * `organizations/organization/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` - * * `folders/folder/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` - * * `projects/project/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` + * * `organizations/organization/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` + * * `folders/folder/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` + * * `projects/project/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` */ // const name = 'abc123' diff --git a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.get_event_threat_detection_custom_module.js b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.get_event_threat_detection_custom_module.js index aa7c180bd4a..9c9f91ef020 100644 --- a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.get_event_threat_detection_custom_module.js +++ b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.get_event_threat_detection_custom_module.js @@ -29,11 +29,11 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The resource name of the ETD custom module. - * Its format is: - * * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. - * * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. - * * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. + * Required. The resource name of the Event Threat Detection custom module, in + * one of the following formats: + * * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` + * * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` + * * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` */ // const name = 'abc123' diff --git a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.get_security_center_service.js b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.get_security_center_service.js index 570e74065f9..a1389ae15c2 100644 --- a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.get_security_center_service.js +++ b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.get_security_center_service.js @@ -29,22 +29,22 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The Security Command Center service to retrieve. - * Formats: - * * organizations/{organization}/locations/{location}/securityCenterServices/{service} - * * folders/{folder}/locations/{location}/securityCenterServices/{service} - * * projects/{project}/locations/{location}/securityCenterServices/{service} - * The possible values for id {service} are: - * * container-threat-detection - * * event-threat-detection - * * security-health-analytics - * * vm-threat-detection - * * web-security-scanner + * Required. The Security Command Center service to retrieve, in one of the + * following formats: + * * organizations/{organization}/locations/{location}/securityCenterServices/{service} + * * folders/{folder}/locations/{location}/securityCenterServices/{service} + * * projects/{project}/locations/{location}/securityCenterServices/{service} + * The following values are valid for `{service}`: + * * `container-threat-detection` + * * `event-threat-detection` + * * `security-health-analytics` + * * `vm-threat-detection` + * * `web-security-scanner` */ // const name = 'abc123' /** - * Flag that, when set, will be used to filter the ModuleSettings that are - * in scope. The default setting is that all modules will be shown. + * Set to `true` to show only modules that are in scope. By default, all + * modules are shown. */ // const showEligibleModulesOnly = true diff --git a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.get_security_health_analytics_custom_module.js b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.get_security_health_analytics_custom_module.js index d485758d785..20857982d5c 100644 --- a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.get_security_health_analytics_custom_module.js +++ b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.get_security_health_analytics_custom_module.js @@ -29,7 +29,8 @@ function main(name) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Name of the resource + * Required. Name of the resource, in the format + * `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}`. */ // const name = 'abc123' diff --git a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.list_descendant_event_threat_detection_custom_modules.js b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.list_descendant_event_threat_detection_custom_modules.js index b93dd527860..0c7e6f1be95 100644 --- a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.list_descendant_event_threat_detection_custom_modules.js +++ b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.list_descendant_event_threat_detection_custom_modules.js @@ -29,11 +29,11 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Name of parent to list custom modules. Its format is - * `organizations/{organization}/locations/{location}`, - * `folders/{folder}/locations/{location}`, - * or - * `projects/{project}/locations/{location}` + * Required. Name of parent to list custom modules, in one of the following + * formats: + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` + * * `projects/{project}/locations/{location}` */ // const parent = 'abc123' /** @@ -43,7 +43,10 @@ function main(parent) { */ // const pageSize = 1234 /** - * Optional. A token identifying a page of results the server should return. + * Optional. A pagination token returned from a previous request. Provide this + * token to retrieve the next page of results. + * When paginating, the rest of the request must match the request that + * generated the page token. */ // const pageToken = 'abc123' diff --git a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.list_descendant_security_health_analytics_custom_modules.js b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.list_descendant_security_health_analytics_custom_modules.js index f776df66441..a841b2d90aa 100644 --- a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.list_descendant_security_health_analytics_custom_modules.js +++ b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.list_descendant_security_health_analytics_custom_modules.js @@ -30,7 +30,7 @@ function main(parent) { */ /** * Required. Name of the parent organization, folder, or project in which to - * list custom modules, specified in one of the following formats: + * list custom modules, in one of the following formats: * * `organizations/{organization}/locations/{location}` * * `folders/{folder}/locations/{location}` * * `projects/{project}/locations/{location}` @@ -42,7 +42,10 @@ function main(parent) { */ // const pageSize = 1234 /** - * Optional. A token identifying a page of results the server should return. + * Optional. A pagination token returned from a previous request. Provide this + * token to retrieve the next page of results. + * When paginating, the rest of the request must match the request that + * generated the page token. */ // const pageToken = 'abc123' diff --git a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.list_effective_event_threat_detection_custom_modules.js b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.list_effective_event_threat_detection_custom_modules.js index 760cf00470c..fe3606b692b 100644 --- a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.list_effective_event_threat_detection_custom_modules.js +++ b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.list_effective_event_threat_detection_custom_modules.js @@ -29,11 +29,11 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Name of parent to list effective custom modules. Its format is - * `organizations/{organization}/locations/{location}`, - * `folders/{folder}/locations/{location}`, - * or - * `projects/{project}/locations/{location}` + * Required. Name of parent to list effective custom modules, in one of the + * following formats: + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` + * * `projects/{project}/locations/{location}` */ // const parent = 'abc123' /** @@ -42,7 +42,10 @@ function main(parent) { */ // const pageSize = 1234 /** - * Optional. The value returned by the last call indicating a continuation + * Optional. A pagination token returned from a previous request. Provide this + * token to retrieve the next page of results. + * When paginating, the rest of the request must match the request that + * generated the page token. */ // const pageToken = 'abc123' diff --git a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.list_effective_security_health_analytics_custom_modules.js b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.list_effective_security_health_analytics_custom_modules.js index dc41b6486cd..4a8d8f423e9 100644 --- a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.list_effective_security_health_analytics_custom_modules.js +++ b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.list_effective_security_health_analytics_custom_modules.js @@ -29,12 +29,11 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Name of parent to list effective custom modules. specified in one - * of the following formats: + * Required. Name of parent to list effective custom modules, in one of the + * following formats: * * `organizations/{organization}/locations/{location}` * * `folders/{folder}/locations/{location}` - * or - * `projects/{project}/locations/{location}` + * * `projects/{project}/locations/{location}` */ // const parent = 'abc123' /** @@ -43,7 +42,10 @@ function main(parent) { */ // const pageSize = 1234 /** - * Optional. The value returned by the last call indicating a continuation. + * Optional. A pagination token returned from a previous request. Provide this + * token to retrieve the next page of results. + * When paginating, the rest of the request must match the request that + * generated the page token. */ // const pageToken = 'abc123' diff --git a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.list_event_threat_detection_custom_modules.js b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.list_event_threat_detection_custom_modules.js index b65b6fb04a3..0840127b8fd 100644 --- a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.list_event_threat_detection_custom_modules.js +++ b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.list_event_threat_detection_custom_modules.js @@ -29,26 +29,24 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Name of parent to list custom modules. Its format is - * `organizations/{organization}/locations/{location}`, - * `folders/{folder}/locations/{location}`, - * or - * `projects/{project}/locations/{location}` + * Required. Name of parent to list custom modules, in one of the following + * formats: + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` + * * `projects/{project}/locations/{location}` */ // const parent = 'abc123' /** * Optional. The maximum number of modules to return. The service may return - * fewer than this value. If unspecified, at most 10 configs will be returned. + * fewer than this value. If unspecified, at most 10 modules will be returned. * The maximum value is 1000; values above 1000 will be coerced to 1000. */ // const pageSize = 1234 /** - * Optional. A page token, received from a previous - * `ListEventThreatDetectionCustomModules` call. Provide this to retrieve the - * subsequent page. - * When paginating, all other parameters provided to - * `ListEventThreatDetectionCustomModules` must match the call that provided - * the page token. + * Optional. A pagination token returned from a previous request. Provide this + * token to retrieve the next page of results. + * When paginating, the rest of the request must match the request that + * generated the page token. */ // const pageToken = 'abc123' diff --git a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.list_security_center_services.js b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.list_security_center_services.js index 82db48cf0e8..e051aa5c402 100644 --- a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.list_security_center_services.js +++ b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.list_security_center_services.js @@ -29,11 +29,11 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The name of the parent to list Security Command Center services. - * Formats: - * * organizations/{organization}/locations/{location} - * * folders/{folder}/locations/{location} - * * projects/{project}/locations/{location} + * Required. The name of the parent to list Security Command Center services, + * in one of the following formats: + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` + * * `projects/{project}/locations/{location}` */ // const parent = 'abc123' /** @@ -42,12 +42,15 @@ function main(parent) { */ // const pageSize = 1234 /** - * Optional. The value returned by the last call indicating a continuation. + * Optional. A pagination token returned from a previous request. Provide this + * token to retrieve the next page of results. + * When paginating, the rest of the request must match the request that + * generated the page token. */ // const pageToken = 'abc123' /** - * Flag that, when set, will be used to filter the ModuleSettings that are - * in scope. The default setting is that all modules will be shown. + * Flag that, when set, is used to filter the module settings that are shown. + * The default setting is that all modules are shown. */ // const showEligibleModulesOnly = true diff --git a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.list_security_health_analytics_custom_modules.js b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.list_security_health_analytics_custom_modules.js index f0e03a5984c..b18cca26557 100644 --- a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.list_security_health_analytics_custom_modules.js +++ b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.list_security_health_analytics_custom_modules.js @@ -29,8 +29,8 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Name of parent organization, folder, or project in which to list - * custom modules, specified in one of the following formats: + * Required. Name of the parent organization, folder, or project in which to + * list custom modules, in one of the following formats: * * `organizations/{organization}/locations/{location}` * * `folders/{folder}/locations/{location}` * * `projects/{project}/locations/{location}` @@ -42,7 +42,10 @@ function main(parent) { */ // const pageSize = 1234 /** - * Optional. A token identifying a page of results the server should return. + * Optional. A pagination token returned from a previous request. Provide this + * token to retrieve the next page of results. + * When paginating, the rest of the request must match the request that + * generated the page token. */ // const pageToken = 'abc123' diff --git a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.simulate_security_health_analytics_custom_module.js b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.simulate_security_health_analytics_custom_module.js index 1e887d262e9..36db8be6a11 100644 --- a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.simulate_security_health_analytics_custom_module.js +++ b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.simulate_security_health_analytics_custom_module.js @@ -30,10 +30,9 @@ function main(parent, customConfig, resource) { */ /** * Required. The relative resource name of the organization, project, or - * folder. For more information about relative resource names, see Relative - * Resource - * Name (https://cloud.google.com/apis/design/resource_names#relative_resource_name) - * Example: `organizations/{organization_id}`. + * folder. For more information about relative resource names, see AIP-122: + * Resource names (https://google.aip.dev/122). Example: + * `organizations/{organization_id}`. */ // const parent = 'abc123' /** diff --git a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.update_event_threat_detection_custom_module.js b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.update_event_threat_detection_custom_module.js index 35eb9f1e233..537420ad2cc 100644 --- a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.update_event_threat_detection_custom_module.js +++ b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.update_event_threat_detection_custom_module.js @@ -29,25 +29,24 @@ function main(updateMask, eventThreatDetectionCustomModule) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Field mask is used to specify the fields to be overwritten in the - * EventThreatDetectionCustomModule resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. + * Required. The fields to update. If omitted, then all fields are updated. */ // const updateMask = {} /** - * Required. The module being updated + * Required. The module being updated. */ // const eventThreatDetectionCustomModule = {} /** - * Optional. When set to true, only validations (including IAM checks) will - * done for the request (module will not be updated). An OK response indicates - * the request is valid while an error response indicates the request is - * invalid. Note that a subsequent request to actually update the module could - * still fail because 1. the state could have changed (e.g. IAM permission - * lost) or - * 2. A failure occurred while trying to update the module. + * Optional. When set to `true`, the request will be validated (including IAM + * checks), but no module will be updated. An `OK` response indicates that the + * request is valid, while an error response indicates that the request is + * invalid. + * If the request is valid, a subsequent request to update the module could + * still fail for one of the following reasons: + * * The state of your cloud resources changed; for example, you lost a + * required IAM permission + * * An error occurred during creation of the module + * Defaults to `false`. */ // const validateOnly = true diff --git a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.update_security_center_service.js b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.update_security_center_service.js index 045b894a221..7a733988cf8 100644 --- a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.update_security_center_service.js +++ b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.update_security_center_service.js @@ -33,19 +33,23 @@ function main(securityCenterService, updateMask) { */ // const securityCenterService = {} /** - * Required. The list of fields to be updated. Possible values: - * * "intended_enablement_state" - * * "modules" + * Required. The fields to update. Accepts the following values: + * * `intended_enablement_state` + * * `modules` + * If omitted, then all eligible fields are updated. */ // const updateMask = {} /** - * Optional. When set to true, only validations (including IAM checks) will be - * done for the request (service will not be updated). An OK response - * indicates that the request is valid, while an error response indicates that - * the request is invalid. Note that a subsequent request to actually update - * the service could still fail for one of the following reasons: - * - The state could have changed (e.g. IAM permission lost). - * - A failure occurred while trying to delete the module. + * Optional. When set to `true`, the request will be validated (including IAM + * checks), but no service will be updated. An `OK` response indicates that + * the request is valid, while an error response indicates that the request is + * invalid. + * If the request is valid, a subsequent request to update the service could + * still fail for one of the following reasons: + * * The state of your cloud resources changed; for example, you lost a + * required IAM permission + * * An error occurred during update of the service + * Defaults to `false`. */ // const validateOnly = true diff --git a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.update_security_health_analytics_custom_module.js b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.update_security_health_analytics_custom_module.js index 04f4e3ddd7c..1676bdfde19 100644 --- a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.update_security_health_analytics_custom_module.js +++ b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.update_security_health_analytics_custom_module.js @@ -29,24 +29,28 @@ function main(updateMask, securityHealthAnalyticsCustomModule) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The list of fields to be updated. The only fields that can be - * updated are `enablement_state` and `custom_config`. If empty or set to the - * wildcard value `*`, both `enablement_state` and `custom_config` are - * updated. + * Required. The fields to update. The following values are valid: + * * `custom_config` + * * `enablement_state` + * If you omit this field or set it to the wildcard value `*`, then all + * eligible fields are updated. */ // const updateMask = {} /** - * Required. The resource being updated + * Required. The resource being updated. */ // const securityHealthAnalyticsCustomModule = {} /** - * Optional. When set to true, only validations (including IAM checks) will - * done for the request (module will not be updated). An OK response indicates - * the request is valid while an error response indicates the request is - * invalid. Note that a subsequent request to actually update the module could - * still fail because 1. the state could have changed (e.g. IAM permission - * lost) or - * 2. A failure occurred while trying to update the module. + * Optional. When set to `true`, the request will be validated (including IAM + * checks), but no module will be updated. An `OK` response indicates that the + * request is valid, while an error response indicates that the request is + * invalid. + * If the request is valid, a subsequent request to update the module could + * still fail for one of the following reasons: + * * The state of your cloud resources changed; for example, you lost a + * required IAM permission + * * An error occurred during creation of the module + * Defaults to `false`. */ // const validateOnly = true diff --git a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.validate_event_threat_detection_custom_module.js b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.validate_event_threat_detection_custom_module.js index c03d4c986d0..5264f550dc4 100644 --- a/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.validate_event_threat_detection_custom_module.js +++ b/packages/google-cloud-securitycentermanagement/samples/generated/v1/security_center_management.validate_event_threat_detection_custom_module.js @@ -29,9 +29,9 @@ function main(parent, rawText, type) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. Resource name of the parent to validate the Custom Module under. - * Its format is: - * * `organizations/{organization}/locations/{location}`. + * Required. Resource name of the parent to validate the custom modules under, + * in one of the following formats: + * * `organizations/{organization}/locations/{location}` */ // const parent = 'abc123' /** @@ -40,7 +40,7 @@ function main(parent, rawText, type) { */ // const rawText = 'abc123' /** - * Required. The type of the module (e.g. CONFIGURABLE_BAD_IP). + * Required. The type of the module. For example, `CONFIGURABLE_BAD_IP`. */ // const type = 'abc123' diff --git a/packages/google-cloud-securitycentermanagement/samples/generated/v1/snippet_metadata_google.cloud.securitycentermanagement.v1.json b/packages/google-cloud-securitycentermanagement/samples/generated/v1/snippet_metadata_google.cloud.securitycentermanagement.v1.json index df7530bc666..ecc02799309 100644 --- a/packages/google-cloud-securitycentermanagement/samples/generated/v1/snippet_metadata_google.cloud.securitycentermanagement.v1.json +++ b/packages/google-cloud-securitycentermanagement/samples/generated/v1/snippet_metadata_google.cloud.securitycentermanagement.v1.json @@ -15,14 +15,14 @@ "regionTag": "securitycentermanagement_v1_generated_SecurityCenterManagement_ListEffectiveSecurityHealthAnalyticsCustomModules_async", "title": "SecurityCenterManagement listEffectiveSecurityHealthAnalyticsCustomModules Sample", "origin": "API_DEFINITION", - "description": " Returns a list of all EffectiveSecurityHealthAnalyticsCustomModules for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from CRM ancestors (no descendants).", + "description": " Returns a list of all [EffectiveSecurityHealthAnalyticsCustomModule][google.cloud.securitycentermanagement.v1.EffectiveSecurityHealthAnalyticsCustomModule] resources for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from ancestor organizations, folders, and projects (no descendants).", "canonical": true, "file": "security_center_management.list_effective_security_health_analytics_custom_modules.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 69, + "end": 71, "type": "FULL" } ], @@ -63,7 +63,7 @@ "regionTag": "securitycentermanagement_v1_generated_SecurityCenterManagement_GetEffectiveSecurityHealthAnalyticsCustomModule_async", "title": "SecurityCenterManagement getEffectiveSecurityHealthAnalyticsCustomModule Sample", "origin": "API_DEFINITION", - "description": " Gets details of a single EffectiveSecurityHealthAnalyticsCustomModule.", + "description": " Gets details of a single [EffectiveSecurityHealthAnalyticsCustomModule][google.cloud.securitycentermanagement.v1.EffectiveSecurityHealthAnalyticsCustomModule].", "canonical": true, "file": "security_center_management.get_effective_security_health_analytics_custom_module.js", "language": "JAVASCRIPT", @@ -103,14 +103,14 @@ "regionTag": "securitycentermanagement_v1_generated_SecurityCenterManagement_ListSecurityHealthAnalyticsCustomModules_async", "title": "SecurityCenterManagement listSecurityHealthAnalyticsCustomModules Sample", "origin": "API_DEFINITION", - "description": " Returns a list of all SecurityHealthAnalyticsCustomModules for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from CRM ancestors (no descendants).", + "description": " Returns a list of all [SecurityHealthAnalyticsCustomModule][google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule] resources for the given parent. This includes resident modules defined at the scope of the parent, and inherited modules, inherited from ancestor organizations, folders, and projects (no descendants).", "canonical": true, "file": "security_center_management.list_security_health_analytics_custom_modules.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 68, + "end": 71, "type": "FULL" } ], @@ -151,14 +151,14 @@ "regionTag": "securitycentermanagement_v1_generated_SecurityCenterManagement_ListDescendantSecurityHealthAnalyticsCustomModules_async", "title": "SecurityCenterManagement listDescendantSecurityHealthAnalyticsCustomModules Sample", "origin": "API_DEFINITION", - "description": " Returns a list of all resident SecurityHealthAnalyticsCustomModules under the given CRM parent and all of the parent's CRM descendants.", + "description": " Returns a list of all resident [SecurityHealthAnalyticsCustomModule][google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule] resources under the given organization, folder, or project and all of its descendants.", "canonical": true, "file": "security_center_management.list_descendant_security_health_analytics_custom_modules.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 68, + "end": 71, "type": "FULL" } ], @@ -199,14 +199,14 @@ "regionTag": "securitycentermanagement_v1_generated_SecurityCenterManagement_GetSecurityHealthAnalyticsCustomModule_async", "title": "SecurityCenterManagement getSecurityHealthAnalyticsCustomModule Sample", "origin": "API_DEFINITION", - "description": " Retrieves a SecurityHealthAnalyticsCustomModule.", + "description": " Retrieves a [SecurityHealthAnalyticsCustomModule][google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule].", "canonical": true, "file": "security_center_management.get_security_health_analytics_custom_module.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 53, + "end": 54, "type": "FULL" } ], @@ -239,14 +239,14 @@ "regionTag": "securitycentermanagement_v1_generated_SecurityCenterManagement_CreateSecurityHealthAnalyticsCustomModule_async", "title": "SecurityCenterManagement createSecurityHealthAnalyticsCustomModule Sample", "origin": "API_DEFINITION", - "description": " Creates a resident SecurityHealthAnalyticsCustomModule at the scope of the given CRM parent, and also creates inherited SecurityHealthAnalyticsCustomModules for all CRM descendants of the given parent. These modules are enabled by default.", + "description": " Creates a resident [SecurityHealthAnalyticsCustomModule][google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule] at the scope of the given organization, folder, or project, and also creates inherited `SecurityHealthAnalyticsCustomModule` resources for all folders and projects that are descendants of the given parent. These modules are enabled by default.", "canonical": true, "file": "security_center_management.create_security_health_analytics_custom_module.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 73, + "end": 75, "type": "FULL" } ], @@ -287,14 +287,14 @@ "regionTag": "securitycentermanagement_v1_generated_SecurityCenterManagement_UpdateSecurityHealthAnalyticsCustomModule_async", "title": "SecurityCenterManagement updateSecurityHealthAnalyticsCustomModule Sample", "origin": "API_DEFINITION", - "description": " Updates the SecurityHealthAnalyticsCustomModule under the given name based on the given update mask. Updating the enablement state is supported on both resident and inherited modules (though resident modules cannot have an enablement state of \"inherited\"). Updating the display name and custom config of a module is supported on resident modules only.", + "description": " Updates the [SecurityHealthAnalyticsCustomModule][google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule] under the given name based on the given update mask. Updating the enablement state is supported on both resident and inherited modules (though resident modules cannot have an enablement state of \"inherited\"). Updating the display name and custom configuration of a module is supported on resident modules only.", "canonical": true, "file": "security_center_management.update_security_health_analytics_custom_module.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 71, + "end": 75, "type": "FULL" } ], @@ -335,14 +335,14 @@ "regionTag": "securitycentermanagement_v1_generated_SecurityCenterManagement_DeleteSecurityHealthAnalyticsCustomModule_async", "title": "SecurityCenterManagement deleteSecurityHealthAnalyticsCustomModule Sample", "origin": "API_DEFINITION", - "description": " Deletes the specified SecurityHealthAnalyticsCustomModule and all of its descendants in the CRM hierarchy. This method is only supported for resident custom modules.", + "description": " Deletes the specified [SecurityHealthAnalyticsCustomModule][google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule] and all of its descendants in the resource hierarchy. This method is only supported for resident custom modules.", "canonical": true, "file": "security_center_management.delete_security_health_analytics_custom_module.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 67, + "end": 70, "type": "FULL" } ], @@ -379,14 +379,14 @@ "regionTag": "securitycentermanagement_v1_generated_SecurityCenterManagement_SimulateSecurityHealthAnalyticsCustomModule_async", "title": "SecurityCenterManagement simulateSecurityHealthAnalyticsCustomModule Sample", "origin": "API_DEFINITION", - "description": " Simulates a given SecurityHealthAnalyticsCustomModule and Resource.", + "description": " Simulates the result of using a [SecurityHealthAnalyticsCustomModule][google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule] to check a resource.", "canonical": true, "file": "security_center_management.simulate_security_health_analytics_custom_module.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 67, + "end": 66, "type": "FULL" } ], @@ -434,7 +434,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 71, "type": "FULL" } ], @@ -475,7 +475,7 @@ "regionTag": "securitycentermanagement_v1_generated_SecurityCenterManagement_GetEffectiveEventThreatDetectionCustomModule_async", "title": "SecurityCenterManagement getEffectiveEventThreatDetectionCustomModule Sample", "origin": "API_DEFINITION", - "description": " Gets an effective ETD custom module. Retrieves the effective module at the given level. The difference between an EffectiveCustomModule and a CustomModule is that the fields for an EffectiveCustomModule are computed from ancestors if needed. For example, the enablement_state for a CustomModule can be either ENABLED, DISABLED, or INHERITED. Where as the enablement_state for an EffectiveCustomModule is always computed to ENABLED or DISABLED (the effective enablement_state).", + "description": " Gets the effective Event Threat Detection custom module at the given level. The difference between an [EffectiveEventThreatDetectionCustomModule][google.cloud.securitycentermanagement.v1.EffectiveEventThreatDetectionCustomModule] and an [EventThreatDetectionCustomModule][google.cloud.securitycentermanagement.v1.EventThreatDetectionCustomModule] is that the fields for an `EffectiveEventThreatDetectionCustomModule` are computed from ancestors if needed. For example, the enablement state for an `EventThreatDetectionCustomModule` can be `ENABLED`, `DISABLED`, or `INHERITED`. In contrast, the enablement state for an `EffectiveEventThreatDetectionCustomModule` is always computed as `ENABLED` or `DISABLED`.", "canonical": true, "file": "security_center_management.get_effective_event_threat_detection_custom_module.js", "language": "JAVASCRIPT", @@ -515,14 +515,14 @@ "regionTag": "securitycentermanagement_v1_generated_SecurityCenterManagement_ListEventThreatDetectionCustomModules_async", "title": "SecurityCenterManagement listEventThreatDetectionCustomModules Sample", "origin": "API_DEFINITION", - "description": " Lists all Event Threat Detection custom modules for the given Resource Manager parent. This includes resident modules defined at the scope of the parent along with modules inherited from ancestors.", + "description": " Lists all Event Threat Detection custom modules for the given organization, folder, or project. This includes resident modules defined at the scope of the parent along with modules inherited from ancestors.", "canonical": true, "file": "security_center_management.list_event_threat_detection_custom_modules.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 74, + "end": 72, "type": "FULL" } ], @@ -563,14 +563,14 @@ "regionTag": "securitycentermanagement_v1_generated_SecurityCenterManagement_ListDescendantEventThreatDetectionCustomModules_async", "title": "SecurityCenterManagement listDescendantEventThreatDetectionCustomModules Sample", "origin": "API_DEFINITION", - "description": " Lists all resident Event Threat Detection custom modules under the given Resource Manager parent and its descendants.", + "description": " Lists all resident Event Threat Detection custom modules for the given organization, folder, or project and its descendants.", "canonical": true, "file": "security_center_management.list_descendant_event_threat_detection_custom_modules.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 69, + "end": 72, "type": "FULL" } ], @@ -651,14 +651,14 @@ "regionTag": "securitycentermanagement_v1_generated_SecurityCenterManagement_CreateEventThreatDetectionCustomModule_async", "title": "SecurityCenterManagement createEventThreatDetectionCustomModule Sample", "origin": "API_DEFINITION", - "description": " Creates a resident Event Threat Detection custom module at the scope of the given Resource Manager parent, and also creates inherited custom modules for all descendants of the given parent. These modules are enabled by default.", + "description": " Creates a resident Event Threat Detection custom module at the scope of the given organization, folder, or project, and creates inherited custom modules for all descendants of the given parent. These modules are enabled by default.", "canonical": true, "file": "security_center_management.create_event_threat_detection_custom_module.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 74, + "end": 76, "type": "FULL" } ], @@ -706,7 +706,7 @@ "segments": [ { "start": 25, - "end": 72, + "end": 71, "type": "FULL" } ], @@ -747,14 +747,14 @@ "regionTag": "securitycentermanagement_v1_generated_SecurityCenterManagement_DeleteEventThreatDetectionCustomModule_async", "title": "SecurityCenterManagement deleteEventThreatDetectionCustomModule Sample", "origin": "API_DEFINITION", - "description": " Deletes the specified Event Threat Detection custom module and all of its descendants in the Resource Manager hierarchy. This method is only supported for resident custom modules.", + "description": " Deletes the specified Event Threat Detection custom module and all of its descendants in the resource hierarchy. This method is only supported for resident custom modules.", "canonical": true, "file": "security_center_management.delete_event_threat_detection_custom_module.js", "language": "JAVASCRIPT", "segments": [ { "start": 25, - "end": 67, + "end": 70, "type": "FULL" } ], @@ -890,7 +890,7 @@ "segments": [ { "start": 25, - "end": 73, + "end": 76, "type": "FULL" } ], @@ -942,7 +942,7 @@ "segments": [ { "start": 25, - "end": 70, + "end": 74, "type": "FULL" } ], diff --git a/packages/google-cloud-securitycentermanagement/src/v1/security_center_management_client.ts b/packages/google-cloud-securitycentermanagement/src/v1/security_center_management_client.ts index ca8096fbd74..418af7185e1 100644 --- a/packages/google-cloud-securitycentermanagement/src/v1/security_center_management_client.ts +++ b/packages/google-cloud-securitycentermanagement/src/v1/security_center_management_client.ts @@ -520,7 +520,8 @@ export class SecurityCenterManagementClient { // -- Service calls -- // ------------------- /** - * Gets details of a single EffectiveSecurityHealthAnalyticsCustomModule. + * Gets details of a single + * {@link protos.google.cloud.securitycentermanagement.v1.EffectiveSecurityHealthAnalyticsCustomModule|EffectiveSecurityHealthAnalyticsCustomModule}. * * @param {Object} request * The request object that will be sent. @@ -528,9 +529,9 @@ export class SecurityCenterManagementClient { * Required. The full resource name of the custom module, specified in one of * the following formats: * - * * `organizations/organization/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` - * * `folders/folder/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` - * * `projects/project/{location}/effectiveSecurityHealthAnalyticsCustomModules/{effective_security_health_analytics_custom_module}` + * * `organizations/organization/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` + * * `folders/folder/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` + * * `projects/project/{location}/effectiveSecurityHealthAnalyticsCustomModules/{custom_module}` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -625,12 +626,14 @@ export class SecurityCenterManagementClient { ); } /** - * Retrieves a SecurityHealthAnalyticsCustomModule. + * Retrieves a + * {@link protos.google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule|SecurityHealthAnalyticsCustomModule}. * * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. Name of the resource + * Required. Name of the resource, in the format + * `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -725,31 +728,38 @@ export class SecurityCenterManagementClient { ); } /** - * Creates a resident SecurityHealthAnalyticsCustomModule at the scope of the - * given CRM parent, and also creates inherited - * SecurityHealthAnalyticsCustomModules for all CRM descendants of the given - * parent. These modules are enabled by default. + * Creates a resident + * {@link protos.google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule|SecurityHealthAnalyticsCustomModule} + * at the scope of the given organization, folder, or project, and also + * creates inherited `SecurityHealthAnalyticsCustomModule` resources for all + * folders and projects that are descendants of the given parent. These + * modules are enabled by default. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. Name of the parent organization, folder, or project of the - * module, specified in one of the following formats: + * module, in one of the following formats: * * * `organizations/{organization}/locations/{location}` * * `folders/{folder}/locations/{location}` * * `projects/{project}/locations/{location}` * @param {google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule} request.securityHealthAnalyticsCustomModule - * Required. The resource being created + * Required. The resource being created. * @param {boolean} [request.validateOnly] - * Optional. When set to true, only validations (including IAM checks) will - * done for the request (no module will be created). An OK response indicates - * the request is valid while an error response indicates the request is - * invalid. Note that a subsequent request to actually create the module could - * still fail because: - * 1. the state could have changed (e.g. IAM permission lost) or - * 2. A failure occurred during creation of the module. - * Defaults to false. + * Optional. When set to `true`, the request will be validated (including IAM + * checks), but no module will be created. An `OK` response indicates that the + * request is valid, while an error response indicates that the request is + * invalid. + * + * If the request is valid, a subsequent request to create the module could + * still fail for one of the following reasons: + * + * * The state of your cloud resources changed; for example, you lost a + * required IAM permission + * * An error occurred during creation of the module + * + * Defaults to `false`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -844,29 +854,40 @@ export class SecurityCenterManagementClient { ); } /** - * Updates the SecurityHealthAnalyticsCustomModule under the given name based - * on the given update mask. Updating the enablement state is supported on - * both resident and inherited modules (though resident modules cannot have an - * enablement state of "inherited"). Updating the display name and custom - * config of a module is supported on resident modules only. + * Updates the + * {@link protos.google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule|SecurityHealthAnalyticsCustomModule} + * under the given name based on the given update mask. Updating the + * enablement state is supported on both resident and inherited modules + * (though resident modules cannot have an enablement state of "inherited"). + * Updating the display name and custom configuration of a module is supported + * on resident modules only. * * @param {Object} request * The request object that will be sent. * @param {google.protobuf.FieldMask} request.updateMask - * Required. The list of fields to be updated. The only fields that can be - * updated are `enablement_state` and `custom_config`. If empty or set to the - * wildcard value `*`, both `enablement_state` and `custom_config` are - * updated. + * Required. The fields to update. The following values are valid: + * + * * `custom_config` + * * `enablement_state` + * + * If you omit this field or set it to the wildcard value `*`, then all + * eligible fields are updated. * @param {google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule} request.securityHealthAnalyticsCustomModule - * Required. The resource being updated + * Required. The resource being updated. * @param {boolean} [request.validateOnly] - * Optional. When set to true, only validations (including IAM checks) will - * done for the request (module will not be updated). An OK response indicates - * the request is valid while an error response indicates the request is - * invalid. Note that a subsequent request to actually update the module could - * still fail because 1. the state could have changed (e.g. IAM permission - * lost) or - * 2. A failure occurred while trying to update the module. + * Optional. When set to `true`, the request will be validated (including IAM + * checks), but no module will be updated. An `OK` response indicates that the + * request is valid, while an error response indicates that the request is + * invalid. + * + * If the request is valid, a subsequent request to update the module could + * still fail for one of the following reasons: + * + * * The state of your cloud resources changed; for example, you lost a + * required IAM permission + * * An error occurred during creation of the module + * + * Defaults to `false`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -962,28 +983,34 @@ export class SecurityCenterManagementClient { ); } /** - * Deletes the specified SecurityHealthAnalyticsCustomModule and all of its - * descendants in the CRM hierarchy. This method is only supported for - * resident custom modules. + * Deletes the specified + * {@link protos.google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule|SecurityHealthAnalyticsCustomModule} + * and all of its descendants in the resource hierarchy. This method is only + * supported for resident custom modules. * * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. The resource name of the SHA custom module. - * - * Its format is: + * Required. The resource name of the SHA custom module, in one of the + * following formats: * - * * `organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}`. - * * `folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}`. - * * `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{security_health_analytics_custom_module}`. + * * `organizations/{organization}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` + * * `folders/{folder}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` + * * `projects/{project}/locations/{location}/securityHealthAnalyticsCustomModules/{custom_module}` * @param {boolean} [request.validateOnly] - * Optional. When set to true, only validations (including IAM checks) will - * done for the request (module will not be deleted). An OK response indicates - * the request is valid while an error response indicates the request is - * invalid. Note that a subsequent request to actually delete the module could - * still fail because 1. the state could have changed (e.g. IAM permission - * lost) or - * 2. A failure occurred while trying to delete the module. + * Optional. When set to `true`, the request will be validated (including IAM + * checks), but no module will be deleted. An `OK` response indicates that the + * request is valid, while an error response indicates that the request is + * invalid. + * + * If the request is valid, a subsequent request to delete the module could + * still fail for one of the following reasons: + * + * * The state of your cloud resources changed; for example, you lost a + * required IAM permission + * * An error occurred during deletion of the module + * + * Defaults to `false`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1078,16 +1105,17 @@ export class SecurityCenterManagementClient { ); } /** - * Simulates a given SecurityHealthAnalyticsCustomModule and Resource. + * Simulates the result of using a + * {@link protos.google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule|SecurityHealthAnalyticsCustomModule} + * to check a resource. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. The relative resource name of the organization, project, or - * folder. For more information about relative resource names, see [Relative - * Resource - * Name](https://cloud.google.com/apis/design/resource_names#relative_resource_name) - * Example: `organizations/{organization_id}`. + * folder. For more information about relative resource names, see [AIP-122: + * Resource names](https://google.aip.dev/122). Example: + * `organizations/{organization_id}`. * @param {google.cloud.securitycentermanagement.v1.CustomConfig} request.customConfig * Required. The custom configuration that you need to test. * @param {google.cloud.securitycentermanagement.v1.SimulateSecurityHealthAnalyticsCustomModuleRequest.SimulatedResource} request.resource @@ -1186,24 +1214,28 @@ export class SecurityCenterManagementClient { ); } /** - * Gets an effective ETD custom module. Retrieves the effective module at the - * given level. The difference between an EffectiveCustomModule and a - * CustomModule is that the fields for an EffectiveCustomModule are computed - * from ancestors if needed. For example, the enablement_state for a - * CustomModule can be either ENABLED, DISABLED, or INHERITED. Where as the - * enablement_state for an EffectiveCustomModule is always computed to ENABLED - * or DISABLED (the effective enablement_state). + * Gets the effective Event Threat Detection custom module at the given level. + * + * The difference between an + * {@link protos.google.cloud.securitycentermanagement.v1.EffectiveEventThreatDetectionCustomModule|EffectiveEventThreatDetectionCustomModule} + * and an + * {@link protos.google.cloud.securitycentermanagement.v1.EventThreatDetectionCustomModule|EventThreatDetectionCustomModule} + * is that the fields for an `EffectiveEventThreatDetectionCustomModule` are + * computed from ancestors if needed. For example, the enablement state for an + * `EventThreatDetectionCustomModule` can be `ENABLED`, `DISABLED`, or + * `INHERITED`. In contrast, the enablement state for an + * `EffectiveEventThreatDetectionCustomModule` is always computed as `ENABLED` + * or `DISABLED`. * * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. The resource name of the ETD custom module. - * - * Its format is: + * Required. The resource name of the Event Threat Detection custom module, in + * one of the following formats: * - * * `organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. - * * `folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. - * * `projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{effective_event_threat_detection_custom_module}`. + * * `organizations/{organization}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` + * * `folders/{folder}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` + * * `projects/{project}/locations/{location}/effectiveEventThreatDetectionCustomModules/{custom_module}` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1303,13 +1335,12 @@ export class SecurityCenterManagementClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. The resource name of the ETD custom module. + * Required. The resource name of the Event Threat Detection custom module, in + * one of the following formats: * - * Its format is: - * - * * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. - * * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. - * * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. + * * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` + * * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` + * * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1405,30 +1436,36 @@ export class SecurityCenterManagementClient { } /** * Creates a resident Event Threat Detection custom module at the scope of the - * given Resource Manager parent, and also creates inherited custom modules - * for all descendants of the given parent. These modules are enabled by - * default. + * given organization, folder, or project, and creates inherited custom + * modules for all descendants of the given parent. These modules are enabled + * by default. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of parent for the module. Its format is - * `organizations/{organization}/locations/{location}`, - * `folders/{folder}/locations/{location}`, - * or - * `projects/{project}/locations/{location}` + * Required. Name of parent for the module, in one of the following formats: + * + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` + * * `projects/{project}/locations/{location}` * @param {google.cloud.securitycentermanagement.v1.EventThreatDetectionCustomModule} request.eventThreatDetectionCustomModule * Required. The module to create. The - * event_threat_detection_custom_module.name will be ignored and server - * generated. + * {@link protos.google.cloud.securitycentermanagement.v1.EventThreatDetectionCustomModule.name|EventThreatDetectionCustomModule.name} + * field is ignored; Security Command Center generates the name. * @param {boolean} [request.validateOnly] - * Optional. When set to true, only validations (including IAM checks) will - * done for the request (no module will be created). An OK response indicates - * the request is valid while an error response indicates the request is - * invalid. Note that a subsequent request to actually create the module could - * still fail because 1. the state could have changed (e.g. IAM permission - * lost) or - * 2. A failure occurred during creation of the module. + * Optional. When set to `true`, the request will be validated (including IAM + * checks), but no module will be created. An `OK` response indicates that the + * request is valid, while an error response indicates that the request is + * invalid. + * + * If the request is valid, a subsequent request to create the module could + * still fail for one of the following reasons: + * + * * The state of your cloud resources changed; for example, you lost a + * required IAM permission + * * An error occurred during creation of the module + * + * Defaults to `false`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1533,21 +1570,23 @@ export class SecurityCenterManagementClient { * @param {Object} request * The request object that will be sent. * @param {google.protobuf.FieldMask} request.updateMask - * Required. Field mask is used to specify the fields to be overwritten in the - * EventThreatDetectionCustomModule resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then all fields will be overwritten. + * Required. The fields to update. If omitted, then all fields are updated. * @param {google.cloud.securitycentermanagement.v1.EventThreatDetectionCustomModule} request.eventThreatDetectionCustomModule - * Required. The module being updated + * Required. The module being updated. * @param {boolean} [request.validateOnly] - * Optional. When set to true, only validations (including IAM checks) will - * done for the request (module will not be updated). An OK response indicates - * the request is valid while an error response indicates the request is - * invalid. Note that a subsequent request to actually update the module could - * still fail because 1. the state could have changed (e.g. IAM permission - * lost) or - * 2. A failure occurred while trying to update the module. + * Optional. When set to `true`, the request will be validated (including IAM + * checks), but no module will be updated. An `OK` response indicates that the + * request is valid, while an error response indicates that the request is + * invalid. + * + * If the request is valid, a subsequent request to update the module could + * still fail for one of the following reasons: + * + * * The state of your cloud resources changed; for example, you lost a + * required IAM permission + * * An error occurred during creation of the module + * + * Defaults to `false`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1644,27 +1683,32 @@ export class SecurityCenterManagementClient { } /** * Deletes the specified Event Threat Detection custom module and all of its - * descendants in the Resource Manager hierarchy. This method is only - * supported for resident custom modules. + * descendants in the resource hierarchy. This method is only supported for + * resident custom modules. * * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. The resource name of the ETD custom module. + * Required. The resource name of the Event Threat Detection custom module, in + * one of the following formats: * - * Its format is: - * - * * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. - * * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. - * * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{event_threat_detection_custom_module}`. + * * `organizations/{organization}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` + * * `folders/{folder}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` + * * `projects/{project}/locations/{location}/eventThreatDetectionCustomModules/{custom_module}` * @param {boolean} [request.validateOnly] - * Optional. When set to true, only validations (including IAM checks) will - * done for the request (module will not be deleted). An OK response indicates - * the request is valid while an error response indicates the request is - * invalid. Note that a subsequent request to actually delete the module could - * still fail because 1. the state could have changed (e.g. IAM permission - * lost) or - * 2. A failure occurred while trying to delete the module. + * Optional. When set to `true`, the request will be validated (including IAM + * checks), but no module will be deleted. An `OK` response indicates that the + * request is valid, while an error response indicates that the request is + * invalid. + * + * If the request is valid, a subsequent request to delete the module could + * still fail for one of the following reasons: + * + * * The state of your cloud resources changed; for example, you lost a + * required IAM permission + * * An error occurred during creation of the module + * + * Defaults to `false`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1764,16 +1808,15 @@ export class SecurityCenterManagementClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Resource name of the parent to validate the Custom Module under. + * Required. Resource name of the parent to validate the custom modules under, + * in one of the following formats: * - * Its format is: - * - * * `organizations/{organization}/locations/{location}`. + * * `organizations/{organization}/locations/{location}` * @param {string} request.rawText * Required. The raw text of the module's contents. Used to generate error * messages. * @param {string} request.type - * Required. The type of the module (e.g. CONFIGURABLE_BAD_IP). + * Required. The type of the module. For example, `CONFIGURABLE_BAD_IP`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1873,24 +1916,23 @@ export class SecurityCenterManagementClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. The Security Command Center service to retrieve. + * Required. The Security Command Center service to retrieve, in one of the + * following formats: * - * Formats: + * * organizations/{organization}/locations/{location}/securityCenterServices/{service} + * * folders/{folder}/locations/{location}/securityCenterServices/{service} + * * projects/{project}/locations/{location}/securityCenterServices/{service} * - * * organizations/{organization}/locations/{location}/securityCenterServices/{service} - * * folders/{folder}/locations/{location}/securityCenterServices/{service} - * * projects/{project}/locations/{location}/securityCenterServices/{service} + * The following values are valid for `{service}`: * - * The possible values for id {service} are: - * - * * container-threat-detection - * * event-threat-detection - * * security-health-analytics - * * vm-threat-detection - * * web-security-scanner + * * `container-threat-detection` + * * `event-threat-detection` + * * `security-health-analytics` + * * `vm-threat-detection` + * * `web-security-scanner` * @param {boolean} request.showEligibleModulesOnly - * Flag that, when set, will be used to filter the ModuleSettings that are - * in scope. The default setting is that all modules will be shown. + * Set to `true` to show only modules that are in scope. By default, all + * modules are shown. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1992,18 +2034,26 @@ export class SecurityCenterManagementClient { * @param {google.cloud.securitycentermanagement.v1.SecurityCenterService} request.securityCenterService * Required. The updated service. * @param {google.protobuf.FieldMask} request.updateMask - * Required. The list of fields to be updated. Possible values: + * Required. The fields to update. Accepts the following values: + * + * * `intended_enablement_state` + * * `modules` * - * * "intended_enablement_state" - * * "modules" + * If omitted, then all eligible fields are updated. * @param {boolean} [request.validateOnly] - * Optional. When set to true, only validations (including IAM checks) will be - * done for the request (service will not be updated). An OK response - * indicates that the request is valid, while an error response indicates that - * the request is invalid. Note that a subsequent request to actually update - * the service could still fail for one of the following reasons: - * - The state could have changed (e.g. IAM permission lost). - * - A failure occurred while trying to delete the module. + * Optional. When set to `true`, the request will be validated (including IAM + * checks), but no service will be updated. An `OK` response indicates that + * the request is valid, while an error response indicates that the request is + * invalid. + * + * If the request is valid, a subsequent request to update the service could + * still fail for one of the following reasons: + * + * * The state of your cloud resources changed; for example, you lost a + * required IAM permission + * * An error occurred during update of the service + * + * Defaults to `false`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -2100,25 +2150,30 @@ export class SecurityCenterManagementClient { } /** - * Returns a list of all EffectiveSecurityHealthAnalyticsCustomModules for the - * given parent. This includes resident modules defined at the scope of the - * parent, and inherited modules, inherited from CRM ancestors (no - * descendants). + * Returns a list of all + * {@link protos.google.cloud.securitycentermanagement.v1.EffectiveSecurityHealthAnalyticsCustomModule|EffectiveSecurityHealthAnalyticsCustomModule} + * resources for the given parent. This includes resident modules defined at + * the scope of the parent, and inherited modules, inherited from ancestor + * organizations, folders, and projects (no descendants). * * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of parent to list effective custom modules. specified in one - * of the following formats: + * Required. Name of parent to list effective custom modules, in one of the + * following formats: + * * * `organizations/{organization}/locations/{location}` * * `folders/{folder}/locations/{location}` - * or - * `projects/{project}/locations/{location}` + * * `projects/{project}/locations/{location}` * @param {number} [request.pageSize] * Optional. The maximum number of results to return in a single response. * Default is 10, minimum is 1, maximum is 1000. * @param {string} [request.pageToken] - * Optional. The value returned by the last call indicating a continuation. + * Optional. A pagination token returned from a previous request. Provide this + * token to retrieve the next page of results. + * + * When paginating, the rest of the request must match the request that + * generated the page token. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -2215,17 +2270,21 @@ export class SecurityCenterManagementClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of parent to list effective custom modules. specified in one - * of the following formats: + * Required. Name of parent to list effective custom modules, in one of the + * following formats: + * * * `organizations/{organization}/locations/{location}` * * `folders/{folder}/locations/{location}` - * or - * `projects/{project}/locations/{location}` + * * `projects/{project}/locations/{location}` * @param {number} [request.pageSize] * Optional. The maximum number of results to return in a single response. * Default is 10, minimum is 1, maximum is 1000. * @param {string} [request.pageToken] - * Optional. The value returned by the last call indicating a continuation. + * Optional. A pagination token returned from a previous request. Provide this + * token to retrieve the next page of results. + * + * When paginating, the rest of the request must match the request that + * generated the page token. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -2268,17 +2327,21 @@ export class SecurityCenterManagementClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of parent to list effective custom modules. specified in one - * of the following formats: + * Required. Name of parent to list effective custom modules, in one of the + * following formats: + * * * `organizations/{organization}/locations/{location}` * * `folders/{folder}/locations/{location}` - * or - * `projects/{project}/locations/{location}` + * * `projects/{project}/locations/{location}` * @param {number} [request.pageSize] * Optional. The maximum number of results to return in a single response. * Default is 10, minimum is 1, maximum is 1000. * @param {string} [request.pageToken] - * Optional. The value returned by the last call indicating a continuation. + * Optional. A pagination token returned from a previous request. Provide this + * token to retrieve the next page of results. + * + * When paginating, the rest of the request must match the request that + * generated the page token. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} @@ -2316,15 +2379,17 @@ export class SecurityCenterManagementClient { ) as AsyncIterable; } /** - * Returns a list of all SecurityHealthAnalyticsCustomModules for the given - * parent. This includes resident modules defined at the scope of the parent, - * and inherited modules, inherited from CRM ancestors (no descendants). + * Returns a list of all + * {@link protos.google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule|SecurityHealthAnalyticsCustomModule} + * resources for the given parent. This includes resident modules defined at + * the scope of the parent, and inherited modules, inherited from ancestor + * organizations, folders, and projects (no descendants). * * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of parent organization, folder, or project in which to list - * custom modules, specified in one of the following formats: + * Required. Name of the parent organization, folder, or project in which to + * list custom modules, in one of the following formats: * * * `organizations/{organization}/locations/{location}` * * `folders/{folder}/locations/{location}` @@ -2333,7 +2398,11 @@ export class SecurityCenterManagementClient { * Optional. The maximum number of results to return in a single response. * Default is 10, minimum is 1, maximum is 1000. * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. + * Optional. A pagination token returned from a previous request. Provide this + * token to retrieve the next page of results. + * + * When paginating, the rest of the request must match the request that + * generated the page token. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -2430,8 +2499,8 @@ export class SecurityCenterManagementClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of parent organization, folder, or project in which to list - * custom modules, specified in one of the following formats: + * Required. Name of the parent organization, folder, or project in which to + * list custom modules, in one of the following formats: * * * `organizations/{organization}/locations/{location}` * * `folders/{folder}/locations/{location}` @@ -2440,7 +2509,11 @@ export class SecurityCenterManagementClient { * Optional. The maximum number of results to return in a single response. * Default is 10, minimum is 1, maximum is 1000. * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. + * Optional. A pagination token returned from a previous request. Provide this + * token to retrieve the next page of results. + * + * When paginating, the rest of the request must match the request that + * generated the page token. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -2482,8 +2555,8 @@ export class SecurityCenterManagementClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of parent organization, folder, or project in which to list - * custom modules, specified in one of the following formats: + * Required. Name of the parent organization, folder, or project in which to + * list custom modules, in one of the following formats: * * * `organizations/{organization}/locations/{location}` * * `folders/{folder}/locations/{location}` @@ -2492,7 +2565,11 @@ export class SecurityCenterManagementClient { * Optional. The maximum number of results to return in a single response. * Default is 10, minimum is 1, maximum is 1000. * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. + * Optional. A pagination token returned from a previous request. Provide this + * token to retrieve the next page of results. + * + * When paginating, the rest of the request must match the request that + * generated the page token. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} @@ -2528,14 +2605,16 @@ export class SecurityCenterManagementClient { ) as AsyncIterable; } /** - * Returns a list of all resident SecurityHealthAnalyticsCustomModules under - * the given CRM parent and all of the parent's CRM descendants. + * Returns a list of all resident + * {@link protos.google.cloud.securitycentermanagement.v1.SecurityHealthAnalyticsCustomModule|SecurityHealthAnalyticsCustomModule} + * resources under the given organization, folder, or project and all of its + * descendants. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent * Required. Name of the parent organization, folder, or project in which to - * list custom modules, specified in one of the following formats: + * list custom modules, in one of the following formats: * * * `organizations/{organization}/locations/{location}` * * `folders/{folder}/locations/{location}` @@ -2544,7 +2623,11 @@ export class SecurityCenterManagementClient { * Optional. The maximum number of results to return in a single response. * Default is 10, minimum is 1, maximum is 1000. * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. + * Optional. A pagination token returned from a previous request. Provide this + * token to retrieve the next page of results. + * + * When paginating, the rest of the request must match the request that + * generated the page token. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -2642,7 +2725,7 @@ export class SecurityCenterManagementClient { * The request object that will be sent. * @param {string} request.parent * Required. Name of the parent organization, folder, or project in which to - * list custom modules, specified in one of the following formats: + * list custom modules, in one of the following formats: * * * `organizations/{organization}/locations/{location}` * * `folders/{folder}/locations/{location}` @@ -2651,7 +2734,11 @@ export class SecurityCenterManagementClient { * Optional. The maximum number of results to return in a single response. * Default is 10, minimum is 1, maximum is 1000. * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. + * Optional. A pagination token returned from a previous request. Provide this + * token to retrieve the next page of results. + * + * When paginating, the rest of the request must match the request that + * generated the page token. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -2695,7 +2782,7 @@ export class SecurityCenterManagementClient { * The request object that will be sent. * @param {string} request.parent * Required. Name of the parent organization, folder, or project in which to - * list custom modules, specified in one of the following formats: + * list custom modules, in one of the following formats: * * * `organizations/{organization}/locations/{location}` * * `folders/{folder}/locations/{location}` @@ -2704,7 +2791,11 @@ export class SecurityCenterManagementClient { * Optional. The maximum number of results to return in a single response. * Default is 10, minimum is 1, maximum is 1000. * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. + * Optional. A pagination token returned from a previous request. Provide this + * token to retrieve the next page of results. + * + * When paginating, the rest of the request must match the request that + * generated the page token. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} @@ -2749,16 +2840,21 @@ export class SecurityCenterManagementClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of parent to list effective custom modules. Its format is - * `organizations/{organization}/locations/{location}`, - * `folders/{folder}/locations/{location}`, - * or - * `projects/{project}/locations/{location}` + * Required. Name of parent to list effective custom modules, in one of the + * following formats: + * + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` + * * `projects/{project}/locations/{location}` * @param {number} [request.pageSize] * Optional. The maximum number of results to return in a single response. * Default is 10, minimum is 1, maximum is 1000. * @param {string} [request.pageToken] - * Optional. The value returned by the last call indicating a continuation + * Optional. A pagination token returned from a previous request. Provide this + * token to retrieve the next page of results. + * + * When paginating, the rest of the request must match the request that + * generated the page token. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -2855,16 +2951,21 @@ export class SecurityCenterManagementClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of parent to list effective custom modules. Its format is - * `organizations/{organization}/locations/{location}`, - * `folders/{folder}/locations/{location}`, - * or - * `projects/{project}/locations/{location}` + * Required. Name of parent to list effective custom modules, in one of the + * following formats: + * + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` + * * `projects/{project}/locations/{location}` * @param {number} [request.pageSize] * Optional. The maximum number of results to return in a single response. * Default is 10, minimum is 1, maximum is 1000. * @param {string} [request.pageToken] - * Optional. The value returned by the last call indicating a continuation + * Optional. A pagination token returned from a previous request. Provide this + * token to retrieve the next page of results. + * + * When paginating, the rest of the request must match the request that + * generated the page token. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -2907,16 +3008,21 @@ export class SecurityCenterManagementClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of parent to list effective custom modules. Its format is - * `organizations/{organization}/locations/{location}`, - * `folders/{folder}/locations/{location}`, - * or - * `projects/{project}/locations/{location}` + * Required. Name of parent to list effective custom modules, in one of the + * following formats: + * + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` + * * `projects/{project}/locations/{location}` * @param {number} [request.pageSize] * Optional. The maximum number of results to return in a single response. * Default is 10, minimum is 1, maximum is 1000. * @param {string} [request.pageToken] - * Optional. The value returned by the last call indicating a continuation + * Optional. A pagination token returned from a previous request. Provide this + * token to retrieve the next page of results. + * + * When paginating, the rest of the request must match the request that + * generated the page token. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} @@ -2954,30 +3060,29 @@ export class SecurityCenterManagementClient { ) as AsyncIterable; } /** - * Lists all Event Threat Detection custom modules for the given - * Resource Manager parent. This includes resident modules defined at the - * scope of the parent along with modules inherited from ancestors. + * Lists all Event Threat Detection custom modules for the given organization, + * folder, or project. This includes resident modules defined at the scope of + * the parent along with modules inherited from ancestors. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of parent to list custom modules. Its format is - * `organizations/{organization}/locations/{location}`, - * `folders/{folder}/locations/{location}`, - * or - * `projects/{project}/locations/{location}` + * Required. Name of parent to list custom modules, in one of the following + * formats: + * + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` + * * `projects/{project}/locations/{location}` * @param {number} [request.pageSize] * Optional. The maximum number of modules to return. The service may return - * fewer than this value. If unspecified, at most 10 configs will be returned. + * fewer than this value. If unspecified, at most 10 modules will be returned. * The maximum value is 1000; values above 1000 will be coerced to 1000. * @param {string} [request.pageToken] - * Optional. A page token, received from a previous - * `ListEventThreatDetectionCustomModules` call. Provide this to retrieve the - * subsequent page. + * Optional. A pagination token returned from a previous request. Provide this + * token to retrieve the next page of results. * - * When paginating, all other parameters provided to - * `ListEventThreatDetectionCustomModules` must match the call that provided - * the page token. + * When paginating, the rest of the request must match the request that + * generated the page token. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -3074,23 +3179,22 @@ export class SecurityCenterManagementClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of parent to list custom modules. Its format is - * `organizations/{organization}/locations/{location}`, - * `folders/{folder}/locations/{location}`, - * or - * `projects/{project}/locations/{location}` + * Required. Name of parent to list custom modules, in one of the following + * formats: + * + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` + * * `projects/{project}/locations/{location}` * @param {number} [request.pageSize] * Optional. The maximum number of modules to return. The service may return - * fewer than this value. If unspecified, at most 10 configs will be returned. + * fewer than this value. If unspecified, at most 10 modules will be returned. * The maximum value is 1000; values above 1000 will be coerced to 1000. * @param {string} [request.pageToken] - * Optional. A page token, received from a previous - * `ListEventThreatDetectionCustomModules` call. Provide this to retrieve the - * subsequent page. + * Optional. A pagination token returned from a previous request. Provide this + * token to retrieve the next page of results. * - * When paginating, all other parameters provided to - * `ListEventThreatDetectionCustomModules` must match the call that provided - * the page token. + * When paginating, the rest of the request must match the request that + * generated the page token. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -3132,23 +3236,22 @@ export class SecurityCenterManagementClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of parent to list custom modules. Its format is - * `organizations/{organization}/locations/{location}`, - * `folders/{folder}/locations/{location}`, - * or - * `projects/{project}/locations/{location}` + * Required. Name of parent to list custom modules, in one of the following + * formats: + * + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` + * * `projects/{project}/locations/{location}` * @param {number} [request.pageSize] * Optional. The maximum number of modules to return. The service may return - * fewer than this value. If unspecified, at most 10 configs will be returned. + * fewer than this value. If unspecified, at most 10 modules will be returned. * The maximum value is 1000; values above 1000 will be coerced to 1000. * @param {string} [request.pageToken] - * Optional. A page token, received from a previous - * `ListEventThreatDetectionCustomModules` call. Provide this to retrieve the - * subsequent page. + * Optional. A pagination token returned from a previous request. Provide this + * token to retrieve the next page of results. * - * When paginating, all other parameters provided to - * `ListEventThreatDetectionCustomModules` must match the call that provided - * the page token. + * When paginating, the rest of the request must match the request that + * generated the page token. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} @@ -3184,23 +3287,28 @@ export class SecurityCenterManagementClient { ) as AsyncIterable; } /** - * Lists all resident Event Threat Detection custom modules under the - * given Resource Manager parent and its descendants. + * Lists all resident Event Threat Detection custom modules for the given + * organization, folder, or project and its descendants. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of parent to list custom modules. Its format is - * `organizations/{organization}/locations/{location}`, - * `folders/{folder}/locations/{location}`, - * or - * `projects/{project}/locations/{location}` + * Required. Name of parent to list custom modules, in one of the following + * formats: + * + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` + * * `projects/{project}/locations/{location}` * @param {number} [request.pageSize] * Optional. The maximum number of modules to return. The service may return * fewer than this value. If unspecified, at most 10 configs will be returned. * The maximum value is 1000; values above 1000 will be coerced to 1000. * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. + * Optional. A pagination token returned from a previous request. Provide this + * token to retrieve the next page of results. + * + * When paginating, the rest of the request must match the request that + * generated the page token. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -3297,17 +3405,22 @@ export class SecurityCenterManagementClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of parent to list custom modules. Its format is - * `organizations/{organization}/locations/{location}`, - * `folders/{folder}/locations/{location}`, - * or - * `projects/{project}/locations/{location}` + * Required. Name of parent to list custom modules, in one of the following + * formats: + * + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` + * * `projects/{project}/locations/{location}` * @param {number} [request.pageSize] * Optional. The maximum number of modules to return. The service may return * fewer than this value. If unspecified, at most 10 configs will be returned. * The maximum value is 1000; values above 1000 will be coerced to 1000. * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. + * Optional. A pagination token returned from a previous request. Provide this + * token to retrieve the next page of results. + * + * When paginating, the rest of the request must match the request that + * generated the page token. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -3350,17 +3463,22 @@ export class SecurityCenterManagementClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. Name of parent to list custom modules. Its format is - * `organizations/{organization}/locations/{location}`, - * `folders/{folder}/locations/{location}`, - * or - * `projects/{project}/locations/{location}` + * Required. Name of parent to list custom modules, in one of the following + * formats: + * + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` + * * `projects/{project}/locations/{location}` * @param {number} [request.pageSize] * Optional. The maximum number of modules to return. The service may return * fewer than this value. If unspecified, at most 10 configs will be returned. * The maximum value is 1000; values above 1000 will be coerced to 1000. * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. + * Optional. A pagination token returned from a previous request. Provide this + * token to retrieve the next page of results. + * + * When paginating, the rest of the request must match the request that + * generated the page token. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object} @@ -3404,21 +3522,24 @@ export class SecurityCenterManagementClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The name of the parent to list Security Command Center services. + * Required. The name of the parent to list Security Command Center services, + * in one of the following formats: * - * Formats: - * - * * organizations/{organization}/locations/{location} - * * folders/{folder}/locations/{location} - * * projects/{project}/locations/{location} + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` + * * `projects/{project}/locations/{location}` * @param {number} [request.pageSize] * Optional. The maximum number of results to return in a single response. * Default is 10, minimum is 1, maximum is 1000. * @param {string} [request.pageToken] - * Optional. The value returned by the last call indicating a continuation. + * Optional. A pagination token returned from a previous request. Provide this + * token to retrieve the next page of results. + * + * When paginating, the rest of the request must match the request that + * generated the page token. * @param {boolean} request.showEligibleModulesOnly - * Flag that, when set, will be used to filter the ModuleSettings that are - * in scope. The default setting is that all modules will be shown. + * Flag that, when set, is used to filter the module settings that are shown. + * The default setting is that all modules are shown. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -3515,21 +3636,24 @@ export class SecurityCenterManagementClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The name of the parent to list Security Command Center services. - * - * Formats: + * Required. The name of the parent to list Security Command Center services, + * in one of the following formats: * - * * organizations/{organization}/locations/{location} - * * folders/{folder}/locations/{location} - * * projects/{project}/locations/{location} + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` + * * `projects/{project}/locations/{location}` * @param {number} [request.pageSize] * Optional. The maximum number of results to return in a single response. * Default is 10, minimum is 1, maximum is 1000. * @param {string} [request.pageToken] - * Optional. The value returned by the last call indicating a continuation. + * Optional. A pagination token returned from a previous request. Provide this + * token to retrieve the next page of results. + * + * When paginating, the rest of the request must match the request that + * generated the page token. * @param {boolean} request.showEligibleModulesOnly - * Flag that, when set, will be used to filter the ModuleSettings that are - * in scope. The default setting is that all modules will be shown. + * Flag that, when set, is used to filter the module settings that are shown. + * The default setting is that all modules are shown. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} @@ -3570,21 +3694,24 @@ export class SecurityCenterManagementClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The name of the parent to list Security Command Center services. + * Required. The name of the parent to list Security Command Center services, + * in one of the following formats: * - * Formats: - * - * * organizations/{organization}/locations/{location} - * * folders/{folder}/locations/{location} - * * projects/{project}/locations/{location} + * * `organizations/{organization}/locations/{location}` + * * `folders/{folder}/locations/{location}` + * * `projects/{project}/locations/{location}` * @param {number} [request.pageSize] * Optional. The maximum number of results to return in a single response. * Default is 10, minimum is 1, maximum is 1000. * @param {string} [request.pageToken] - * Optional. The value returned by the last call indicating a continuation. + * Optional. A pagination token returned from a previous request. Provide this + * token to retrieve the next page of results. + * + * When paginating, the rest of the request must match the request that + * generated the page token. * @param {boolean} request.showEligibleModulesOnly - * Flag that, when set, will be used to filter the ModuleSettings that are - * in scope. The default setting is that all modules will be shown. + * Flag that, when set, is used to filter the module settings that are shown. + * The default setting is that all modules are shown. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Object}