From 4e91b3fb040630c44d4765bab7afd24a07a2696e Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 8 Feb 2022 09:30:36 -0800 Subject: [PATCH] feat: Add LocationMetadata message feat: Add RoutingVPC.required_for_new_site_to_site_data_transfer_spokes field docs: Update comments to reflect that spokes can now be created with data transfer disabled (#114) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Add LocationMetadata message feat: Add RoutingVPC.required_for_new_site_to_site_data_transfer_spokes field docs: Update comments to reflect that spokes can now be created with data transfer disabled PiperOrigin-RevId: 426937195 Source-Link: https://github.com/googleapis/googleapis/commit/cb96586f13ab0090fb8ddfc090995620630985ed Source-Link: https://github.com/googleapis/googleapis-gen/commit/b535b726895d2ec51e43be48ef22b01b6e1d4d4f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjUzNWI3MjY4OTVkMmVjNTFlNDNiZTQ4ZWYyMmIwMWI2ZTFkNGQ0ZiJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../cloud/networkconnectivity/v1/common.proto | 4 +- .../cloud/networkconnectivity/v1/hub.proto | 92 +++-- .../protos/protos.d.ts | 143 ++++++- .../protos/protos.js | 360 +++++++++++++++--- .../protos/protos.json | 75 ++-- 5 files changed, 548 insertions(+), 126 deletions(-) diff --git a/packages/google-cloud-networkconnectivity/protos/google/cloud/networkconnectivity/v1/common.proto b/packages/google-cloud-networkconnectivity/protos/google/cloud/networkconnectivity/v1/common.proto index 2d999b7ef11..ed96c8ea255 100644 --- a/packages/google-cloud-networkconnectivity/protos/google/cloud/networkconnectivity/v1/common.proto +++ b/packages/google-cloud-networkconnectivity/protos/google/cloud/networkconnectivity/v1/common.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,9 +16,9 @@ syntax = "proto3"; package google.cloud.networkconnectivity.v1; +import "google/api/annotations.proto"; import "google/api/field_behavior.proto"; import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; option csharp_namespace = "Google.Cloud.NetworkConnectivity.V1"; option go_package = "google.golang.org/genproto/googleapis/cloud/networkconnectivity/v1;networkconnectivity"; diff --git a/packages/google-cloud-networkconnectivity/protos/google/cloud/networkconnectivity/v1/hub.proto b/packages/google-cloud-networkconnectivity/protos/google/cloud/networkconnectivity/v1/hub.proto index 7fa768035eb..c28ca9a0770 100644 --- a/packages/google-cloud-networkconnectivity/protos/google/cloud/networkconnectivity/v1/hub.proto +++ b/packages/google-cloud-networkconnectivity/protos/google/cloud/networkconnectivity/v1/hub.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -164,9 +164,39 @@ service HubService { } } +// The State enum represents the lifecycle stage of a Network Connectivity +// Center resource. +enum State { + // No state information available + STATE_UNSPECIFIED = 0; + + // The resource's create operation is in progress + CREATING = 1; + + // The resource is active + ACTIVE = 2; + + // The resource's Delete operation is in progress + DELETING = 3; +} + +// Supported features for a location +enum LocationFeature { + // No publicly supported feature in this location + LOCATION_FEATURE_UNSPECIFIED = 0; + + // Site-to-cloud spokes are supported in this location + SITE_TO_CLOUD_SPOKES = 1; + + // Site-to-site spokes are supported in this location + SITE_TO_SITE_SPOKES = 2; +} + // A hub is a collection of spokes. A single hub can contain spokes from -// multiple regions. However, all of a hub's spokes must be associated with -// resources that reside in the same VPC network. +// multiple regions. However, if any of a hub's spokes use the data transfer +// feature, the resources associated with those spokes must all reside in the +// same VPC network. Spokes that do not use data transfer can be associated +// with any VPC network in your project. message Hub { option (google.api.resource) = { type: "networkconnectivity.googleapis.com/Hub" @@ -200,38 +230,27 @@ message Hub { // Output only. The current lifecycle state of this hub. State state = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - // The VPC network associated with this hub's spokes. All of the VPN tunnels, - // VLAN attachments, and router appliance instances referenced by this hub's - // spokes must belong to this VPC network. + // The VPC networks associated with this hub's spokes. // // This field is read-only. Network Connectivity Center automatically // populates it based on the set of spokes attached to the hub. repeated RoutingVPC routing_vpcs = 10; } -// The State enum represents the lifecycle stage of a Network Connectivity -// Center resource. -enum State { - // No state information available - STATE_UNSPECIFIED = 0; - - // The resource's create operation is in progress - CREATING = 1; - - // The resource is active - ACTIVE = 2; - - // The resource's Delete operation is in progress - DELETING = 3; -} - -// RoutingVPC contains information about the VPC network that is associated with -// a hub's spokes. +// RoutingVPC contains information about the VPC networks that are associated +// with a hub's spokes. message RoutingVPC { // The URI of the VPC network. string uri = 1 [(google.api.resource_reference) = { type: "compute.googleapis.com/Network" }]; + + // Output only. If true, indicates that this VPC network is currently associated with + // spokes that use the data transfer feature (spokes where the + // site_to_site_data_transfer field is set to true). If you create new spokes + // that use data transfer, they must be associated with this VPC network. At + // most, one VPC network will have this field set to true. + bool required_for_new_site_to_site_data_transfer_spokes = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; } // A spoke represents a connection between your Google Cloud network resources @@ -577,8 +596,8 @@ message LinkedVpnTunnels { }]; // A value that controls whether site-to-site data transfer is enabled for - // these resources. This field is set to false by default, but you must set it - // to true. Note that data transfer is available only in supported locations. + // these resources. Data transfer is available only in [supported + // locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations). bool site_to_site_data_transfer = 2; } @@ -593,21 +612,22 @@ message LinkedInterconnectAttachments { }]; // A value that controls whether site-to-site data transfer is enabled for - // these resources. This field is set to false by default, but you must set it - // to true. Note that data transfer is available only in supported locations. + // these resources. Data transfer is available only in [supported + // locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations). bool site_to_site_data_transfer = 2; } -// A collection of router appliance instances. If you have multiple router -// appliance instances connected to the same site, they should all be attached -// to the same spoke. +// A collection of router appliance instances. If you configure multiple router +// appliance instances to receive data from the same set of sites outside of +// Google Cloud, we recommend that you associate those instances with the same +// spoke. message LinkedRouterApplianceInstances { // The list of router appliance instances. repeated RouterApplianceInstance instances = 1; // A value that controls whether site-to-site data transfer is enabled for - // these resources. This field is set to false by default, but you must set it - // to true. Note that data transfer is available only in supported locations. + // these resources. Data transfer is available only in [supported + // locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations). bool site_to_site_data_transfer = 2; } @@ -624,3 +644,9 @@ message RouterApplianceInstance { // The IP address on the VM to use for peering. string ip_address = 3; } + +// Metadata about locations +message LocationMetadata { + // List of supported features + repeated LocationFeature location_features = 1; +} diff --git a/packages/google-cloud-networkconnectivity/protos/protos.d.ts b/packages/google-cloud-networkconnectivity/protos/protos.d.ts index 1d2edc3e517..29a8ed34ae1 100644 --- a/packages/google-cloud-networkconnectivity/protos/protos.d.ts +++ b/packages/google-cloud-networkconnectivity/protos/protos.d.ts @@ -386,6 +386,21 @@ export namespace google { type DeleteSpokeCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; } + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + ACTIVE = 2, + DELETING = 3 + } + + /** LocationFeature enum. */ + enum LocationFeature { + LOCATION_FEATURE_UNSPECIFIED = 0, + SITE_TO_CLOUD_SPOKES = 1, + SITE_TO_SITE_SPOKES = 2 + } + /** Properties of a Hub. */ interface IHub { @@ -518,19 +533,14 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - CREATING = 1, - ACTIVE = 2, - DELETING = 3 - } - /** Properties of a RoutingVPC. */ interface IRoutingVPC { /** RoutingVPC uri */ uri?: (string|null); + + /** RoutingVPC requiredForNewSiteToSiteDataTransferSpokes */ + requiredForNewSiteToSiteDataTransferSpokes?: (boolean|null); } /** Represents a RoutingVPC. */ @@ -545,6 +555,9 @@ export namespace google { /** RoutingVPC uri. */ public uri: string; + /** RoutingVPC requiredForNewSiteToSiteDataTransferSpokes. */ + public requiredForNewSiteToSiteDataTransferSpokes: boolean; + /** * Creates a new RoutingVPC instance using the specified properties. * @param [properties] Properties to set @@ -2373,6 +2386,96 @@ export namespace google { */ public toJSON(): { [k: string]: any }; } + + /** Properties of a LocationMetadata. */ + interface ILocationMetadata { + + /** LocationMetadata locationFeatures */ + locationFeatures?: (google.cloud.networkconnectivity.v1.LocationFeature[]|null); + } + + /** Represents a LocationMetadata. */ + class LocationMetadata implements ILocationMetadata { + + /** + * Constructs a new LocationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkconnectivity.v1.ILocationMetadata); + + /** LocationMetadata locationFeatures. */ + public locationFeatures: google.cloud.networkconnectivity.v1.LocationFeature[]; + + /** + * Creates a new LocationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns LocationMetadata instance + */ + public static create(properties?: google.cloud.networkconnectivity.v1.ILocationMetadata): google.cloud.networkconnectivity.v1.LocationMetadata; + + /** + * Encodes the specified LocationMetadata message. Does not implicitly {@link google.cloud.networkconnectivity.v1.LocationMetadata.verify|verify} messages. + * @param message LocationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkconnectivity.v1.ILocationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LocationMetadata message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.LocationMetadata.verify|verify} messages. + * @param message LocationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.ILocationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LocationMetadata + * @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.networkconnectivity.v1.LocationMetadata; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LocationMetadata + * @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.networkconnectivity.v1.LocationMetadata; + + /** + * Verifies a LocationMetadata 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 LocationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LocationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.LocationMetadata; + + /** + * Creates a plain object from a LocationMetadata message. Also converts values to other types if specified. + * @param message LocationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkconnectivity.v1.LocationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LocationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } /** Namespace v1alpha1. */ @@ -4360,18 +4463,6 @@ 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 - } - /** Properties of a Http. */ interface IHttp { @@ -4711,6 +4802,18 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** 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 + } + /** Properties of a ResourceDescriptor. */ interface IResourceDescriptor { diff --git a/packages/google-cloud-networkconnectivity/protos/protos.js b/packages/google-cloud-networkconnectivity/protos/protos.js index f2e2e9dbf29..b3efdd99618 100644 --- a/packages/google-cloud-networkconnectivity/protos/protos.js +++ b/packages/google-cloud-networkconnectivity/protos/protos.js @@ -761,6 +761,40 @@ return HubService; })(); + /** + * State enum. + * @name google.cloud.networkconnectivity.v1.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} DELETING=3 DELETING value + */ + v1.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[3] = "DELETING"] = 3; + return values; + })(); + + /** + * LocationFeature enum. + * @name google.cloud.networkconnectivity.v1.LocationFeature + * @enum {number} + * @property {number} LOCATION_FEATURE_UNSPECIFIED=0 LOCATION_FEATURE_UNSPECIFIED value + * @property {number} SITE_TO_CLOUD_SPOKES=1 SITE_TO_CLOUD_SPOKES value + * @property {number} SITE_TO_SITE_SPOKES=2 SITE_TO_SITE_SPOKES value + */ + v1.LocationFeature = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOCATION_FEATURE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SITE_TO_CLOUD_SPOKES"] = 1; + values[valuesById[2] = "SITE_TO_SITE_SPOKES"] = 2; + return values; + })(); + v1.Hub = (function() { /** @@ -1194,24 +1228,6 @@ return Hub; })(); - /** - * State enum. - * @name google.cloud.networkconnectivity.v1.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} CREATING=1 CREATING value - * @property {number} ACTIVE=2 ACTIVE value - * @property {number} DELETING=3 DELETING value - */ - v1.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CREATING"] = 1; - values[valuesById[2] = "ACTIVE"] = 2; - values[valuesById[3] = "DELETING"] = 3; - return values; - })(); - v1.RoutingVPC = (function() { /** @@ -1219,6 +1235,7 @@ * @memberof google.cloud.networkconnectivity.v1 * @interface IRoutingVPC * @property {string|null} [uri] RoutingVPC uri + * @property {boolean|null} [requiredForNewSiteToSiteDataTransferSpokes] RoutingVPC requiredForNewSiteToSiteDataTransferSpokes */ /** @@ -1244,6 +1261,14 @@ */ RoutingVPC.prototype.uri = ""; + /** + * RoutingVPC requiredForNewSiteToSiteDataTransferSpokes. + * @member {boolean} requiredForNewSiteToSiteDataTransferSpokes + * @memberof google.cloud.networkconnectivity.v1.RoutingVPC + * @instance + */ + RoutingVPC.prototype.requiredForNewSiteToSiteDataTransferSpokes = false; + /** * Creates a new RoutingVPC instance using the specified properties. * @function create @@ -1270,6 +1295,8 @@ writer = $Writer.create(); if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.requiredForNewSiteToSiteDataTransferSpokes != null && Object.hasOwnProperty.call(message, "requiredForNewSiteToSiteDataTransferSpokes")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.requiredForNewSiteToSiteDataTransferSpokes); return writer; }; @@ -1307,6 +1334,9 @@ case 1: message.uri = reader.string(); break; + case 2: + message.requiredForNewSiteToSiteDataTransferSpokes = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -1345,6 +1375,9 @@ if (message.uri != null && message.hasOwnProperty("uri")) if (!$util.isString(message.uri)) return "uri: string expected"; + if (message.requiredForNewSiteToSiteDataTransferSpokes != null && message.hasOwnProperty("requiredForNewSiteToSiteDataTransferSpokes")) + if (typeof message.requiredForNewSiteToSiteDataTransferSpokes !== "boolean") + return "requiredForNewSiteToSiteDataTransferSpokes: boolean expected"; return null; }; @@ -1362,6 +1395,8 @@ var message = new $root.google.cloud.networkconnectivity.v1.RoutingVPC(); if (object.uri != null) message.uri = String(object.uri); + if (object.requiredForNewSiteToSiteDataTransferSpokes != null) + message.requiredForNewSiteToSiteDataTransferSpokes = Boolean(object.requiredForNewSiteToSiteDataTransferSpokes); return message; }; @@ -1378,10 +1413,14 @@ if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.uri = ""; + object.requiredForNewSiteToSiteDataTransferSpokes = false; + } if (message.uri != null && message.hasOwnProperty("uri")) object.uri = message.uri; + if (message.requiredForNewSiteToSiteDataTransferSpokes != null && message.hasOwnProperty("requiredForNewSiteToSiteDataTransferSpokes")) + object.requiredForNewSiteToSiteDataTransferSpokes = message.requiredForNewSiteToSiteDataTransferSpokes; return object; }; @@ -5672,6 +5711,237 @@ return RouterApplianceInstance; })(); + v1.LocationMetadata = (function() { + + /** + * Properties of a LocationMetadata. + * @memberof google.cloud.networkconnectivity.v1 + * @interface ILocationMetadata + * @property {Array.|null} [locationFeatures] LocationMetadata locationFeatures + */ + + /** + * Constructs a new LocationMetadata. + * @memberof google.cloud.networkconnectivity.v1 + * @classdesc Represents a LocationMetadata. + * @implements ILocationMetadata + * @constructor + * @param {google.cloud.networkconnectivity.v1.ILocationMetadata=} [properties] Properties to set + */ + function LocationMetadata(properties) { + this.locationFeatures = []; + 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]]; + } + + /** + * LocationMetadata locationFeatures. + * @member {Array.} locationFeatures + * @memberof google.cloud.networkconnectivity.v1.LocationMetadata + * @instance + */ + LocationMetadata.prototype.locationFeatures = $util.emptyArray; + + /** + * Creates a new LocationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.LocationMetadata + * @static + * @param {google.cloud.networkconnectivity.v1.ILocationMetadata=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.LocationMetadata} LocationMetadata instance + */ + LocationMetadata.create = function create(properties) { + return new LocationMetadata(properties); + }; + + /** + * Encodes the specified LocationMetadata message. Does not implicitly {@link google.cloud.networkconnectivity.v1.LocationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkconnectivity.v1.LocationMetadata + * @static + * @param {google.cloud.networkconnectivity.v1.ILocationMetadata} message LocationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.locationFeatures != null && message.locationFeatures.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.locationFeatures.length; ++i) + writer.int32(message.locationFeatures[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified LocationMetadata message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.LocationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkconnectivity.v1.LocationMetadata + * @static + * @param {google.cloud.networkconnectivity.v1.ILocationMetadata} message LocationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LocationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkconnectivity.v1.LocationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.networkconnectivity.v1.LocationMetadata} LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationMetadata.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.networkconnectivity.v1.LocationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.locationFeatures && message.locationFeatures.length)) + message.locationFeatures = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.locationFeatures.push(reader.int32()); + } else + message.locationFeatures.push(reader.int32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LocationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.LocationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.LocationMetadata} LocationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LocationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LocationMetadata message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.LocationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LocationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.locationFeatures != null && message.hasOwnProperty("locationFeatures")) { + if (!Array.isArray(message.locationFeatures)) + return "locationFeatures: array expected"; + for (var i = 0; i < message.locationFeatures.length; ++i) + switch (message.locationFeatures[i]) { + default: + return "locationFeatures: enum value[] expected"; + case 0: + case 1: + case 2: + break; + } + } + return null; + }; + + /** + * Creates a LocationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.LocationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.LocationMetadata} LocationMetadata + */ + LocationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.LocationMetadata) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.LocationMetadata(); + if (object.locationFeatures) { + if (!Array.isArray(object.locationFeatures)) + throw TypeError(".google.cloud.networkconnectivity.v1.LocationMetadata.locationFeatures: array expected"); + message.locationFeatures = []; + for (var i = 0; i < object.locationFeatures.length; ++i) + switch (object.locationFeatures[i]) { + default: + case "LOCATION_FEATURE_UNSPECIFIED": + case 0: + message.locationFeatures[i] = 0; + break; + case "SITE_TO_CLOUD_SPOKES": + case 1: + message.locationFeatures[i] = 1; + break; + case "SITE_TO_SITE_SPOKES": + case 2: + message.locationFeatures[i] = 2; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a LocationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.LocationMetadata + * @static + * @param {google.cloud.networkconnectivity.v1.LocationMetadata} message LocationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LocationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.locationFeatures = []; + if (message.locationFeatures && message.locationFeatures.length) { + object.locationFeatures = []; + for (var j = 0; j < message.locationFeatures.length; ++j) + object.locationFeatures[j] = options.enums === String ? $root.google.cloud.networkconnectivity.v1.LocationFeature[message.locationFeatures[j]] : message.locationFeatures[j]; + } + return object; + }; + + /** + * Converts this LocationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.LocationMetadata + * @instance + * @returns {Object.} JSON object + */ + LocationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LocationMetadata; + })(); + return v1; })(); @@ -10495,32 +10765,6 @@ */ 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 - */ - 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; - return values; - })(); - api.Http = (function() { /** @@ -11425,6 +11669,32 @@ return CustomHttpPattern; })(); + /** + * 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 + */ + 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; + return values; + })(); + api.ResourceDescriptor = (function() { /** diff --git a/packages/google-cloud-networkconnectivity/protos/protos.json b/packages/google-cloud-networkconnectivity/protos/protos.json index ab23b6deb24..bc2b742ab97 100644 --- a/packages/google-cloud-networkconnectivity/protos/protos.json +++ b/packages/google-cloud-networkconnectivity/protos/protos.json @@ -316,6 +316,21 @@ } } }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "ACTIVE": 2, + "DELETING": 3 + } + }, + "LocationFeature": { + "values": { + "LOCATION_FEATURE_UNSPECIFIED": 0, + "SITE_TO_CLOUD_SPOKES": 1, + "SITE_TO_SITE_SPOKES": 2 + } + }, "Hub": { "options": { "(google.api.resource).type": "networkconnectivity.googleapis.com/Hub", @@ -373,14 +388,6 @@ } } }, - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "CREATING": 1, - "ACTIVE": 2, - "DELETING": 3 - } - }, "RoutingVPC": { "fields": { "uri": { @@ -389,6 +396,13 @@ "options": { "(google.api.resource_reference).type": "compute.googleapis.com/Network" } + }, + "requiredForNewSiteToSiteDataTransferSpokes": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, @@ -793,6 +807,15 @@ "id": 3 } } + }, + "LocationMetadata": { + "fields": { + "locationFeatures": { + "rule": "repeated", + "type": "LocationFeature", + "id": 1 + } + } } } }, @@ -1551,24 +1574,6 @@ "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 - } - }, "http": { "type": "HttpRule", "id": 72295728, @@ -1656,6 +1661,24 @@ } } }, + "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 + } + }, "methodSignature": { "rule": "repeated", "type": "string",