diff --git a/packages/google-cloud-networkconnectivity/README.md b/packages/google-cloud-networkconnectivity/README.md index 503bbe68eee..f5b51beda18 100644 --- a/packages/google-cloud-networkconnectivity/README.md +++ b/packages/google-cloud-networkconnectivity/README.md @@ -88,14 +88,23 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | +| Hub_service.accept_hub_spoke | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.accept_hub_spoke.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-networkconnectivity/samples/generated/v1/hub_service.accept_hub_spoke.js,packages/google-cloud-networkconnectivity/samples/README.md) | | Hub_service.create_hub | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.create_hub.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-networkconnectivity/samples/generated/v1/hub_service.create_hub.js,packages/google-cloud-networkconnectivity/samples/README.md) | | Hub_service.create_spoke | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.create_spoke.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-networkconnectivity/samples/generated/v1/hub_service.create_spoke.js,packages/google-cloud-networkconnectivity/samples/README.md) | | Hub_service.delete_hub | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.delete_hub.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-networkconnectivity/samples/generated/v1/hub_service.delete_hub.js,packages/google-cloud-networkconnectivity/samples/README.md) | | Hub_service.delete_spoke | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.delete_spoke.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-networkconnectivity/samples/generated/v1/hub_service.delete_spoke.js,packages/google-cloud-networkconnectivity/samples/README.md) | +| Hub_service.get_group | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.get_group.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-networkconnectivity/samples/generated/v1/hub_service.get_group.js,packages/google-cloud-networkconnectivity/samples/README.md) | | Hub_service.get_hub | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.get_hub.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-networkconnectivity/samples/generated/v1/hub_service.get_hub.js,packages/google-cloud-networkconnectivity/samples/README.md) | +| Hub_service.get_route | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.get_route.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-networkconnectivity/samples/generated/v1/hub_service.get_route.js,packages/google-cloud-networkconnectivity/samples/README.md) | +| Hub_service.get_route_table | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.get_route_table.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-networkconnectivity/samples/generated/v1/hub_service.get_route_table.js,packages/google-cloud-networkconnectivity/samples/README.md) | | Hub_service.get_spoke | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.get_spoke.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-networkconnectivity/samples/generated/v1/hub_service.get_spoke.js,packages/google-cloud-networkconnectivity/samples/README.md) | +| Hub_service.list_groups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_groups.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-networkconnectivity/samples/generated/v1/hub_service.list_groups.js,packages/google-cloud-networkconnectivity/samples/README.md) | +| Hub_service.list_hub_spokes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_hub_spokes.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-networkconnectivity/samples/generated/v1/hub_service.list_hub_spokes.js,packages/google-cloud-networkconnectivity/samples/README.md) | | Hub_service.list_hubs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_hubs.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-networkconnectivity/samples/generated/v1/hub_service.list_hubs.js,packages/google-cloud-networkconnectivity/samples/README.md) | +| Hub_service.list_route_tables | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_route_tables.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-networkconnectivity/samples/generated/v1/hub_service.list_route_tables.js,packages/google-cloud-networkconnectivity/samples/README.md) | +| Hub_service.list_routes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_routes.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-networkconnectivity/samples/generated/v1/hub_service.list_routes.js,packages/google-cloud-networkconnectivity/samples/README.md) | | Hub_service.list_spokes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_spokes.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-networkconnectivity/samples/generated/v1/hub_service.list_spokes.js,packages/google-cloud-networkconnectivity/samples/README.md) | +| Hub_service.reject_hub_spoke | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.reject_hub_spoke.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-networkconnectivity/samples/generated/v1/hub_service.reject_hub_spoke.js,packages/google-cloud-networkconnectivity/samples/README.md) | | Hub_service.update_hub | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.update_hub.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-networkconnectivity/samples/generated/v1/hub_service.update_hub.js,packages/google-cloud-networkconnectivity/samples/README.md) | | Hub_service.update_spoke | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.update_spoke.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-networkconnectivity/samples/generated/v1/hub_service.update_spoke.js,packages/google-cloud-networkconnectivity/samples/README.md) | | Policy_based_routing_service.create_policy_based_route | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkconnectivity/samples/generated/v1/policy_based_routing_service.create_policy_based_route.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-networkconnectivity/samples/generated/v1/policy_based_routing_service.create_policy_based_route.js,packages/google-cloud-networkconnectivity/samples/README.md) | 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 89253048935..12efca7b37e 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 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -39,10 +39,12 @@ option (google.api.resource_definition) = { // Represents the metadata of the long-running operation. message OperationMetadata { // Output only. The time the operation was created. - google.protobuf.Timestamp create_time = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The time the operation finished running. - google.protobuf.Timestamp end_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Server-defined resource path for the target of the operation. string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -55,8 +57,9 @@ message OperationMetadata { // Output only. Identifies whether the user has requested cancellation // of the operation. Operations that have been cancelled successfully - // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - // corresponding to `Code.CANCELLED`. + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. API version used to start the operation. 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 eef97978f3d..3ea7e85c250 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 2022 Google LLC +// Copyright 2023 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,7 +20,9 @@ import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/cloud/networkconnectivity/v1/common.proto"; import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; @@ -103,6 +105,16 @@ service HubService { }; } + // Lists the Network Connectivity Center spokes associated with a + // specified hub and location. The list includes both spokes that are attached + // to the hub and spokes that have been proposed but not yet accepted. + rpc ListHubSpokes(ListHubSpokesRequest) returns (ListHubSpokesResponse) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/global/hubs/*}:listSpokes" + }; + option (google.api.method_signature) = "name"; + } + // Lists the Network Connectivity Center spokes in a specified project and // location. rpc ListSpokes(ListSpokesRequest) returns (ListSpokesResponse) { @@ -146,6 +158,38 @@ service HubService { }; } + // Rejects a Network Connectivity Center spoke from being attached to a hub. + // If the spoke was previously in the `ACTIVE` state, it + // transitions to the `INACTIVE` state and is no longer able to + // connect to other spokes that are attached to the hub. + rpc RejectHubSpoke(RejectHubSpokeRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/global/hubs/*}:rejectSpoke" + body: "*" + }; + option (google.api.method_signature) = "name,spoke_uri"; + option (google.longrunning.operation_info) = { + response_type: "RejectHubSpokeResponse" + metadata_type: "OperationMetadata" + }; + } + + // Accepts a proposal to attach a Network Connectivity Center spoke + // to a hub. + rpc AcceptHubSpoke(AcceptHubSpokeRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/global/hubs/*}:acceptSpoke" + body: "*" + }; + option (google.api.method_signature) = "name,spoke_uri"; + option (google.longrunning.operation_info) = { + response_type: "AcceptHubSpokeResponse" + metadata_type: "OperationMetadata" + }; + } + // Deletes a Network Connectivity Center spoke. rpc DeleteSpoke(DeleteSpokeRequest) returns (google.longrunning.Operation) { option (google.api.http) = { @@ -157,6 +201,55 @@ service HubService { metadata_type: "OperationMetadata" }; } + + // Gets details about a Network Connectivity Center route table. + rpc GetRouteTable(GetRouteTableRequest) returns (RouteTable) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/global/hubs/*/routeTables/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets details about the specified route. + rpc GetRoute(GetRouteRequest) returns (Route) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/global/hubs/*/routeTables/*/routes/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists routes in a given project. + rpc ListRoutes(ListRoutesRequest) returns (ListRoutesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/global/hubs/*/routeTables/*}/routes" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists route tables in a given project. + rpc ListRouteTables(ListRouteTablesRequest) + returns (ListRouteTablesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/global/hubs/*}/routeTables" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details about a Network Connectivity Center group. + rpc GetGroup(GetGroupRequest) returns (Group) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/global/hubs/*/groups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists groups in a given hub. + rpc ListGroups(ListGroupsRequest) returns (ListGroupsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/global/hubs/*}/groups" + }; + option (google.api.method_signature) = "parent"; + } } // Supported features for a location @@ -171,30 +264,77 @@ enum LocationFeature { SITE_TO_SITE_SPOKES = 2; } +// The route's type +enum RouteType { + // No route type information specified + ROUTE_TYPE_UNSPECIFIED = 0; + + // The route leads to a destination within the primary address range of the + // VPC network's subnet. + VPC_PRIMARY_SUBNET = 1; + + // The route leads to a destination within the secondary address range of the + // VPC network's subnet. + VPC_SECONDARY_SUBNET = 2; +} + // 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 + // The resource's create operation is in progress. CREATING = 1; // The resource is active ACTIVE = 2; - // The resource's Delete operation is in progress + // The resource's delete operation is in progress. DELETING = 3; - // The resource's Update operation is in progress + // The resource's accept operation is in progress. + ACCEPTING = 8; + + // The resource's reject operation is in progress. + REJECTING = 9; + + // The resource's update operation is in progress. UPDATING = 6; + + // The resource is inactive. + INACTIVE = 7; + + // The hub associated with this spoke resource has been deleted. + // This state applies to spoke resources only. + OBSOLETE = 10; } -// A Network Connectivity Center hub is a collection of spokes. A single hub -// can contain spokes from 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. +// The SpokeType enum represents the type of spoke. The type +// reflects the kind of resource that a spoke is associated with. +enum SpokeType { + // Unspecified spoke type. + SPOKE_TYPE_UNSPECIFIED = 0; + + // Spokes associated with VPN tunnels. + VPN_TUNNEL = 1; + + // Spokes associated with VLAN attachments. + INTERCONNECT_ATTACHMENT = 2; + + // Spokes associated with router appliance instances. + ROUTER_APPLIANCE = 3; + + // Spokes associated with VPC networks. + VPC_NETWORK = 4; +} + +// A Network Connectivity Center hub is a global management resource to which +// you attach spokes. A single hub can contain spokes from multiple regions. +// However, if any of a hub's spokes use the site-to-site data transfer feature, +// the resources associated with those spokes must all be in the same VPC +// network. Spokes that do not use site-to-site data transfer can be associated +// with any VPC network in your project. message Hub { option (google.api.resource) = { type: "networkconnectivity.googleapis.com/Hub" @@ -214,8 +354,8 @@ message Hub { google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Optional labels in key:value format. For more information about labels, see - // [Requirements for + // Optional labels in key-value pair format. For more information about + // labels, see [Requirements for // labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements). map labels = 4; @@ -235,6 +375,21 @@ message Hub { // 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; + + // Output only. The route tables that belong to this hub. They use the + // following form: + // `projects/{project_number}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}` + // + // This field is read-only. Network Connectivity Center automatically + // populates it based on the route tables nested under the hub. + repeated string route_tables = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. A summary of the spokes associated with a hub. The + // summary includes a count of spokes according to type + // and according to state. If any spokes are inactive, + // the summary also lists the reasons they are inactive, + // including a count for each reason. + SpokeSummary spoke_summary = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; } // RoutingVPC contains information about the VPC networks associated @@ -254,21 +409,53 @@ message RoutingVPC { [(google.api.field_behavior) = OUTPUT_ONLY]; } -// A Network Connectivity Center spoke represents a connection between your -// Google Cloud network resources and a non-Google-Cloud network. +// A Network Connectivity Center spoke represents one or more network +// connectivity resources. // -// When you create a spoke, you associate it with a hub. You must also identify -// a value for exactly one of the following fields: +// When you create a spoke, you associate it with a hub. You must also +// identify a value for exactly one of the following fields: // // * linked_vpn_tunnels // * linked_interconnect_attachments // * linked_router_appliance_instances +// * linked_vpc_network message Spoke { option (google.api.resource) = { type: "networkconnectivity.googleapis.com/Spoke" pattern: "projects/{project}/locations/{location}/spokes/{spoke}" }; + // The reason a spoke is inactive. + message StateReason { + // The Code enum represents the various reasons a state can be `INACTIVE`. + enum Code { + // No information available. + CODE_UNSPECIFIED = 0; + + // The proposed spoke is pending review. + PENDING_REVIEW = 1; + + // The proposed spoke has been rejected by the hub administrator. + REJECTED = 2; + + // The spoke has been deactivated internally. + PAUSED = 3; + + // Network Connectivity Center encountered errors while accepting + // the spoke. + FAILED = 4; + } + + // The code associated with this reason. + Code code = 1; + + // Human-readable details about this reason. + string message = 2; + + // Additional information provided by the user in the RejectSpoke call. + string user_details = 3; + } + // Immutable. The name of the spoke. Spoke names must be unique. They use the // following form: // `projects/{project_number}/locations/{region}/spokes/{spoke_id}` @@ -282,8 +469,8 @@ message Spoke { google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Optional labels in key:value format. For more information about labels, see - // [Requirements for + // Optional labels in key-value pair format. For more information about + // labels, see [Requirements for // labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements). map labels = 4; @@ -298,6 +485,14 @@ message Spoke { } ]; + // Optional. The name of the group that this spoke is associated with. + string group = 23 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "networkconnectivity.googleapis.com/Group" + } + ]; + // VPN tunnels that are associated with the spoke. LinkedVpnTunnels linked_vpn_tunnels = 17; @@ -307,13 +502,163 @@ message Spoke { // Router appliance instances that are associated with the spoke. LinkedRouterApplianceInstances linked_router_appliance_instances = 19; + // Optional. VPC network that is associated with the spoke. + LinkedVpcNetwork linked_vpc_network = 20 + [(google.api.field_behavior) = OPTIONAL]; + // Output only. The Google-generated UUID for the spoke. This value is unique // across all spoke resources. If a spoke is deleted and another with the same - // name is created, the new spoke is assigned a different unique_id. + // name is created, the new spoke is assigned a different `unique_id`. string unique_id = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The current lifecycle state of this spoke. State state = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The reasons for current state of the spoke. Only present when + // the spoke is in the `INACTIVE` state. + repeated StateReason reasons = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The type of resource associated with the spoke. + SpokeType spoke_type = 22 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +message RouteTable { + option (google.api.resource) = { + type: "networkconnectivity.googleapis.com/RouteTable" + pattern: "projects/{project}/locations/global/hubs/{hub}/routeTables/{route_table}" + }; + + // Immutable. The name of the route table. Route table names must be unique. + // They use the following form: + // `projects/{project_number}/locations/global/hubs/{hub}/routeTables/{route_table_id}` + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. The time the route table was created. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the route table was last updated. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional labels in key-value pair format. For more information about + // labels, see [Requirements for + // labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements). + map labels = 4; + + // An optional description of the route table. + string description = 5; + + // Output only. The Google-generated UUID for the route table. This value is + // unique across all route table resources. If a route table is deleted and + // another with the same name is created, the new route table is assigned + // a different `uid`. + string uid = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current lifecycle state of this route table. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A route defines a path from VM instances within a spoke to a specific +// destination resource. Only VPC spokes have routes. +message Route { + option (google.api.resource) = { + type: "networkconnectivity.googleapis.com/HubRoute" + pattern: "projects/{project}/locations/global/hubs/{hub}/routeTables/{route_table}/routes/{route}" + }; + + // Immutable. The name of the route. Route names must be unique. Route names + // use the following form: + // `projects/{project_number}/locations/global/hubs/{hub}/routeTables/{route_table_id}/routes/{route_id}` + string name = 3 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. The time the route was created. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the route was last updated. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The destination IP address range. + string ip_cidr_range = 1; + + // Output only. The route's type. Its type is determined by the properties of + // its IP address range. + RouteType type = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. The destination VPC network for packets on this route. + NextHopVpcNetwork next_hop_vpc_network = 2 + [(google.api.field_behavior) = IMMUTABLE]; + + // Optional labels in key-value pair format. For more information about + // labels, see [Requirements for + // labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements). + map labels = 6; + + // An optional description of the route. + string description = 7; + + // Output only. The Google-generated UUID for the route. This value is unique + // across all Network Connectivity Center route resources. If a + // route is deleted and another with the same name is created, + // the new route is assigned a different `uid`. + string uid = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current lifecycle state of the route. + State state = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. The spoke that this route leads to. + // Example: projects/12345/locations/global/spokes/SPOKE + string spoke = 11 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.resource_reference) = { + type: "networkconnectivity.googleapis.com/Spoke" + } + ]; + + // Output only. The location of the route. + // Uses the following form: "projects/{project}/locations/{location}" + // Example: projects/1234/locations/us-central1 + string location = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// A group represents a subset of spokes attached to a hub. +message Group { + option (google.api.resource) = { + type: "networkconnectivity.googleapis.com/Group" + pattern: "projects/{project}/locations/global/hubs/{hub}/groups/{group}" + }; + + // Immutable. The name of the group. Group names must be unique. They + // use the following form: + // `projects/{project_number}/locations/global/hubs/{hub}/groups/{group_id}` + string name = 1 [(google.api.field_behavior) = IMMUTABLE]; + + // Output only. The time the group was created. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the group was last updated. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Labels in key-value pair format. For more information about + // labels, see [Requirements for + // labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements). + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The description of the group. + string description = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The Google-generated UUID for the group. This value is unique + // across all group resources. If a group is deleted and + // another with the same name is created, the new route table is assigned + // a different unique_id. + string uid = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current lifecycle state of this group. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Request for @@ -328,13 +673,13 @@ message ListHubsRequest { } ]; - // The maximum number of results per page that should be returned. + // The maximum number of results per page to return. int32 page_size = 2; // The page token. string page_token = 3; - // An expression that filters the results listed in the response. + // An expression that filters the list of results. string filter = 4; // Sort the results by a certain order. @@ -348,8 +693,9 @@ message ListHubsResponse { // The requested hubs. repeated Hub hubs = 1; - // The next pagination token in the List response. It should be used as - // page_token for the following request. An empty value means no more result. + // The token for the next page of the response. To see more results, + // use this value as the page_token for your next request. If this value + // is empty, there are no more results. string next_page_token = 2; // Locations that could not be reached. @@ -387,11 +733,11 @@ message CreateHubRequest { // Required. The initial values for a new hub. Hub hub = 3 [(google.api.field_behavior) = REQUIRED]; - // Optional. A unique request ID (optional). If you specify this ID, you can - // use it in cases when you need to retry your request. When you need to - // retry, this ID lets the server know that it can ignore the request if it - // has already been completed. The server guarantees that for at least 60 - // minutes after the first request. + // Optional. A request ID to identify requests. Specify a unique request ID so + // that if you must retry your request, the server knows to ignore the request + // if it has already been completed. The server guarantees that a request + // doesn't result in creation of duplicate commitments for at least 60 + // minutes. // // For example, consider a situation where you make an initial request and // the request times out. If you make the request again with the same request @@ -419,11 +765,11 @@ message UpdateHubRequest { // Required. The state that the hub should be in after the update. Hub hub = 2 [(google.api.field_behavior) = REQUIRED]; - // Optional. A unique request ID (optional). If you specify this ID, you can - // use it in cases when you need to retry your request. When you need to - // retry, this ID lets the server know that it can ignore the request if it - // has already been completed. The server guarantees that for at least 60 - // minutes after the first request. + // Optional. A request ID to identify requests. Specify a unique request ID so + // that if you must retry your request, the server knows to ignore the request + // if it has already been completed. The server guarantees that a request + // doesn't result in creation of duplicate commitments for at least 60 + // minutes. // // For example, consider a situation where you make an initial request and // the request times out. If you make the request again with the same request @@ -447,11 +793,11 @@ message DeleteHubRequest { } ]; - // Optional. A unique request ID (optional). If you specify this ID, you can - // use it in cases when you need to retry your request. When you need to - // retry, this ID lets the server know that it can ignore the request if it - // has already been completed. The server guarantees that for at least 60 - // minutes after the first request. + // Optional. A request ID to identify requests. Specify a unique request ID so + // that if you must retry your request, the server knows to ignore the request + // if it has already been completed. The server guarantees that a request + // doesn't result in creation of duplicate commitments for at least 60 + // minutes. // // For example, consider a situation where you make an initial request and // the request times out. If you make the request again with the same request @@ -464,6 +810,79 @@ message DeleteHubRequest { string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; } +// The request for +// [HubService.ListHubSpokes][google.cloud.networkconnectivity.v1.HubService.ListHubSpokes]. +// +message ListHubSpokesRequest { + // Enum that controls which spoke fields are included in the response. + enum SpokeView { + // The spoke view is unspecified. When the spoke view is unspecified, the + // API returns the same fields as the `BASIC` view. + SPOKE_VIEW_UNSPECIFIED = 0; + + // Includes `name`, `create_time`, `hub`, `unique_id`, `state`, `reasons`, + // and `spoke_type`. This is the default value. + BASIC = 1; + + // Includes all spoke fields except `labels`. + // You can use the `DETAILED` view only when you set the `spoke_locations` + // field to `[global]`. + DETAILED = 2; + } + + // Required. The name of the hub. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkconnectivity.googleapis.com/Hub" + } + ]; + + // A list of locations. + // Specify one of the following: `[global]`, a single region (for + // example, `[us-central1]`), or a combination of + // values (for example, `[global, us-central1, us-west1]`). + // If the spoke_locations field is populated, the list of results + // includes only spokes in the specified location. + // If the spoke_locations field is not populated, the list of results + // includes spokes in all locations. + repeated string spoke_locations = 2; + + // The maximum number of results to return per page. + int32 page_size = 3; + + // The page token. + string page_token = 4; + + // An expression that filters the list of results. + string filter = 5; + + // Sort the results by name or create_time. + string order_by = 6; + + // The view of the spoke to return. + // The view that you use determines which spoke fields are included in the + // response. + SpokeView view = 7; +} + +// The response for +// [HubService.ListHubSpokes][google.cloud.networkconnectivity.v1.HubService.ListHubSpokes]. +message ListHubSpokesResponse { + // The requested spokes. + // The spoke fields can be partially populated based on the `view` field in + // the request message. + repeated Spoke spokes = 1; + + // The token for the next page of the response. To see more results, + // use this value as the page_token for your next request. If this value + // is empty, there are no more results. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + // The request for // [HubService.ListSpokes][google.cloud.networkconnectivity.v1.HubService.ListSpokes]. message ListSpokesRequest { @@ -475,13 +894,13 @@ message ListSpokesRequest { } ]; - // The maximum number of results per page that should be returned. + // The maximum number of results to return per page. int32 page_size = 2; // The page token. string page_token = 3; - // An expression that filters the results listed in the response. + // An expression that filters the list of results. string filter = 4; // Sort the results by a certain order. @@ -494,8 +913,9 @@ message ListSpokesResponse { // The requested spokes. repeated Spoke spokes = 1; - // The next pagination token in the List response. It should be used as - // page_token for the following request. An empty value means no more result. + // The token for the next page of the response. To see more results, + // use this value as the page_token for your next request. If this value + // is empty, there are no more results. string next_page_token = 2; // Locations that could not be reached. @@ -531,11 +951,11 @@ message CreateSpokeRequest { // Required. The initial values for a new spoke. Spoke spoke = 3 [(google.api.field_behavior) = REQUIRED]; - // Optional. A unique request ID (optional). If you specify this ID, you can - // use it in cases when you need to retry your request. When you need to - // retry, this ID lets the server know that it can ignore the request if it - // has already been completed. The server guarantees that for at least 60 - // minutes after the first request. + // Optional. A request ID to identify requests. Specify a unique request ID so + // that if you must retry your request, the server knows to ignore the request + // if it has already been completed. The server guarantees that a request + // doesn't result in creation of duplicate commitments for at least 60 + // minutes. // // For example, consider a situation where you make an initial request and // the request times out. If you make the request again with the same request @@ -563,11 +983,11 @@ message UpdateSpokeRequest { // Required. The state that the spoke should be in after the update. Spoke spoke = 2 [(google.api.field_behavior) = REQUIRED]; - // Optional. A unique request ID (optional). If you specify this ID, you can - // use it in cases when you need to retry your request. When you need to - // retry, this ID lets the server know that it can ignore the request if it - // has already been completed. The server guarantees that for at least 60 - // minutes after the first request. + // Optional. A request ID to identify requests. Specify a unique request ID so + // that if you must retry your request, the server knows to ignore the request + // if it has already been completed. The server guarantees that a request + // doesn't result in creation of duplicate commitments for at least 60 + // minutes. // // For example, consider a situation where you make an initial request and // the request times out. If you make the request again with the same request @@ -591,11 +1011,11 @@ message DeleteSpokeRequest { } ]; - // Optional. A unique request ID (optional). If you specify this ID, you can - // use it in cases when you need to retry your request. When you need to - // retry, this ID lets the server know that it can ignore the request if it - // has already been completed. The server guarantees that for at least 60 - // minutes after the first request. + // Optional. A request ID to identify requests. Specify a unique request ID so + // that if you must retry your request, the server knows to ignore the request + // if it has already been completed. The server guarantees that a request + // doesn't result in creation of duplicate commitments for at least 60 + // minutes. // // For example, consider a situation where you make an initial request and // the request times out. If you make the request again with the same request @@ -608,6 +1028,242 @@ message DeleteSpokeRequest { string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; } +// The request for +// [HubService.AcceptHubSpoke][google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke]. +message AcceptHubSpokeRequest { + // Required. The name of the hub into which to accept the spoke. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkconnectivity.googleapis.com/Hub" + } + ]; + + // Required. The URI of the spoke to accept into the hub. + string spoke_uri = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkconnectivity.googleapis.com/Spoke" + } + ]; + + // Optional. A request ID to identify requests. Specify a unique request ID so + // that if you must retry your request, the server knows to ignore the request + // if it has already been completed. The server guarantees that a request + // doesn't result in creation of duplicate commitments for at least 60 + // minutes. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check to see whether the original operation + // was received. If it was, the server ignores the second request. This + // behavior prevents clients from mistakenly creating duplicate commitments. + // + // The request ID must be a valid UUID, with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response for +// [HubService.AcceptHubSpoke][google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke]. +message AcceptHubSpokeResponse { + // The spoke that was operated on. + Spoke spoke = 1; +} + +// The request for +// [HubService.RejectHubSpoke][google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke]. +message RejectHubSpokeRequest { + // Required. The name of the hub from which to reject the spoke. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkconnectivity.googleapis.com/Hub" + } + ]; + + // Required. The URI of the spoke to reject from the hub. + string spoke_uri = 2 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkconnectivity.googleapis.com/Spoke" + } + ]; + + // Optional. A request ID to identify requests. Specify a unique request ID so + // that if you must retry your request, the server knows to ignore the request + // if it has already been completed. The server guarantees that a request + // doesn't result in creation of duplicate commitments for at least 60 + // minutes. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check to see whether the original operation + // was received. If it was, the server ignores the second request. This + // behavior prevents clients from mistakenly creating duplicate commitments. + // + // The request ID must be a valid UUID, with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Additional information provided by the hub administrator. + string details = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response for +// [HubService.RejectHubSpoke][google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke]. +message RejectHubSpokeResponse { + // The spoke that was operated on. + Spoke spoke = 1; +} + +// The request for +// [HubService.GetRouteTable][google.cloud.networkconnectivity.v1.HubService.GetRouteTable]. +message GetRouteTableRequest { + // Required. The name of the route table resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkconnectivity.googleapis.com/RouteTable" + } + ]; +} + +// The request for +// [HubService.GetRoute][google.cloud.networkconnectivity.v1.HubService.GetRoute]. +message GetRouteRequest { + // Required. The name of the route resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkconnectivity.googleapis.com/HubRoute" + } + ]; +} + +// Request for +// [HubService.ListRoutes][google.cloud.networkconnectivity.v1.HubService.ListRoutes] +// method. +message ListRoutesRequest { + // Required. The parent resource's name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkconnectivity.googleapis.com/RouteTable" + } + ]; + + // The maximum number of results to return per page. + int32 page_size = 2; + + // The page token. + string page_token = 3; + + // An expression that filters the list of results. + string filter = 4; + + // Sort the results by a certain order. + string order_by = 5; +} + +// Response for +// [HubService.ListRoutes][google.cloud.networkconnectivity.v1.HubService.ListRoutes] +// method. +message ListRoutesResponse { + // The requested routes. + repeated Route routes = 1; + + // The token for the next page of the response. To see more results, + // use this value as the page_token for your next request. If this value + // is empty, there are no more results. + string next_page_token = 2; + + // RouteTables that could not be reached. + repeated string unreachable = 3; +} + +// Request for +// [HubService.ListRouteTables][google.cloud.networkconnectivity.v1.HubService.ListRouteTables] +// method. +message ListRouteTablesRequest { + // Required. The parent resource's name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkconnectivity.googleapis.com/Hub" + } + ]; + + // The maximum number of results to return per page. + int32 page_size = 2; + + // The page token. + string page_token = 3; + + // An expression that filters the list of results. + string filter = 4; + + // Sort the results by a certain order. + string order_by = 5; +} + +// Response for +// [HubService.ListRouteTables][google.cloud.networkconnectivity.v1.HubService.ListRouteTables] +// method. +message ListRouteTablesResponse { + // The requested route tables. + repeated RouteTable route_tables = 1; + + // The token for the next page of the response. To see more results, + // use this value as the page_token for your next request. If this value + // is empty, there are no more results. + string next_page_token = 2; + + // Hubs that could not be reached. + repeated string unreachable = 3; +} + +// Request for +// [HubService.ListGroups][google.cloud.networkconnectivity.v1.HubService.ListGroups] +// method. +message ListGroupsRequest { + // Required. The parent resource's name. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkconnectivity.googleapis.com/Hub" + } + ]; + + // The maximum number of results to return per page. + int32 page_size = 2; + + // The page token. + string page_token = 3; + + // An expression that filters the list of results. + string filter = 4; + + // Sort the results by a certain order. + string order_by = 5; +} + +// Response for +// [HubService.ListGroups][google.cloud.networkconnectivity.v1.HubService.ListGroups] +// method. +message ListGroupsResponse { + // The requested groups. + repeated Group groups = 1; + + // The token for the next page of the response. To see more results, + // use this value as the page_token for your next request. If this value + // is empty, there are no more results. + string next_page_token = 2; + + // Hubs that could not be reached. + repeated string unreachable = 3; +} + // A collection of Cloud VPN tunnel resources. These resources should be // redundant HA VPN tunnels that all advertise the same prefixes to Google // Cloud. Alternatively, in a passive/active configuration, all tunnels @@ -673,6 +1329,19 @@ message LinkedRouterApplianceInstances { ]; } +// An existing VPC network. +message LinkedVpcNetwork { + // Required. The URI of the VPC network resource. + string uri = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } + ]; + + // Optional. IP ranges encompassing the subnets to be excluded from peering. + repeated string exclude_export_ranges = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + // A router appliance instance is a Compute Engine virtual machine (VM) instance // that acts as a BGP speaker. A router appliance instance is specified by the // URI of the VM and the internal IP address of one of the VM's network @@ -692,3 +1361,78 @@ message LocationMetadata { // List of supported features repeated LocationFeature location_features = 1; } + +message NextHopVpcNetwork { + // The URI of the VPC network resource + string uri = 1 [ + (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } + ]; +} + +// Summarizes information about the spokes associated with a hub. +// The summary includes a count of spokes according to type +// and according to state. If any spokes are inactive, +// the summary also lists the reasons they are inactive, +// including a count for each reason. +message SpokeSummary { + // The number of spokes of a given type that are associated + // with a specific hub. The type indicates what kind of + // resource is associated with the spoke. + message SpokeTypeCount { + // Output only. The type of the spokes. + SpokeType spoke_type = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The total number of spokes of this type that are + // associated with the hub. + int64 count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The number of spokes that are in a particular state + // and associated with a given hub. + message SpokeStateCount { + // Output only. The state of the spokes. + State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The total number of spokes that are in this state + // and associated with a given hub. + int64 count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // The number of spokes in the hub that are inactive for this reason. + message SpokeStateReasonCount { + // Output only. The reason that a spoke is inactive. + Spoke.StateReason.Code state_reason_code = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The total number of spokes that are inactive for a + // particular reason and associated with a given hub. + int64 count = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. Counts the number of spokes of each type that are + // associated with a specific hub. + repeated SpokeTypeCount spoke_type_counts = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Counts the number of spokes that are in each state + // and associated with a given hub. + repeated SpokeStateCount spoke_state_counts = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Counts the number of spokes that are inactive for each + // possible reason and associated with a given hub. + repeated SpokeStateReasonCount spoke_state_reason_counts = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request for +// [HubService.GetGroup][google.cloud.networkconnectivity.v1.HubService.GetGroup]. +message GetGroupRequest { + // Required. The name of the route table resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "networkconnectivity.googleapis.com/Group" + } + ]; +} diff --git a/packages/google-cloud-networkconnectivity/protos/protos.d.ts b/packages/google-cloud-networkconnectivity/protos/protos.d.ts index bef79583038..d498a2997ee 100644 --- a/packages/google-cloud-networkconnectivity/protos/protos.d.ts +++ b/packages/google-cloud-networkconnectivity/protos/protos.d.ts @@ -249,6 +249,20 @@ export namespace google { */ public deleteHub(request: google.cloud.networkconnectivity.v1.IDeleteHubRequest): Promise; + /** + * Calls ListHubSpokes. + * @param request ListHubSpokesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListHubSpokesResponse + */ + public listHubSpokes(request: google.cloud.networkconnectivity.v1.IListHubSpokesRequest, callback: google.cloud.networkconnectivity.v1.HubService.ListHubSpokesCallback): void; + + /** + * Calls ListHubSpokes. + * @param request ListHubSpokesRequest message or plain object + * @returns Promise + */ + public listHubSpokes(request: google.cloud.networkconnectivity.v1.IListHubSpokesRequest): Promise; + /** * Calls ListSpokes. * @param request ListSpokesRequest message or plain object @@ -305,6 +319,34 @@ export namespace google { */ public updateSpoke(request: google.cloud.networkconnectivity.v1.IUpdateSpokeRequest): Promise; + /** + * Calls RejectHubSpoke. + * @param request RejectHubSpokeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public rejectHubSpoke(request: google.cloud.networkconnectivity.v1.IRejectHubSpokeRequest, callback: google.cloud.networkconnectivity.v1.HubService.RejectHubSpokeCallback): void; + + /** + * Calls RejectHubSpoke. + * @param request RejectHubSpokeRequest message or plain object + * @returns Promise + */ + public rejectHubSpoke(request: google.cloud.networkconnectivity.v1.IRejectHubSpokeRequest): Promise; + + /** + * Calls AcceptHubSpoke. + * @param request AcceptHubSpokeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public acceptHubSpoke(request: google.cloud.networkconnectivity.v1.IAcceptHubSpokeRequest, callback: google.cloud.networkconnectivity.v1.HubService.AcceptHubSpokeCallback): void; + + /** + * Calls AcceptHubSpoke. + * @param request AcceptHubSpokeRequest message or plain object + * @returns Promise + */ + public acceptHubSpoke(request: google.cloud.networkconnectivity.v1.IAcceptHubSpokeRequest): Promise; + /** * Calls DeleteSpoke. * @param request DeleteSpokeRequest message or plain object @@ -318,6 +360,90 @@ export namespace google { * @returns Promise */ public deleteSpoke(request: google.cloud.networkconnectivity.v1.IDeleteSpokeRequest): Promise; + + /** + * Calls GetRouteTable. + * @param request GetRouteTableRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RouteTable + */ + public getRouteTable(request: google.cloud.networkconnectivity.v1.IGetRouteTableRequest, callback: google.cloud.networkconnectivity.v1.HubService.GetRouteTableCallback): void; + + /** + * Calls GetRouteTable. + * @param request GetRouteTableRequest message or plain object + * @returns Promise + */ + public getRouteTable(request: google.cloud.networkconnectivity.v1.IGetRouteTableRequest): Promise; + + /** + * Calls GetRoute. + * @param request GetRouteRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Route + */ + public getRoute(request: google.cloud.networkconnectivity.v1.IGetRouteRequest, callback: google.cloud.networkconnectivity.v1.HubService.GetRouteCallback): void; + + /** + * Calls GetRoute. + * @param request GetRouteRequest message or plain object + * @returns Promise + */ + public getRoute(request: google.cloud.networkconnectivity.v1.IGetRouteRequest): Promise; + + /** + * Calls ListRoutes. + * @param request ListRoutesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListRoutesResponse + */ + public listRoutes(request: google.cloud.networkconnectivity.v1.IListRoutesRequest, callback: google.cloud.networkconnectivity.v1.HubService.ListRoutesCallback): void; + + /** + * Calls ListRoutes. + * @param request ListRoutesRequest message or plain object + * @returns Promise + */ + public listRoutes(request: google.cloud.networkconnectivity.v1.IListRoutesRequest): Promise; + + /** + * Calls ListRouteTables. + * @param request ListRouteTablesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListRouteTablesResponse + */ + public listRouteTables(request: google.cloud.networkconnectivity.v1.IListRouteTablesRequest, callback: google.cloud.networkconnectivity.v1.HubService.ListRouteTablesCallback): void; + + /** + * Calls ListRouteTables. + * @param request ListRouteTablesRequest message or plain object + * @returns Promise + */ + public listRouteTables(request: google.cloud.networkconnectivity.v1.IListRouteTablesRequest): Promise; + + /** + * Calls GetGroup. + * @param request GetGroupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Group + */ + public getGroup(request: google.cloud.networkconnectivity.v1.IGetGroupRequest, callback: google.cloud.networkconnectivity.v1.HubService.GetGroupCallback): void; + + /** + * Calls GetGroup. + * @param request GetGroupRequest message or plain object + * @returns Promise + */ + public getGroup(request: google.cloud.networkconnectivity.v1.IGetGroupRequest): Promise; + + /** + * Calls ListGroups. + * @param request ListGroupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListGroupsResponse + */ + public listGroups(request: google.cloud.networkconnectivity.v1.IListGroupsRequest, callback: google.cloud.networkconnectivity.v1.HubService.ListGroupsCallback): void; + + /** + * Calls ListGroups. + * @param request ListGroupsRequest message or plain object + * @returns Promise + */ + public listGroups(request: google.cloud.networkconnectivity.v1.IListGroupsRequest): Promise; } namespace HubService { @@ -357,6 +483,13 @@ export namespace google { */ type DeleteHubCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** + * Callback as used by {@link google.cloud.networkconnectivity.v1.HubService|listHubSpokes}. + * @param error Error, if any + * @param [response] ListHubSpokesResponse + */ + type ListHubSpokesCallback = (error: (Error|null), response?: google.cloud.networkconnectivity.v1.ListHubSpokesResponse) => void; + /** * Callback as used by {@link google.cloud.networkconnectivity.v1.HubService|listSpokes}. * @param error Error, if any @@ -385,12 +518,68 @@ export namespace google { */ type UpdateSpokeCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** + * Callback as used by {@link google.cloud.networkconnectivity.v1.HubService|rejectHubSpoke}. + * @param error Error, if any + * @param [response] Operation + */ + type RejectHubSpokeCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networkconnectivity.v1.HubService|acceptHubSpoke}. + * @param error Error, if any + * @param [response] Operation + */ + type AcceptHubSpokeCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** * Callback as used by {@link google.cloud.networkconnectivity.v1.HubService|deleteSpoke}. * @param error Error, if any * @param [response] Operation */ type DeleteSpokeCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.networkconnectivity.v1.HubService|getRouteTable}. + * @param error Error, if any + * @param [response] RouteTable + */ + type GetRouteTableCallback = (error: (Error|null), response?: google.cloud.networkconnectivity.v1.RouteTable) => void; + + /** + * Callback as used by {@link google.cloud.networkconnectivity.v1.HubService|getRoute}. + * @param error Error, if any + * @param [response] Route + */ + type GetRouteCallback = (error: (Error|null), response?: google.cloud.networkconnectivity.v1.Route) => void; + + /** + * Callback as used by {@link google.cloud.networkconnectivity.v1.HubService|listRoutes}. + * @param error Error, if any + * @param [response] ListRoutesResponse + */ + type ListRoutesCallback = (error: (Error|null), response?: google.cloud.networkconnectivity.v1.ListRoutesResponse) => void; + + /** + * Callback as used by {@link google.cloud.networkconnectivity.v1.HubService|listRouteTables}. + * @param error Error, if any + * @param [response] ListRouteTablesResponse + */ + type ListRouteTablesCallback = (error: (Error|null), response?: google.cloud.networkconnectivity.v1.ListRouteTablesResponse) => void; + + /** + * Callback as used by {@link google.cloud.networkconnectivity.v1.HubService|getGroup}. + * @param error Error, if any + * @param [response] Group + */ + type GetGroupCallback = (error: (Error|null), response?: google.cloud.networkconnectivity.v1.Group) => void; + + /** + * Callback as used by {@link google.cloud.networkconnectivity.v1.HubService|listGroups}. + * @param error Error, if any + * @param [response] ListGroupsResponse + */ + type ListGroupsCallback = (error: (Error|null), response?: google.cloud.networkconnectivity.v1.ListGroupsResponse) => void; } /** LocationFeature enum. */ @@ -400,13 +589,33 @@ export namespace google { SITE_TO_SITE_SPOKES = 2 } + /** RouteType enum. */ + enum RouteType { + ROUTE_TYPE_UNSPECIFIED = 0, + VPC_PRIMARY_SUBNET = 1, + VPC_SECONDARY_SUBNET = 2 + } + /** State enum. */ enum State { STATE_UNSPECIFIED = 0, CREATING = 1, ACTIVE = 2, DELETING = 3, - UPDATING = 6 + ACCEPTING = 8, + REJECTING = 9, + UPDATING = 6, + INACTIVE = 7, + OBSOLETE = 10 + } + + /** SpokeType enum. */ + enum SpokeType { + SPOKE_TYPE_UNSPECIFIED = 0, + VPN_TUNNEL = 1, + INTERCONNECT_ATTACHMENT = 2, + ROUTER_APPLIANCE = 3, + VPC_NETWORK = 4 } /** Properties of a Hub. */ @@ -435,6 +644,12 @@ export namespace google { /** Hub routingVpcs */ routingVpcs?: (google.cloud.networkconnectivity.v1.IRoutingVPC[]|null); + + /** Hub routeTables */ + routeTables?: (string[]|null); + + /** Hub spokeSummary */ + spokeSummary?: (google.cloud.networkconnectivity.v1.ISpokeSummary|null); } /** Represents a Hub. */ @@ -470,6 +685,12 @@ export namespace google { /** Hub routingVpcs. */ public routingVpcs: google.cloud.networkconnectivity.v1.IRoutingVPC[]; + /** Hub routeTables. */ + public routeTables: string[]; + + /** Hub spokeSummary. */ + public spokeSummary?: (google.cloud.networkconnectivity.v1.ISpokeSummary|null); + /** * Creates a new Hub instance using the specified properties. * @param [properties] Properties to set @@ -672,6 +893,9 @@ export namespace google { /** Spoke hub */ hub?: (string|null); + /** Spoke group */ + group?: (string|null); + /** Spoke linkedVpnTunnels */ linkedVpnTunnels?: (google.cloud.networkconnectivity.v1.ILinkedVpnTunnels|null); @@ -681,11 +905,20 @@ export namespace google { /** Spoke linkedRouterApplianceInstances */ linkedRouterApplianceInstances?: (google.cloud.networkconnectivity.v1.ILinkedRouterApplianceInstances|null); + /** Spoke linkedVpcNetwork */ + linkedVpcNetwork?: (google.cloud.networkconnectivity.v1.ILinkedVpcNetwork|null); + /** Spoke uniqueId */ uniqueId?: (string|null); /** Spoke state */ state?: (google.cloud.networkconnectivity.v1.State|keyof typeof google.cloud.networkconnectivity.v1.State|null); + + /** Spoke reasons */ + reasons?: (google.cloud.networkconnectivity.v1.Spoke.IStateReason[]|null); + + /** Spoke spokeType */ + spokeType?: (google.cloud.networkconnectivity.v1.SpokeType|keyof typeof google.cloud.networkconnectivity.v1.SpokeType|null); } /** Represents a Spoke. */ @@ -715,6 +948,9 @@ export namespace google { /** Spoke hub. */ public hub: string; + /** Spoke group. */ + public group: string; + /** Spoke linkedVpnTunnels. */ public linkedVpnTunnels?: (google.cloud.networkconnectivity.v1.ILinkedVpnTunnels|null); @@ -724,12 +960,21 @@ export namespace google { /** Spoke linkedRouterApplianceInstances. */ public linkedRouterApplianceInstances?: (google.cloud.networkconnectivity.v1.ILinkedRouterApplianceInstances|null); + /** Spoke linkedVpcNetwork. */ + public linkedVpcNetwork?: (google.cloud.networkconnectivity.v1.ILinkedVpcNetwork|null); + /** Spoke uniqueId. */ public uniqueId: string; /** Spoke state. */ public state: (google.cloud.networkconnectivity.v1.State|keyof typeof google.cloud.networkconnectivity.v1.State); + /** Spoke reasons. */ + public reasons: google.cloud.networkconnectivity.v1.Spoke.IStateReason[]; + + /** Spoke spokeType. */ + public spokeType: (google.cloud.networkconnectivity.v1.SpokeType|keyof typeof google.cloud.networkconnectivity.v1.SpokeType); + /** * Creates a new Spoke instance using the specified properties. * @param [properties] Properties to set @@ -808,1835 +1053,4660 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListHubsRequest. */ - interface IListHubsRequest { + namespace Spoke { - /** ListHubsRequest parent */ - parent?: (string|null); + /** Properties of a StateReason. */ + interface IStateReason { - /** ListHubsRequest pageSize */ - pageSize?: (number|null); + /** StateReason code */ + code?: (google.cloud.networkconnectivity.v1.Spoke.StateReason.Code|keyof typeof google.cloud.networkconnectivity.v1.Spoke.StateReason.Code|null); - /** ListHubsRequest pageToken */ - pageToken?: (string|null); + /** StateReason message */ + message?: (string|null); - /** ListHubsRequest filter */ - filter?: (string|null); + /** StateReason userDetails */ + userDetails?: (string|null); + } - /** ListHubsRequest orderBy */ - orderBy?: (string|null); + /** Represents a StateReason. */ + class StateReason implements IStateReason { + + /** + * Constructs a new StateReason. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkconnectivity.v1.Spoke.IStateReason); + + /** StateReason code. */ + public code: (google.cloud.networkconnectivity.v1.Spoke.StateReason.Code|keyof typeof google.cloud.networkconnectivity.v1.Spoke.StateReason.Code); + + /** StateReason message. */ + public message: string; + + /** StateReason userDetails. */ + public userDetails: string; + + /** + * Creates a new StateReason instance using the specified properties. + * @param [properties] Properties to set + * @returns StateReason instance + */ + public static create(properties?: google.cloud.networkconnectivity.v1.Spoke.IStateReason): google.cloud.networkconnectivity.v1.Spoke.StateReason; + + /** + * Encodes the specified StateReason message. Does not implicitly {@link google.cloud.networkconnectivity.v1.Spoke.StateReason.verify|verify} messages. + * @param message StateReason message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkconnectivity.v1.Spoke.IStateReason, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StateReason message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.Spoke.StateReason.verify|verify} messages. + * @param message StateReason message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.Spoke.IStateReason, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StateReason message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StateReason + * @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.Spoke.StateReason; + + /** + * Decodes a StateReason message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StateReason + * @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.Spoke.StateReason; + + /** + * Verifies a StateReason 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 StateReason message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StateReason + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.Spoke.StateReason; + + /** + * Creates a plain object from a StateReason message. Also converts values to other types if specified. + * @param message StateReason + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkconnectivity.v1.Spoke.StateReason, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StateReason to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StateReason + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StateReason { + + /** Code enum. */ + enum Code { + CODE_UNSPECIFIED = 0, + PENDING_REVIEW = 1, + REJECTED = 2, + PAUSED = 3, + FAILED = 4 + } + } } - /** Represents a ListHubsRequest. */ - class ListHubsRequest implements IListHubsRequest { + /** Properties of a RouteTable. */ + interface IRouteTable { + + /** RouteTable name */ + name?: (string|null); + + /** RouteTable createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** RouteTable updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** RouteTable labels */ + labels?: ({ [k: string]: string }|null); + + /** RouteTable description */ + description?: (string|null); + + /** RouteTable uid */ + uid?: (string|null); + + /** RouteTable state */ + state?: (google.cloud.networkconnectivity.v1.State|keyof typeof google.cloud.networkconnectivity.v1.State|null); + } + + /** Represents a RouteTable. */ + class RouteTable implements IRouteTable { /** - * Constructs a new ListHubsRequest. + * Constructs a new RouteTable. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.networkconnectivity.v1.IListHubsRequest); + constructor(properties?: google.cloud.networkconnectivity.v1.IRouteTable); - /** ListHubsRequest parent. */ - public parent: string; + /** RouteTable name. */ + public name: string; - /** ListHubsRequest pageSize. */ - public pageSize: number; + /** RouteTable createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); - /** ListHubsRequest pageToken. */ - public pageToken: string; + /** RouteTable updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); - /** ListHubsRequest filter. */ - public filter: string; + /** RouteTable labels. */ + public labels: { [k: string]: string }; - /** ListHubsRequest orderBy. */ - public orderBy: string; + /** RouteTable description. */ + public description: string; + + /** RouteTable uid. */ + public uid: string; + + /** RouteTable state. */ + public state: (google.cloud.networkconnectivity.v1.State|keyof typeof google.cloud.networkconnectivity.v1.State); /** - * Creates a new ListHubsRequest instance using the specified properties. + * Creates a new RouteTable instance using the specified properties. * @param [properties] Properties to set - * @returns ListHubsRequest instance + * @returns RouteTable instance */ - public static create(properties?: google.cloud.networkconnectivity.v1.IListHubsRequest): google.cloud.networkconnectivity.v1.ListHubsRequest; + public static create(properties?: google.cloud.networkconnectivity.v1.IRouteTable): google.cloud.networkconnectivity.v1.RouteTable; /** - * Encodes the specified ListHubsRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListHubsRequest.verify|verify} messages. - * @param message ListHubsRequest message or plain object to encode + * Encodes the specified RouteTable message. Does not implicitly {@link google.cloud.networkconnectivity.v1.RouteTable.verify|verify} messages. + * @param message RouteTable message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.networkconnectivity.v1.IListHubsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.networkconnectivity.v1.IRouteTable, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListHubsRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListHubsRequest.verify|verify} messages. - * @param message ListHubsRequest message or plain object to encode + * Encodes the specified RouteTable message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.RouteTable.verify|verify} messages. + * @param message RouteTable message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IListHubsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IRouteTable, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListHubsRequest message from the specified reader or buffer. + * Decodes a RouteTable message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListHubsRequest + * @returns RouteTable * @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.ListHubsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networkconnectivity.v1.RouteTable; /** - * Decodes a ListHubsRequest message from the specified reader or buffer, length delimited. + * Decodes a RouteTable message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListHubsRequest + * @returns RouteTable * @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.ListHubsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networkconnectivity.v1.RouteTable; /** - * Verifies a ListHubsRequest message. + * Verifies a RouteTable 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 ListHubsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RouteTable message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListHubsRequest + * @returns RouteTable */ - public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.ListHubsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.RouteTable; /** - * Creates a plain object from a ListHubsRequest message. Also converts values to other types if specified. - * @param message ListHubsRequest + * Creates a plain object from a RouteTable message. Also converts values to other types if specified. + * @param message RouteTable * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.networkconnectivity.v1.ListHubsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.networkconnectivity.v1.RouteTable, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListHubsRequest to JSON. + * Converts this RouteTable to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListHubsRequest + * Gets the default type url for RouteTable * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListHubsResponse. */ - interface IListHubsResponse { + /** Properties of a Route. */ + interface IRoute { - /** ListHubsResponse hubs */ - hubs?: (google.cloud.networkconnectivity.v1.IHub[]|null); + /** Route name */ + name?: (string|null); - /** ListHubsResponse nextPageToken */ - nextPageToken?: (string|null); + /** Route createTime */ + createTime?: (google.protobuf.ITimestamp|null); - /** ListHubsResponse unreachable */ - unreachable?: (string[]|null); + /** Route updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Route ipCidrRange */ + ipCidrRange?: (string|null); + + /** Route type */ + type?: (google.cloud.networkconnectivity.v1.RouteType|keyof typeof google.cloud.networkconnectivity.v1.RouteType|null); + + /** Route nextHopVpcNetwork */ + nextHopVpcNetwork?: (google.cloud.networkconnectivity.v1.INextHopVpcNetwork|null); + + /** Route labels */ + labels?: ({ [k: string]: string }|null); + + /** Route description */ + description?: (string|null); + + /** Route uid */ + uid?: (string|null); + + /** Route state */ + state?: (google.cloud.networkconnectivity.v1.State|keyof typeof google.cloud.networkconnectivity.v1.State|null); + + /** Route spoke */ + spoke?: (string|null); + + /** Route location */ + location?: (string|null); } - /** Represents a ListHubsResponse. */ - class ListHubsResponse implements IListHubsResponse { + /** Represents a Route. */ + class Route implements IRoute { /** - * Constructs a new ListHubsResponse. + * Constructs a new Route. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.networkconnectivity.v1.IListHubsResponse); + constructor(properties?: google.cloud.networkconnectivity.v1.IRoute); - /** ListHubsResponse hubs. */ - public hubs: google.cloud.networkconnectivity.v1.IHub[]; + /** Route name. */ + public name: string; - /** ListHubsResponse nextPageToken. */ - public nextPageToken: string; + /** Route createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); - /** ListHubsResponse unreachable. */ - public unreachable: string[]; + /** Route updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Route ipCidrRange. */ + public ipCidrRange: string; + + /** Route type. */ + public type: (google.cloud.networkconnectivity.v1.RouteType|keyof typeof google.cloud.networkconnectivity.v1.RouteType); + + /** Route nextHopVpcNetwork. */ + public nextHopVpcNetwork?: (google.cloud.networkconnectivity.v1.INextHopVpcNetwork|null); + + /** Route labels. */ + public labels: { [k: string]: string }; + + /** Route description. */ + public description: string; + + /** Route uid. */ + public uid: string; + + /** Route state. */ + public state: (google.cloud.networkconnectivity.v1.State|keyof typeof google.cloud.networkconnectivity.v1.State); + + /** Route spoke. */ + public spoke: string; + + /** Route location. */ + public location: string; /** - * Creates a new ListHubsResponse instance using the specified properties. + * Creates a new Route instance using the specified properties. * @param [properties] Properties to set - * @returns ListHubsResponse instance + * @returns Route instance */ - public static create(properties?: google.cloud.networkconnectivity.v1.IListHubsResponse): google.cloud.networkconnectivity.v1.ListHubsResponse; + public static create(properties?: google.cloud.networkconnectivity.v1.IRoute): google.cloud.networkconnectivity.v1.Route; /** - * Encodes the specified ListHubsResponse message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListHubsResponse.verify|verify} messages. - * @param message ListHubsResponse message or plain object to encode + * Encodes the specified Route message. Does not implicitly {@link google.cloud.networkconnectivity.v1.Route.verify|verify} messages. + * @param message Route message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.networkconnectivity.v1.IListHubsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.networkconnectivity.v1.IRoute, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListHubsResponse message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListHubsResponse.verify|verify} messages. - * @param message ListHubsResponse message or plain object to encode + * Encodes the specified Route message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.Route.verify|verify} messages. + * @param message Route message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IListHubsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IRoute, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListHubsResponse message from the specified reader or buffer. + * Decodes a Route message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListHubsResponse + * @returns Route * @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.ListHubsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networkconnectivity.v1.Route; /** - * Decodes a ListHubsResponse message from the specified reader or buffer, length delimited. + * Decodes a Route message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListHubsResponse + * @returns Route * @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.ListHubsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networkconnectivity.v1.Route; /** - * Verifies a ListHubsResponse message. + * Verifies a Route 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 ListHubsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a Route message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListHubsResponse + * @returns Route */ - public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.ListHubsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.Route; /** - * Creates a plain object from a ListHubsResponse message. Also converts values to other types if specified. - * @param message ListHubsResponse + * Creates a plain object from a Route message. Also converts values to other types if specified. + * @param message Route * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.networkconnectivity.v1.ListHubsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.networkconnectivity.v1.Route, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListHubsResponse to JSON. + * Converts this Route to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListHubsResponse + * Gets the default type url for Route * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a GetHubRequest. */ - interface IGetHubRequest { + /** Properties of a Group. */ + interface IGroup { - /** GetHubRequest name */ + /** Group name */ name?: (string|null); + + /** Group createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Group updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Group labels */ + labels?: ({ [k: string]: string }|null); + + /** Group description */ + description?: (string|null); + + /** Group uid */ + uid?: (string|null); + + /** Group state */ + state?: (google.cloud.networkconnectivity.v1.State|keyof typeof google.cloud.networkconnectivity.v1.State|null); } - /** Represents a GetHubRequest. */ - class GetHubRequest implements IGetHubRequest { + /** Represents a Group. */ + class Group implements IGroup { /** - * Constructs a new GetHubRequest. + * Constructs a new Group. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.networkconnectivity.v1.IGetHubRequest); + constructor(properties?: google.cloud.networkconnectivity.v1.IGroup); - /** GetHubRequest name. */ + /** Group name. */ public name: string; + /** Group createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Group updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Group labels. */ + public labels: { [k: string]: string }; + + /** Group description. */ + public description: string; + + /** Group uid. */ + public uid: string; + + /** Group state. */ + public state: (google.cloud.networkconnectivity.v1.State|keyof typeof google.cloud.networkconnectivity.v1.State); + /** - * Creates a new GetHubRequest instance using the specified properties. + * Creates a new Group instance using the specified properties. * @param [properties] Properties to set - * @returns GetHubRequest instance + * @returns Group instance */ - public static create(properties?: google.cloud.networkconnectivity.v1.IGetHubRequest): google.cloud.networkconnectivity.v1.GetHubRequest; + public static create(properties?: google.cloud.networkconnectivity.v1.IGroup): google.cloud.networkconnectivity.v1.Group; /** - * Encodes the specified GetHubRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.GetHubRequest.verify|verify} messages. - * @param message GetHubRequest message or plain object to encode + * Encodes the specified Group message. Does not implicitly {@link google.cloud.networkconnectivity.v1.Group.verify|verify} messages. + * @param message Group message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.networkconnectivity.v1.IGetHubRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.networkconnectivity.v1.IGroup, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetHubRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.GetHubRequest.verify|verify} messages. - * @param message GetHubRequest message or plain object to encode + * Encodes the specified Group message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.Group.verify|verify} messages. + * @param message Group message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IGetHubRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IGroup, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetHubRequest message from the specified reader or buffer. + * Decodes a Group message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetHubRequest + * @returns Group * @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.GetHubRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networkconnectivity.v1.Group; /** - * Decodes a GetHubRequest message from the specified reader or buffer, length delimited. + * Decodes a Group message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetHubRequest + * @returns Group * @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.GetHubRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networkconnectivity.v1.Group; /** - * Verifies a GetHubRequest message. + * Verifies a Group 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 GetHubRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Group message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetHubRequest + * @returns Group */ - public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.GetHubRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.Group; /** - * Creates a plain object from a GetHubRequest message. Also converts values to other types if specified. - * @param message GetHubRequest + * Creates a plain object from a Group message. Also converts values to other types if specified. + * @param message Group * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.networkconnectivity.v1.GetHubRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.networkconnectivity.v1.Group, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetHubRequest to JSON. + * Converts this Group to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GetHubRequest + * Gets the default type url for Group * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CreateHubRequest. */ - interface ICreateHubRequest { + /** Properties of a ListHubsRequest. */ + interface IListHubsRequest { - /** CreateHubRequest parent */ + /** ListHubsRequest parent */ parent?: (string|null); - /** CreateHubRequest hubId */ - hubId?: (string|null); + /** ListHubsRequest pageSize */ + pageSize?: (number|null); - /** CreateHubRequest hub */ - hub?: (google.cloud.networkconnectivity.v1.IHub|null); + /** ListHubsRequest pageToken */ + pageToken?: (string|null); - /** CreateHubRequest requestId */ - requestId?: (string|null); + /** ListHubsRequest filter */ + filter?: (string|null); + + /** ListHubsRequest orderBy */ + orderBy?: (string|null); } - /** Represents a CreateHubRequest. */ - class CreateHubRequest implements ICreateHubRequest { + /** Represents a ListHubsRequest. */ + class ListHubsRequest implements IListHubsRequest { /** - * Constructs a new CreateHubRequest. + * Constructs a new ListHubsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.networkconnectivity.v1.ICreateHubRequest); + constructor(properties?: google.cloud.networkconnectivity.v1.IListHubsRequest); - /** CreateHubRequest parent. */ + /** ListHubsRequest parent. */ public parent: string; - /** CreateHubRequest hubId. */ - public hubId: string; + /** ListHubsRequest pageSize. */ + public pageSize: number; - /** CreateHubRequest hub. */ - public hub?: (google.cloud.networkconnectivity.v1.IHub|null); + /** ListHubsRequest pageToken. */ + public pageToken: string; - /** CreateHubRequest requestId. */ - public requestId: string; + /** ListHubsRequest filter. */ + public filter: string; + + /** ListHubsRequest orderBy. */ + public orderBy: string; /** - * Creates a new CreateHubRequest instance using the specified properties. + * Creates a new ListHubsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateHubRequest instance + * @returns ListHubsRequest instance */ - public static create(properties?: google.cloud.networkconnectivity.v1.ICreateHubRequest): google.cloud.networkconnectivity.v1.CreateHubRequest; + public static create(properties?: google.cloud.networkconnectivity.v1.IListHubsRequest): google.cloud.networkconnectivity.v1.ListHubsRequest; /** - * Encodes the specified CreateHubRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.CreateHubRequest.verify|verify} messages. - * @param message CreateHubRequest message or plain object to encode + * Encodes the specified ListHubsRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListHubsRequest.verify|verify} messages. + * @param message ListHubsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.networkconnectivity.v1.ICreateHubRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.networkconnectivity.v1.IListHubsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateHubRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.CreateHubRequest.verify|verify} messages. - * @param message CreateHubRequest message or plain object to encode + * Encodes the specified ListHubsRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListHubsRequest.verify|verify} messages. + * @param message ListHubsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.networkconnectivity.v1.ICreateHubRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IListHubsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateHubRequest message from the specified reader or buffer. + * Decodes a ListHubsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateHubRequest + * @returns ListHubsRequest * @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.CreateHubRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networkconnectivity.v1.ListHubsRequest; /** - * Decodes a CreateHubRequest message from the specified reader or buffer, length delimited. + * Decodes a ListHubsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateHubRequest + * @returns ListHubsRequest * @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.CreateHubRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networkconnectivity.v1.ListHubsRequest; /** - * Verifies a CreateHubRequest message. + * Verifies a ListHubsRequest 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 CreateHubRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListHubsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateHubRequest + * @returns ListHubsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.CreateHubRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.ListHubsRequest; /** - * Creates a plain object from a CreateHubRequest message. Also converts values to other types if specified. - * @param message CreateHubRequest + * Creates a plain object from a ListHubsRequest message. Also converts values to other types if specified. + * @param message ListHubsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.networkconnectivity.v1.CreateHubRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.networkconnectivity.v1.ListHubsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateHubRequest to JSON. + * Converts this ListHubsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateHubRequest + * Gets the default type url for ListHubsRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an UpdateHubRequest. */ - interface IUpdateHubRequest { + /** Properties of a ListHubsResponse. */ + interface IListHubsResponse { - /** UpdateHubRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** ListHubsResponse hubs */ + hubs?: (google.cloud.networkconnectivity.v1.IHub[]|null); - /** UpdateHubRequest hub */ - hub?: (google.cloud.networkconnectivity.v1.IHub|null); + /** ListHubsResponse nextPageToken */ + nextPageToken?: (string|null); - /** UpdateHubRequest requestId */ - requestId?: (string|null); + /** ListHubsResponse unreachable */ + unreachable?: (string[]|null); } - /** Represents an UpdateHubRequest. */ - class UpdateHubRequest implements IUpdateHubRequest { + /** Represents a ListHubsResponse. */ + class ListHubsResponse implements IListHubsResponse { /** - * Constructs a new UpdateHubRequest. + * Constructs a new ListHubsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.networkconnectivity.v1.IUpdateHubRequest); + constructor(properties?: google.cloud.networkconnectivity.v1.IListHubsResponse); - /** UpdateHubRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** ListHubsResponse hubs. */ + public hubs: google.cloud.networkconnectivity.v1.IHub[]; - /** UpdateHubRequest hub. */ - public hub?: (google.cloud.networkconnectivity.v1.IHub|null); + /** ListHubsResponse nextPageToken. */ + public nextPageToken: string; - /** UpdateHubRequest requestId. */ - public requestId: string; + /** ListHubsResponse unreachable. */ + public unreachable: string[]; /** - * Creates a new UpdateHubRequest instance using the specified properties. + * Creates a new ListHubsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateHubRequest instance + * @returns ListHubsResponse instance */ - public static create(properties?: google.cloud.networkconnectivity.v1.IUpdateHubRequest): google.cloud.networkconnectivity.v1.UpdateHubRequest; + public static create(properties?: google.cloud.networkconnectivity.v1.IListHubsResponse): google.cloud.networkconnectivity.v1.ListHubsResponse; /** - * Encodes the specified UpdateHubRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.UpdateHubRequest.verify|verify} messages. - * @param message UpdateHubRequest message or plain object to encode + * Encodes the specified ListHubsResponse message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListHubsResponse.verify|verify} messages. + * @param message ListHubsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.networkconnectivity.v1.IUpdateHubRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.networkconnectivity.v1.IListHubsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateHubRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.UpdateHubRequest.verify|verify} messages. - * @param message UpdateHubRequest message or plain object to encode + * Encodes the specified ListHubsResponse message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListHubsResponse.verify|verify} messages. + * @param message ListHubsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IUpdateHubRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IListHubsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateHubRequest message from the specified reader or buffer. + * Decodes a ListHubsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateHubRequest + * @returns ListHubsResponse * @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.UpdateHubRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networkconnectivity.v1.ListHubsResponse; /** - * Decodes an UpdateHubRequest message from the specified reader or buffer, length delimited. + * Decodes a ListHubsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateHubRequest + * @returns ListHubsResponse * @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.UpdateHubRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networkconnectivity.v1.ListHubsResponse; /** - * Verifies an UpdateHubRequest message. + * Verifies a ListHubsResponse 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 UpdateHubRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListHubsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateHubRequest + * @returns ListHubsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.UpdateHubRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.ListHubsResponse; /** - * Creates a plain object from an UpdateHubRequest message. Also converts values to other types if specified. - * @param message UpdateHubRequest + * Creates a plain object from a ListHubsResponse message. Also converts values to other types if specified. + * @param message ListHubsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.networkconnectivity.v1.UpdateHubRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.networkconnectivity.v1.ListHubsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateHubRequest to JSON. + * Converts this ListHubsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UpdateHubRequest + * Gets the default type url for ListHubsResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a DeleteHubRequest. */ - interface IDeleteHubRequest { + /** Properties of a GetHubRequest. */ + interface IGetHubRequest { - /** DeleteHubRequest name */ + /** GetHubRequest name */ name?: (string|null); - - /** DeleteHubRequest requestId */ - requestId?: (string|null); } - /** Represents a DeleteHubRequest. */ - class DeleteHubRequest implements IDeleteHubRequest { + /** Represents a GetHubRequest. */ + class GetHubRequest implements IGetHubRequest { /** - * Constructs a new DeleteHubRequest. + * Constructs a new GetHubRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.networkconnectivity.v1.IDeleteHubRequest); + constructor(properties?: google.cloud.networkconnectivity.v1.IGetHubRequest); - /** DeleteHubRequest name. */ + /** GetHubRequest name. */ public name: string; - /** DeleteHubRequest requestId. */ - public requestId: string; - /** - * Creates a new DeleteHubRequest instance using the specified properties. + * Creates a new GetHubRequest instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteHubRequest instance + * @returns GetHubRequest instance */ - public static create(properties?: google.cloud.networkconnectivity.v1.IDeleteHubRequest): google.cloud.networkconnectivity.v1.DeleteHubRequest; + public static create(properties?: google.cloud.networkconnectivity.v1.IGetHubRequest): google.cloud.networkconnectivity.v1.GetHubRequest; /** - * Encodes the specified DeleteHubRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.DeleteHubRequest.verify|verify} messages. - * @param message DeleteHubRequest message or plain object to encode + * Encodes the specified GetHubRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.GetHubRequest.verify|verify} messages. + * @param message GetHubRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.networkconnectivity.v1.IDeleteHubRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.networkconnectivity.v1.IGetHubRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteHubRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.DeleteHubRequest.verify|verify} messages. - * @param message DeleteHubRequest message or plain object to encode + * Encodes the specified GetHubRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.GetHubRequest.verify|verify} messages. + * @param message GetHubRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IDeleteHubRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IGetHubRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteHubRequest message from the specified reader or buffer. + * Decodes a GetHubRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteHubRequest + * @returns GetHubRequest * @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.DeleteHubRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networkconnectivity.v1.GetHubRequest; /** - * Decodes a DeleteHubRequest message from the specified reader or buffer, length delimited. + * Decodes a GetHubRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteHubRequest + * @returns GetHubRequest * @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.DeleteHubRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networkconnectivity.v1.GetHubRequest; /** - * Verifies a DeleteHubRequest message. + * Verifies a GetHubRequest 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 DeleteHubRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetHubRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteHubRequest + * @returns GetHubRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.DeleteHubRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.GetHubRequest; /** - * Creates a plain object from a DeleteHubRequest message. Also converts values to other types if specified. - * @param message DeleteHubRequest + * Creates a plain object from a GetHubRequest message. Also converts values to other types if specified. + * @param message GetHubRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.networkconnectivity.v1.DeleteHubRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.networkconnectivity.v1.GetHubRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteHubRequest to JSON. + * Converts this GetHubRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DeleteHubRequest + * Gets the default type url for GetHubRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListSpokesRequest. */ - interface IListSpokesRequest { + /** Properties of a CreateHubRequest. */ + interface ICreateHubRequest { - /** ListSpokesRequest parent */ + /** CreateHubRequest parent */ parent?: (string|null); - /** ListSpokesRequest pageSize */ - pageSize?: (number|null); - - /** ListSpokesRequest pageToken */ - pageToken?: (string|null); + /** CreateHubRequest hubId */ + hubId?: (string|null); - /** ListSpokesRequest filter */ - filter?: (string|null); + /** CreateHubRequest hub */ + hub?: (google.cloud.networkconnectivity.v1.IHub|null); - /** ListSpokesRequest orderBy */ - orderBy?: (string|null); + /** CreateHubRequest requestId */ + requestId?: (string|null); } - /** Represents a ListSpokesRequest. */ - class ListSpokesRequest implements IListSpokesRequest { + /** Represents a CreateHubRequest. */ + class CreateHubRequest implements ICreateHubRequest { /** - * Constructs a new ListSpokesRequest. + * Constructs a new CreateHubRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.networkconnectivity.v1.IListSpokesRequest); + constructor(properties?: google.cloud.networkconnectivity.v1.ICreateHubRequest); - /** ListSpokesRequest parent. */ + /** CreateHubRequest parent. */ public parent: string; - /** ListSpokesRequest pageSize. */ - public pageSize: number; - - /** ListSpokesRequest pageToken. */ - public pageToken: string; + /** CreateHubRequest hubId. */ + public hubId: string; - /** ListSpokesRequest filter. */ - public filter: string; + /** CreateHubRequest hub. */ + public hub?: (google.cloud.networkconnectivity.v1.IHub|null); - /** ListSpokesRequest orderBy. */ - public orderBy: string; + /** CreateHubRequest requestId. */ + public requestId: string; /** - * Creates a new ListSpokesRequest instance using the specified properties. + * Creates a new CreateHubRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListSpokesRequest instance + * @returns CreateHubRequest instance */ - public static create(properties?: google.cloud.networkconnectivity.v1.IListSpokesRequest): google.cloud.networkconnectivity.v1.ListSpokesRequest; + public static create(properties?: google.cloud.networkconnectivity.v1.ICreateHubRequest): google.cloud.networkconnectivity.v1.CreateHubRequest; /** - * Encodes the specified ListSpokesRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListSpokesRequest.verify|verify} messages. - * @param message ListSpokesRequest message or plain object to encode + * Encodes the specified CreateHubRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.CreateHubRequest.verify|verify} messages. + * @param message CreateHubRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.networkconnectivity.v1.IListSpokesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.networkconnectivity.v1.ICreateHubRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListSpokesRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListSpokesRequest.verify|verify} messages. - * @param message ListSpokesRequest message or plain object to encode + * Encodes the specified CreateHubRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.CreateHubRequest.verify|verify} messages. + * @param message CreateHubRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IListSpokesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.ICreateHubRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListSpokesRequest message from the specified reader or buffer. + * Decodes a CreateHubRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListSpokesRequest + * @returns CreateHubRequest * @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.ListSpokesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networkconnectivity.v1.CreateHubRequest; /** - * Decodes a ListSpokesRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateHubRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListSpokesRequest + * @returns CreateHubRequest * @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.ListSpokesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networkconnectivity.v1.CreateHubRequest; /** - * Verifies a ListSpokesRequest message. + * Verifies a CreateHubRequest 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 ListSpokesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateHubRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListSpokesRequest + * @returns CreateHubRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.ListSpokesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.CreateHubRequest; /** - * Creates a plain object from a ListSpokesRequest message. Also converts values to other types if specified. - * @param message ListSpokesRequest + * Creates a plain object from a CreateHubRequest message. Also converts values to other types if specified. + * @param message CreateHubRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.networkconnectivity.v1.ListSpokesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.networkconnectivity.v1.CreateHubRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListSpokesRequest to JSON. + * Converts this CreateHubRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListSpokesRequest + * Gets the default type url for CreateHubRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListSpokesResponse. */ - interface IListSpokesResponse { + /** Properties of an UpdateHubRequest. */ + interface IUpdateHubRequest { - /** ListSpokesResponse spokes */ - spokes?: (google.cloud.networkconnectivity.v1.ISpoke[]|null); + /** UpdateHubRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); - /** ListSpokesResponse nextPageToken */ - nextPageToken?: (string|null); + /** UpdateHubRequest hub */ + hub?: (google.cloud.networkconnectivity.v1.IHub|null); - /** ListSpokesResponse unreachable */ - unreachable?: (string[]|null); + /** UpdateHubRequest requestId */ + requestId?: (string|null); } - /** Represents a ListSpokesResponse. */ - class ListSpokesResponse implements IListSpokesResponse { + /** Represents an UpdateHubRequest. */ + class UpdateHubRequest implements IUpdateHubRequest { /** - * Constructs a new ListSpokesResponse. + * Constructs a new UpdateHubRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.networkconnectivity.v1.IListSpokesResponse); + constructor(properties?: google.cloud.networkconnectivity.v1.IUpdateHubRequest); - /** ListSpokesResponse spokes. */ - public spokes: google.cloud.networkconnectivity.v1.ISpoke[]; + /** UpdateHubRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); - /** ListSpokesResponse nextPageToken. */ - public nextPageToken: string; + /** UpdateHubRequest hub. */ + public hub?: (google.cloud.networkconnectivity.v1.IHub|null); - /** ListSpokesResponse unreachable. */ - public unreachable: string[]; + /** UpdateHubRequest requestId. */ + public requestId: string; /** - * Creates a new ListSpokesResponse instance using the specified properties. + * Creates a new UpdateHubRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListSpokesResponse instance + * @returns UpdateHubRequest instance */ - public static create(properties?: google.cloud.networkconnectivity.v1.IListSpokesResponse): google.cloud.networkconnectivity.v1.ListSpokesResponse; + public static create(properties?: google.cloud.networkconnectivity.v1.IUpdateHubRequest): google.cloud.networkconnectivity.v1.UpdateHubRequest; /** - * Encodes the specified ListSpokesResponse message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListSpokesResponse.verify|verify} messages. - * @param message ListSpokesResponse message or plain object to encode + * Encodes the specified UpdateHubRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.UpdateHubRequest.verify|verify} messages. + * @param message UpdateHubRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.networkconnectivity.v1.IListSpokesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.networkconnectivity.v1.IUpdateHubRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListSpokesResponse message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListSpokesResponse.verify|verify} messages. - * @param message ListSpokesResponse message or plain object to encode + * Encodes the specified UpdateHubRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.UpdateHubRequest.verify|verify} messages. + * @param message UpdateHubRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IListSpokesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IUpdateHubRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListSpokesResponse message from the specified reader or buffer. + * Decodes an UpdateHubRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListSpokesResponse + * @returns UpdateHubRequest * @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.ListSpokesResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networkconnectivity.v1.UpdateHubRequest; /** - * Decodes a ListSpokesResponse message from the specified reader or buffer, length delimited. + * Decodes an UpdateHubRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListSpokesResponse + * @returns UpdateHubRequest * @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.ListSpokesResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networkconnectivity.v1.UpdateHubRequest; /** - * Verifies a ListSpokesResponse message. + * Verifies an UpdateHubRequest 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 ListSpokesResponse message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateHubRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListSpokesResponse + * @returns UpdateHubRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.ListSpokesResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.UpdateHubRequest; /** - * Creates a plain object from a ListSpokesResponse message. Also converts values to other types if specified. - * @param message ListSpokesResponse + * Creates a plain object from an UpdateHubRequest message. Also converts values to other types if specified. + * @param message UpdateHubRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.networkconnectivity.v1.ListSpokesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.networkconnectivity.v1.UpdateHubRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListSpokesResponse to JSON. + * Converts this UpdateHubRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListSpokesResponse + * Gets the default type url for UpdateHubRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a GetSpokeRequest. */ - interface IGetSpokeRequest { + /** Properties of a DeleteHubRequest. */ + interface IDeleteHubRequest { - /** GetSpokeRequest name */ + /** DeleteHubRequest name */ name?: (string|null); + + /** DeleteHubRequest requestId */ + requestId?: (string|null); } - /** Represents a GetSpokeRequest. */ - class GetSpokeRequest implements IGetSpokeRequest { + /** Represents a DeleteHubRequest. */ + class DeleteHubRequest implements IDeleteHubRequest { /** - * Constructs a new GetSpokeRequest. + * Constructs a new DeleteHubRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.networkconnectivity.v1.IGetSpokeRequest); + constructor(properties?: google.cloud.networkconnectivity.v1.IDeleteHubRequest); - /** GetSpokeRequest name. */ + /** DeleteHubRequest name. */ public name: string; + /** DeleteHubRequest requestId. */ + public requestId: string; + /** - * Creates a new GetSpokeRequest instance using the specified properties. + * Creates a new DeleteHubRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GetSpokeRequest instance + * @returns DeleteHubRequest instance */ - public static create(properties?: google.cloud.networkconnectivity.v1.IGetSpokeRequest): google.cloud.networkconnectivity.v1.GetSpokeRequest; + public static create(properties?: google.cloud.networkconnectivity.v1.IDeleteHubRequest): google.cloud.networkconnectivity.v1.DeleteHubRequest; /** - * Encodes the specified GetSpokeRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.GetSpokeRequest.verify|verify} messages. - * @param message GetSpokeRequest message or plain object to encode + * Encodes the specified DeleteHubRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.DeleteHubRequest.verify|verify} messages. + * @param message DeleteHubRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.networkconnectivity.v1.IGetSpokeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.networkconnectivity.v1.IDeleteHubRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetSpokeRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.GetSpokeRequest.verify|verify} messages. - * @param message GetSpokeRequest message or plain object to encode + * Encodes the specified DeleteHubRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.DeleteHubRequest.verify|verify} messages. + * @param message DeleteHubRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IGetSpokeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IDeleteHubRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetSpokeRequest message from the specified reader or buffer. + * Decodes a DeleteHubRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetSpokeRequest + * @returns DeleteHubRequest * @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.GetSpokeRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networkconnectivity.v1.DeleteHubRequest; /** - * Decodes a GetSpokeRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteHubRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetSpokeRequest + * @returns DeleteHubRequest * @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.GetSpokeRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networkconnectivity.v1.DeleteHubRequest; /** - * Verifies a GetSpokeRequest message. + * Verifies a DeleteHubRequest 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 GetSpokeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteHubRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetSpokeRequest + * @returns DeleteHubRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.GetSpokeRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.DeleteHubRequest; /** - * Creates a plain object from a GetSpokeRequest message. Also converts values to other types if specified. - * @param message GetSpokeRequest + * Creates a plain object from a DeleteHubRequest message. Also converts values to other types if specified. + * @param message DeleteHubRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.networkconnectivity.v1.GetSpokeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.networkconnectivity.v1.DeleteHubRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetSpokeRequest to JSON. + * Converts this DeleteHubRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GetSpokeRequest + * Gets the default type url for DeleteHubRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a CreateSpokeRequest. */ - interface ICreateSpokeRequest { + /** Properties of a ListHubSpokesRequest. */ + interface IListHubSpokesRequest { - /** CreateSpokeRequest parent */ - parent?: (string|null); + /** ListHubSpokesRequest name */ + name?: (string|null); - /** CreateSpokeRequest spokeId */ - spokeId?: (string|null); + /** ListHubSpokesRequest spokeLocations */ + spokeLocations?: (string[]|null); - /** CreateSpokeRequest spoke */ - spoke?: (google.cloud.networkconnectivity.v1.ISpoke|null); + /** ListHubSpokesRequest pageSize */ + pageSize?: (number|null); - /** CreateSpokeRequest requestId */ - requestId?: (string|null); + /** ListHubSpokesRequest pageToken */ + pageToken?: (string|null); + + /** ListHubSpokesRequest filter */ + filter?: (string|null); + + /** ListHubSpokesRequest orderBy */ + orderBy?: (string|null); + + /** ListHubSpokesRequest view */ + view?: (google.cloud.networkconnectivity.v1.ListHubSpokesRequest.SpokeView|keyof typeof google.cloud.networkconnectivity.v1.ListHubSpokesRequest.SpokeView|null); } - /** Represents a CreateSpokeRequest. */ - class CreateSpokeRequest implements ICreateSpokeRequest { + /** Represents a ListHubSpokesRequest. */ + class ListHubSpokesRequest implements IListHubSpokesRequest { /** - * Constructs a new CreateSpokeRequest. + * Constructs a new ListHubSpokesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.networkconnectivity.v1.ICreateSpokeRequest); + constructor(properties?: google.cloud.networkconnectivity.v1.IListHubSpokesRequest); - /** CreateSpokeRequest parent. */ - public parent: string; + /** ListHubSpokesRequest name. */ + public name: string; - /** CreateSpokeRequest spokeId. */ - public spokeId: string; + /** ListHubSpokesRequest spokeLocations. */ + public spokeLocations: string[]; - /** CreateSpokeRequest spoke. */ - public spoke?: (google.cloud.networkconnectivity.v1.ISpoke|null); + /** ListHubSpokesRequest pageSize. */ + public pageSize: number; - /** CreateSpokeRequest requestId. */ - public requestId: string; + /** ListHubSpokesRequest pageToken. */ + public pageToken: string; + + /** ListHubSpokesRequest filter. */ + public filter: string; + + /** ListHubSpokesRequest orderBy. */ + public orderBy: string; + + /** ListHubSpokesRequest view. */ + public view: (google.cloud.networkconnectivity.v1.ListHubSpokesRequest.SpokeView|keyof typeof google.cloud.networkconnectivity.v1.ListHubSpokesRequest.SpokeView); /** - * Creates a new CreateSpokeRequest instance using the specified properties. + * Creates a new ListHubSpokesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateSpokeRequest instance + * @returns ListHubSpokesRequest instance */ - public static create(properties?: google.cloud.networkconnectivity.v1.ICreateSpokeRequest): google.cloud.networkconnectivity.v1.CreateSpokeRequest; + public static create(properties?: google.cloud.networkconnectivity.v1.IListHubSpokesRequest): google.cloud.networkconnectivity.v1.ListHubSpokesRequest; /** - * Encodes the specified CreateSpokeRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.CreateSpokeRequest.verify|verify} messages. - * @param message CreateSpokeRequest message or plain object to encode + * Encodes the specified ListHubSpokesRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListHubSpokesRequest.verify|verify} messages. + * @param message ListHubSpokesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.networkconnectivity.v1.ICreateSpokeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.networkconnectivity.v1.IListHubSpokesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateSpokeRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.CreateSpokeRequest.verify|verify} messages. - * @param message CreateSpokeRequest message or plain object to encode + * Encodes the specified ListHubSpokesRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListHubSpokesRequest.verify|verify} messages. + * @param message ListHubSpokesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.networkconnectivity.v1.ICreateSpokeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IListHubSpokesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateSpokeRequest message from the specified reader or buffer. + * Decodes a ListHubSpokesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateSpokeRequest + * @returns ListHubSpokesRequest * @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.CreateSpokeRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networkconnectivity.v1.ListHubSpokesRequest; /** - * Decodes a CreateSpokeRequest message from the specified reader or buffer, length delimited. + * Decodes a ListHubSpokesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateSpokeRequest + * @returns ListHubSpokesRequest * @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.CreateSpokeRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networkconnectivity.v1.ListHubSpokesRequest; /** - * Verifies a CreateSpokeRequest message. + * Verifies a ListHubSpokesRequest 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 CreateSpokeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListHubSpokesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateSpokeRequest + * @returns ListHubSpokesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.CreateSpokeRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.ListHubSpokesRequest; /** - * Creates a plain object from a CreateSpokeRequest message. Also converts values to other types if specified. - * @param message CreateSpokeRequest + * Creates a plain object from a ListHubSpokesRequest message. Also converts values to other types if specified. + * @param message ListHubSpokesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.networkconnectivity.v1.CreateSpokeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.networkconnectivity.v1.ListHubSpokesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateSpokeRequest to JSON. + * Converts this ListHubSpokesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateSpokeRequest + * Gets the default type url for ListHubSpokesRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an UpdateSpokeRequest. */ - interface IUpdateSpokeRequest { + namespace ListHubSpokesRequest { - /** UpdateSpokeRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** SpokeView enum. */ + enum SpokeView { + SPOKE_VIEW_UNSPECIFIED = 0, + BASIC = 1, + DETAILED = 2 + } + } - /** UpdateSpokeRequest spoke */ - spoke?: (google.cloud.networkconnectivity.v1.ISpoke|null); + /** Properties of a ListHubSpokesResponse. */ + interface IListHubSpokesResponse { - /** UpdateSpokeRequest requestId */ - requestId?: (string|null); + /** ListHubSpokesResponse spokes */ + spokes?: (google.cloud.networkconnectivity.v1.ISpoke[]|null); + + /** ListHubSpokesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListHubSpokesResponse unreachable */ + unreachable?: (string[]|null); } - /** Represents an UpdateSpokeRequest. */ - class UpdateSpokeRequest implements IUpdateSpokeRequest { + /** Represents a ListHubSpokesResponse. */ + class ListHubSpokesResponse implements IListHubSpokesResponse { /** - * Constructs a new UpdateSpokeRequest. + * Constructs a new ListHubSpokesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.networkconnectivity.v1.IUpdateSpokeRequest); + constructor(properties?: google.cloud.networkconnectivity.v1.IListHubSpokesResponse); - /** UpdateSpokeRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** ListHubSpokesResponse spokes. */ + public spokes: google.cloud.networkconnectivity.v1.ISpoke[]; - /** UpdateSpokeRequest spoke. */ - public spoke?: (google.cloud.networkconnectivity.v1.ISpoke|null); + /** ListHubSpokesResponse nextPageToken. */ + public nextPageToken: string; - /** UpdateSpokeRequest requestId. */ - public requestId: string; + /** ListHubSpokesResponse unreachable. */ + public unreachable: string[]; /** - * Creates a new UpdateSpokeRequest instance using the specified properties. + * Creates a new ListHubSpokesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateSpokeRequest instance + * @returns ListHubSpokesResponse instance */ - public static create(properties?: google.cloud.networkconnectivity.v1.IUpdateSpokeRequest): google.cloud.networkconnectivity.v1.UpdateSpokeRequest; + public static create(properties?: google.cloud.networkconnectivity.v1.IListHubSpokesResponse): google.cloud.networkconnectivity.v1.ListHubSpokesResponse; /** - * Encodes the specified UpdateSpokeRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.UpdateSpokeRequest.verify|verify} messages. - * @param message UpdateSpokeRequest message or plain object to encode + * Encodes the specified ListHubSpokesResponse message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListHubSpokesResponse.verify|verify} messages. + * @param message ListHubSpokesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.networkconnectivity.v1.IUpdateSpokeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.networkconnectivity.v1.IListHubSpokesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateSpokeRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.UpdateSpokeRequest.verify|verify} messages. - * @param message UpdateSpokeRequest message or plain object to encode + * Encodes the specified ListHubSpokesResponse message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListHubSpokesResponse.verify|verify} messages. + * @param message ListHubSpokesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IUpdateSpokeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IListHubSpokesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateSpokeRequest message from the specified reader or buffer. + * Decodes a ListHubSpokesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateSpokeRequest + * @returns ListHubSpokesResponse * @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.UpdateSpokeRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networkconnectivity.v1.ListHubSpokesResponse; /** - * Decodes an UpdateSpokeRequest message from the specified reader or buffer, length delimited. + * Decodes a ListHubSpokesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateSpokeRequest + * @returns ListHubSpokesResponse * @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.UpdateSpokeRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networkconnectivity.v1.ListHubSpokesResponse; /** - * Verifies an UpdateSpokeRequest message. + * Verifies a ListHubSpokesResponse 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 UpdateSpokeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListHubSpokesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateSpokeRequest + * @returns ListHubSpokesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.UpdateSpokeRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.ListHubSpokesResponse; /** - * Creates a plain object from an UpdateSpokeRequest message. Also converts values to other types if specified. - * @param message UpdateSpokeRequest + * Creates a plain object from a ListHubSpokesResponse message. Also converts values to other types if specified. + * @param message ListHubSpokesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.networkconnectivity.v1.UpdateSpokeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.networkconnectivity.v1.ListHubSpokesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateSpokeRequest to JSON. + * Converts this ListHubSpokesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UpdateSpokeRequest + * Gets the default type url for ListHubSpokesResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a DeleteSpokeRequest. */ - interface IDeleteSpokeRequest { + /** Properties of a ListSpokesRequest. */ + interface IListSpokesRequest { - /** DeleteSpokeRequest name */ - name?: (string|null); + /** ListSpokesRequest parent */ + parent?: (string|null); - /** DeleteSpokeRequest requestId */ - requestId?: (string|null); + /** ListSpokesRequest pageSize */ + pageSize?: (number|null); + + /** ListSpokesRequest pageToken */ + pageToken?: (string|null); + + /** ListSpokesRequest filter */ + filter?: (string|null); + + /** ListSpokesRequest orderBy */ + orderBy?: (string|null); } - /** Represents a DeleteSpokeRequest. */ - class DeleteSpokeRequest implements IDeleteSpokeRequest { + /** Represents a ListSpokesRequest. */ + class ListSpokesRequest implements IListSpokesRequest { /** - * Constructs a new DeleteSpokeRequest. + * Constructs a new ListSpokesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.networkconnectivity.v1.IDeleteSpokeRequest); + constructor(properties?: google.cloud.networkconnectivity.v1.IListSpokesRequest); - /** DeleteSpokeRequest name. */ - public name: string; + /** ListSpokesRequest parent. */ + public parent: string; - /** DeleteSpokeRequest requestId. */ - public requestId: string; + /** ListSpokesRequest pageSize. */ + public pageSize: number; + + /** ListSpokesRequest pageToken. */ + public pageToken: string; + + /** ListSpokesRequest filter. */ + public filter: string; + + /** ListSpokesRequest orderBy. */ + public orderBy: string; /** - * Creates a new DeleteSpokeRequest instance using the specified properties. + * Creates a new ListSpokesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteSpokeRequest instance + * @returns ListSpokesRequest instance */ - public static create(properties?: google.cloud.networkconnectivity.v1.IDeleteSpokeRequest): google.cloud.networkconnectivity.v1.DeleteSpokeRequest; + public static create(properties?: google.cloud.networkconnectivity.v1.IListSpokesRequest): google.cloud.networkconnectivity.v1.ListSpokesRequest; /** - * Encodes the specified DeleteSpokeRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.DeleteSpokeRequest.verify|verify} messages. - * @param message DeleteSpokeRequest message or plain object to encode + * Encodes the specified ListSpokesRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListSpokesRequest.verify|verify} messages. + * @param message ListSpokesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.networkconnectivity.v1.IDeleteSpokeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.networkconnectivity.v1.IListSpokesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteSpokeRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.DeleteSpokeRequest.verify|verify} messages. - * @param message DeleteSpokeRequest message or plain object to encode + * Encodes the specified ListSpokesRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListSpokesRequest.verify|verify} messages. + * @param message ListSpokesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IDeleteSpokeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IListSpokesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteSpokeRequest message from the specified reader or buffer. + * Decodes a ListSpokesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteSpokeRequest + * @returns ListSpokesRequest * @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.DeleteSpokeRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networkconnectivity.v1.ListSpokesRequest; /** - * Decodes a DeleteSpokeRequest message from the specified reader or buffer, length delimited. + * Decodes a ListSpokesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteSpokeRequest + * @returns ListSpokesRequest * @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.DeleteSpokeRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networkconnectivity.v1.ListSpokesRequest; /** - * Verifies a DeleteSpokeRequest message. + * Verifies a ListSpokesRequest 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 DeleteSpokeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListSpokesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteSpokeRequest + * @returns ListSpokesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.DeleteSpokeRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.ListSpokesRequest; /** - * Creates a plain object from a DeleteSpokeRequest message. Also converts values to other types if specified. - * @param message DeleteSpokeRequest + * Creates a plain object from a ListSpokesRequest message. Also converts values to other types if specified. + * @param message ListSpokesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.networkconnectivity.v1.DeleteSpokeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.networkconnectivity.v1.ListSpokesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteSpokeRequest to JSON. + * Converts this ListSpokesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DeleteSpokeRequest + * Gets the default type url for ListSpokesRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a LinkedVpnTunnels. */ - interface ILinkedVpnTunnels { + /** Properties of a ListSpokesResponse. */ + interface IListSpokesResponse { - /** LinkedVpnTunnels uris */ - uris?: (string[]|null); + /** ListSpokesResponse spokes */ + spokes?: (google.cloud.networkconnectivity.v1.ISpoke[]|null); - /** LinkedVpnTunnels siteToSiteDataTransfer */ - siteToSiteDataTransfer?: (boolean|null); + /** ListSpokesResponse nextPageToken */ + nextPageToken?: (string|null); - /** LinkedVpnTunnels vpcNetwork */ - vpcNetwork?: (string|null); + /** ListSpokesResponse unreachable */ + unreachable?: (string[]|null); } - /** Represents a LinkedVpnTunnels. */ - class LinkedVpnTunnels implements ILinkedVpnTunnels { + /** Represents a ListSpokesResponse. */ + class ListSpokesResponse implements IListSpokesResponse { /** - * Constructs a new LinkedVpnTunnels. + * Constructs a new ListSpokesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.networkconnectivity.v1.ILinkedVpnTunnels); + constructor(properties?: google.cloud.networkconnectivity.v1.IListSpokesResponse); - /** LinkedVpnTunnels uris. */ - public uris: string[]; + /** ListSpokesResponse spokes. */ + public spokes: google.cloud.networkconnectivity.v1.ISpoke[]; - /** LinkedVpnTunnels siteToSiteDataTransfer. */ - public siteToSiteDataTransfer: boolean; + /** ListSpokesResponse nextPageToken. */ + public nextPageToken: string; - /** LinkedVpnTunnels vpcNetwork. */ - public vpcNetwork: string; + /** ListSpokesResponse unreachable. */ + public unreachable: string[]; /** - * Creates a new LinkedVpnTunnels instance using the specified properties. + * Creates a new ListSpokesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns LinkedVpnTunnels instance + * @returns ListSpokesResponse instance */ - public static create(properties?: google.cloud.networkconnectivity.v1.ILinkedVpnTunnels): google.cloud.networkconnectivity.v1.LinkedVpnTunnels; + public static create(properties?: google.cloud.networkconnectivity.v1.IListSpokesResponse): google.cloud.networkconnectivity.v1.ListSpokesResponse; /** - * Encodes the specified LinkedVpnTunnels message. Does not implicitly {@link google.cloud.networkconnectivity.v1.LinkedVpnTunnels.verify|verify} messages. - * @param message LinkedVpnTunnels message or plain object to encode + * Encodes the specified ListSpokesResponse message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListSpokesResponse.verify|verify} messages. + * @param message ListSpokesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.networkconnectivity.v1.ILinkedVpnTunnels, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.networkconnectivity.v1.IListSpokesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified LinkedVpnTunnels message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.LinkedVpnTunnels.verify|verify} messages. - * @param message LinkedVpnTunnels message or plain object to encode + * Encodes the specified ListSpokesResponse message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListSpokesResponse.verify|verify} messages. + * @param message ListSpokesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.networkconnectivity.v1.ILinkedVpnTunnels, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IListSpokesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a LinkedVpnTunnels message from the specified reader or buffer. + * Decodes a ListSpokesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns LinkedVpnTunnels + * @returns ListSpokesResponse * @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.LinkedVpnTunnels; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networkconnectivity.v1.ListSpokesResponse; /** - * Decodes a LinkedVpnTunnels message from the specified reader or buffer, length delimited. + * Decodes a ListSpokesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns LinkedVpnTunnels + * @returns ListSpokesResponse * @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.LinkedVpnTunnels; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networkconnectivity.v1.ListSpokesResponse; /** - * Verifies a LinkedVpnTunnels message. + * Verifies a ListSpokesResponse 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 LinkedVpnTunnels message from a plain object. Also converts values to their respective internal types. + * Creates a ListSpokesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns LinkedVpnTunnels + * @returns ListSpokesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.LinkedVpnTunnels; + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.ListSpokesResponse; /** - * Creates a plain object from a LinkedVpnTunnels message. Also converts values to other types if specified. - * @param message LinkedVpnTunnels + * Creates a plain object from a ListSpokesResponse message. Also converts values to other types if specified. + * @param message ListSpokesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.networkconnectivity.v1.LinkedVpnTunnels, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.networkconnectivity.v1.ListSpokesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this LinkedVpnTunnels to JSON. + * Converts this ListSpokesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for LinkedVpnTunnels + * Gets the default type url for ListSpokesResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a LinkedInterconnectAttachments. */ - interface ILinkedInterconnectAttachments { - - /** LinkedInterconnectAttachments uris */ - uris?: (string[]|null); - - /** LinkedInterconnectAttachments siteToSiteDataTransfer */ - siteToSiteDataTransfer?: (boolean|null); + /** Properties of a GetSpokeRequest. */ + interface IGetSpokeRequest { - /** LinkedInterconnectAttachments vpcNetwork */ - vpcNetwork?: (string|null); + /** GetSpokeRequest name */ + name?: (string|null); } - /** Represents a LinkedInterconnectAttachments. */ - class LinkedInterconnectAttachments implements ILinkedInterconnectAttachments { + /** Represents a GetSpokeRequest. */ + class GetSpokeRequest implements IGetSpokeRequest { /** - * Constructs a new LinkedInterconnectAttachments. + * Constructs a new GetSpokeRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.networkconnectivity.v1.ILinkedInterconnectAttachments); - - /** LinkedInterconnectAttachments uris. */ - public uris: string[]; - - /** LinkedInterconnectAttachments siteToSiteDataTransfer. */ - public siteToSiteDataTransfer: boolean; + constructor(properties?: google.cloud.networkconnectivity.v1.IGetSpokeRequest); - /** LinkedInterconnectAttachments vpcNetwork. */ - public vpcNetwork: string; + /** GetSpokeRequest name. */ + public name: string; /** - * Creates a new LinkedInterconnectAttachments instance using the specified properties. + * Creates a new GetSpokeRequest instance using the specified properties. * @param [properties] Properties to set - * @returns LinkedInterconnectAttachments instance + * @returns GetSpokeRequest instance */ - public static create(properties?: google.cloud.networkconnectivity.v1.ILinkedInterconnectAttachments): google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments; + public static create(properties?: google.cloud.networkconnectivity.v1.IGetSpokeRequest): google.cloud.networkconnectivity.v1.GetSpokeRequest; /** - * Encodes the specified LinkedInterconnectAttachments message. Does not implicitly {@link google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments.verify|verify} messages. - * @param message LinkedInterconnectAttachments message or plain object to encode + * Encodes the specified GetSpokeRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.GetSpokeRequest.verify|verify} messages. + * @param message GetSpokeRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.networkconnectivity.v1.ILinkedInterconnectAttachments, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.networkconnectivity.v1.IGetSpokeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified LinkedInterconnectAttachments message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments.verify|verify} messages. - * @param message LinkedInterconnectAttachments message or plain object to encode + * Encodes the specified GetSpokeRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.GetSpokeRequest.verify|verify} messages. + * @param message GetSpokeRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.networkconnectivity.v1.ILinkedInterconnectAttachments, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IGetSpokeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a LinkedInterconnectAttachments message from the specified reader or buffer. + * Decodes a GetSpokeRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns LinkedInterconnectAttachments + * @returns GetSpokeRequest * @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.LinkedInterconnectAttachments; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networkconnectivity.v1.GetSpokeRequest; /** - * Decodes a LinkedInterconnectAttachments message from the specified reader or buffer, length delimited. + * Decodes a GetSpokeRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns LinkedInterconnectAttachments + * @returns GetSpokeRequest * @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.LinkedInterconnectAttachments; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networkconnectivity.v1.GetSpokeRequest; /** - * Verifies a LinkedInterconnectAttachments message. + * Verifies a GetSpokeRequest 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 LinkedInterconnectAttachments message from a plain object. Also converts values to their respective internal types. + * Creates a GetSpokeRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns LinkedInterconnectAttachments + * @returns GetSpokeRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments; + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.GetSpokeRequest; /** - * Creates a plain object from a LinkedInterconnectAttachments message. Also converts values to other types if specified. - * @param message LinkedInterconnectAttachments + * Creates a plain object from a GetSpokeRequest message. Also converts values to other types if specified. + * @param message GetSpokeRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.networkconnectivity.v1.GetSpokeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this LinkedInterconnectAttachments to JSON. + * Converts this GetSpokeRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for LinkedInterconnectAttachments + * Gets the default type url for GetSpokeRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a LinkedRouterApplianceInstances. */ - interface ILinkedRouterApplianceInstances { + /** Properties of a CreateSpokeRequest. */ + interface ICreateSpokeRequest { - /** LinkedRouterApplianceInstances instances */ - instances?: (google.cloud.networkconnectivity.v1.IRouterApplianceInstance[]|null); + /** CreateSpokeRequest parent */ + parent?: (string|null); - /** LinkedRouterApplianceInstances siteToSiteDataTransfer */ - siteToSiteDataTransfer?: (boolean|null); + /** CreateSpokeRequest spokeId */ + spokeId?: (string|null); - /** LinkedRouterApplianceInstances vpcNetwork */ - vpcNetwork?: (string|null); + /** CreateSpokeRequest spoke */ + spoke?: (google.cloud.networkconnectivity.v1.ISpoke|null); + + /** CreateSpokeRequest requestId */ + requestId?: (string|null); } - /** Represents a LinkedRouterApplianceInstances. */ - class LinkedRouterApplianceInstances implements ILinkedRouterApplianceInstances { + /** Represents a CreateSpokeRequest. */ + class CreateSpokeRequest implements ICreateSpokeRequest { /** - * Constructs a new LinkedRouterApplianceInstances. + * Constructs a new CreateSpokeRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.networkconnectivity.v1.ILinkedRouterApplianceInstances); + constructor(properties?: google.cloud.networkconnectivity.v1.ICreateSpokeRequest); - /** LinkedRouterApplianceInstances instances. */ - public instances: google.cloud.networkconnectivity.v1.IRouterApplianceInstance[]; + /** CreateSpokeRequest parent. */ + public parent: string; - /** LinkedRouterApplianceInstances siteToSiteDataTransfer. */ - public siteToSiteDataTransfer: boolean; + /** CreateSpokeRequest spokeId. */ + public spokeId: string; - /** LinkedRouterApplianceInstances vpcNetwork. */ - public vpcNetwork: string; + /** CreateSpokeRequest spoke. */ + public spoke?: (google.cloud.networkconnectivity.v1.ISpoke|null); + + /** CreateSpokeRequest requestId. */ + public requestId: string; /** - * Creates a new LinkedRouterApplianceInstances instance using the specified properties. + * Creates a new CreateSpokeRequest instance using the specified properties. * @param [properties] Properties to set - * @returns LinkedRouterApplianceInstances instance + * @returns CreateSpokeRequest instance */ - public static create(properties?: google.cloud.networkconnectivity.v1.ILinkedRouterApplianceInstances): google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances; + public static create(properties?: google.cloud.networkconnectivity.v1.ICreateSpokeRequest): google.cloud.networkconnectivity.v1.CreateSpokeRequest; /** - * Encodes the specified LinkedRouterApplianceInstances message. Does not implicitly {@link google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances.verify|verify} messages. - * @param message LinkedRouterApplianceInstances message or plain object to encode + * Encodes the specified CreateSpokeRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.CreateSpokeRequest.verify|verify} messages. + * @param message CreateSpokeRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.networkconnectivity.v1.ILinkedRouterApplianceInstances, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.networkconnectivity.v1.ICreateSpokeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified LinkedRouterApplianceInstances message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances.verify|verify} messages. - * @param message LinkedRouterApplianceInstances message or plain object to encode + * Encodes the specified CreateSpokeRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.CreateSpokeRequest.verify|verify} messages. + * @param message CreateSpokeRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.networkconnectivity.v1.ILinkedRouterApplianceInstances, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.ICreateSpokeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a LinkedRouterApplianceInstances message from the specified reader or buffer. + * Decodes a CreateSpokeRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns LinkedRouterApplianceInstances + * @returns CreateSpokeRequest * @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.LinkedRouterApplianceInstances; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networkconnectivity.v1.CreateSpokeRequest; /** - * Decodes a LinkedRouterApplianceInstances message from the specified reader or buffer, length delimited. + * Decodes a CreateSpokeRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns LinkedRouterApplianceInstances + * @returns CreateSpokeRequest * @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.LinkedRouterApplianceInstances; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networkconnectivity.v1.CreateSpokeRequest; /** - * Verifies a LinkedRouterApplianceInstances message. + * Verifies a CreateSpokeRequest 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 LinkedRouterApplianceInstances message from a plain object. Also converts values to their respective internal types. + * Creates a CreateSpokeRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns LinkedRouterApplianceInstances + * @returns CreateSpokeRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances; + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.CreateSpokeRequest; /** - * Creates a plain object from a LinkedRouterApplianceInstances message. Also converts values to other types if specified. - * @param message LinkedRouterApplianceInstances + * Creates a plain object from a CreateSpokeRequest message. Also converts values to other types if specified. + * @param message CreateSpokeRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.networkconnectivity.v1.CreateSpokeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this LinkedRouterApplianceInstances to JSON. + * Converts this CreateSpokeRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for LinkedRouterApplianceInstances + * Gets the default type url for CreateSpokeRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a RouterApplianceInstance. */ - interface IRouterApplianceInstance { + /** Properties of an UpdateSpokeRequest. */ + interface IUpdateSpokeRequest { - /** RouterApplianceInstance virtualMachine */ - virtualMachine?: (string|null); + /** UpdateSpokeRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); - /** RouterApplianceInstance ipAddress */ - ipAddress?: (string|null); + /** UpdateSpokeRequest spoke */ + spoke?: (google.cloud.networkconnectivity.v1.ISpoke|null); + + /** UpdateSpokeRequest requestId */ + requestId?: (string|null); } - /** Represents a RouterApplianceInstance. */ - class RouterApplianceInstance implements IRouterApplianceInstance { + /** Represents an UpdateSpokeRequest. */ + class UpdateSpokeRequest implements IUpdateSpokeRequest { /** - * Constructs a new RouterApplianceInstance. + * Constructs a new UpdateSpokeRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.networkconnectivity.v1.IRouterApplianceInstance); + constructor(properties?: google.cloud.networkconnectivity.v1.IUpdateSpokeRequest); - /** RouterApplianceInstance virtualMachine. */ - public virtualMachine: string; + /** UpdateSpokeRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); - /** RouterApplianceInstance ipAddress. */ - public ipAddress: string; + /** UpdateSpokeRequest spoke. */ + public spoke?: (google.cloud.networkconnectivity.v1.ISpoke|null); + + /** UpdateSpokeRequest requestId. */ + public requestId: string; /** - * Creates a new RouterApplianceInstance instance using the specified properties. + * Creates a new UpdateSpokeRequest instance using the specified properties. * @param [properties] Properties to set - * @returns RouterApplianceInstance instance + * @returns UpdateSpokeRequest instance */ - public static create(properties?: google.cloud.networkconnectivity.v1.IRouterApplianceInstance): google.cloud.networkconnectivity.v1.RouterApplianceInstance; + public static create(properties?: google.cloud.networkconnectivity.v1.IUpdateSpokeRequest): google.cloud.networkconnectivity.v1.UpdateSpokeRequest; /** - * Encodes the specified RouterApplianceInstance message. Does not implicitly {@link google.cloud.networkconnectivity.v1.RouterApplianceInstance.verify|verify} messages. - * @param message RouterApplianceInstance message or plain object to encode + * Encodes the specified UpdateSpokeRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.UpdateSpokeRequest.verify|verify} messages. + * @param message UpdateSpokeRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.networkconnectivity.v1.IRouterApplianceInstance, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.networkconnectivity.v1.IUpdateSpokeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RouterApplianceInstance message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.RouterApplianceInstance.verify|verify} messages. - * @param message RouterApplianceInstance message or plain object to encode + * Encodes the specified UpdateSpokeRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.UpdateSpokeRequest.verify|verify} messages. + * @param message UpdateSpokeRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IRouterApplianceInstance, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IUpdateSpokeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RouterApplianceInstance message from the specified reader or buffer. + * Decodes an UpdateSpokeRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RouterApplianceInstance + * @returns UpdateSpokeRequest * @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.RouterApplianceInstance; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networkconnectivity.v1.UpdateSpokeRequest; /** - * Decodes a RouterApplianceInstance message from the specified reader or buffer, length delimited. + * Decodes an UpdateSpokeRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RouterApplianceInstance + * @returns UpdateSpokeRequest * @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.RouterApplianceInstance; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networkconnectivity.v1.UpdateSpokeRequest; /** - * Verifies a RouterApplianceInstance message. + * Verifies an UpdateSpokeRequest 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 RouterApplianceInstance message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateSpokeRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RouterApplianceInstance + * @returns UpdateSpokeRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.RouterApplianceInstance; + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.UpdateSpokeRequest; /** - * Creates a plain object from a RouterApplianceInstance message. Also converts values to other types if specified. - * @param message RouterApplianceInstance + * Creates a plain object from an UpdateSpokeRequest message. Also converts values to other types if specified. + * @param message UpdateSpokeRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.networkconnectivity.v1.RouterApplianceInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.networkconnectivity.v1.UpdateSpokeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RouterApplianceInstance to JSON. + * Converts this UpdateSpokeRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for RouterApplianceInstance + * Gets the default type url for UpdateSpokeRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a LocationMetadata. */ - interface ILocationMetadata { + /** Properties of a DeleteSpokeRequest. */ + interface IDeleteSpokeRequest { - /** LocationMetadata locationFeatures */ - locationFeatures?: (google.cloud.networkconnectivity.v1.LocationFeature[]|null); + /** DeleteSpokeRequest name */ + name?: (string|null); + + /** DeleteSpokeRequest requestId */ + requestId?: (string|null); } - /** Represents a LocationMetadata. */ - class LocationMetadata implements ILocationMetadata { + /** Represents a DeleteSpokeRequest. */ + class DeleteSpokeRequest implements IDeleteSpokeRequest { /** - * Constructs a new LocationMetadata. + * Constructs a new DeleteSpokeRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.networkconnectivity.v1.ILocationMetadata); + constructor(properties?: google.cloud.networkconnectivity.v1.IDeleteSpokeRequest); - /** LocationMetadata locationFeatures. */ - public locationFeatures: google.cloud.networkconnectivity.v1.LocationFeature[]; + /** DeleteSpokeRequest name. */ + public name: string; + + /** DeleteSpokeRequest requestId. */ + public requestId: string; /** - * Creates a new LocationMetadata instance using the specified properties. + * Creates a new DeleteSpokeRequest instance using the specified properties. * @param [properties] Properties to set - * @returns LocationMetadata instance + * @returns DeleteSpokeRequest instance */ - public static create(properties?: google.cloud.networkconnectivity.v1.ILocationMetadata): google.cloud.networkconnectivity.v1.LocationMetadata; + public static create(properties?: google.cloud.networkconnectivity.v1.IDeleteSpokeRequest): google.cloud.networkconnectivity.v1.DeleteSpokeRequest; /** - * 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 + * Encodes the specified DeleteSpokeRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.DeleteSpokeRequest.verify|verify} messages. + * @param message DeleteSpokeRequest 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; + public static encode(message: google.cloud.networkconnectivity.v1.IDeleteSpokeRequest, 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 + * Encodes the specified DeleteSpokeRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.DeleteSpokeRequest.verify|verify} messages. + * @param message DeleteSpokeRequest 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; + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IDeleteSpokeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a LocationMetadata message from the specified reader or buffer. + * Decodes a DeleteSpokeRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns LocationMetadata + * @returns DeleteSpokeRequest * @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; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.networkconnectivity.v1.DeleteSpokeRequest; /** - * Decodes a LocationMetadata message from the specified reader or buffer, length delimited. + * Decodes a DeleteSpokeRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns LocationMetadata + * @returns DeleteSpokeRequest * @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; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.networkconnectivity.v1.DeleteSpokeRequest; /** - * Verifies a LocationMetadata message. + * Verifies a DeleteSpokeRequest 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. + * Creates a DeleteSpokeRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns LocationMetadata + * @returns DeleteSpokeRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.LocationMetadata; + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.DeleteSpokeRequest; /** - * Creates a plain object from a LocationMetadata message. Also converts values to other types if specified. - * @param message LocationMetadata + * Creates a plain object from a DeleteSpokeRequest message. Also converts values to other types if specified. + * @param message DeleteSpokeRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.networkconnectivity.v1.LocationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.networkconnectivity.v1.DeleteSpokeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this LocationMetadata to JSON. + * Converts this DeleteSpokeRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for LocationMetadata + * Gets the default type url for DeleteSpokeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AcceptHubSpokeRequest. */ + interface IAcceptHubSpokeRequest { + + /** AcceptHubSpokeRequest name */ + name?: (string|null); + + /** AcceptHubSpokeRequest spokeUri */ + spokeUri?: (string|null); + + /** AcceptHubSpokeRequest requestId */ + requestId?: (string|null); + } + + /** Represents an AcceptHubSpokeRequest. */ + class AcceptHubSpokeRequest implements IAcceptHubSpokeRequest { + + /** + * Constructs a new AcceptHubSpokeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkconnectivity.v1.IAcceptHubSpokeRequest); + + /** AcceptHubSpokeRequest name. */ + public name: string; + + /** AcceptHubSpokeRequest spokeUri. */ + public spokeUri: string; + + /** AcceptHubSpokeRequest requestId. */ + public requestId: string; + + /** + * Creates a new AcceptHubSpokeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AcceptHubSpokeRequest instance + */ + public static create(properties?: google.cloud.networkconnectivity.v1.IAcceptHubSpokeRequest): google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest; + + /** + * Encodes the specified AcceptHubSpokeRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest.verify|verify} messages. + * @param message AcceptHubSpokeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkconnectivity.v1.IAcceptHubSpokeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AcceptHubSpokeRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest.verify|verify} messages. + * @param message AcceptHubSpokeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IAcceptHubSpokeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AcceptHubSpokeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AcceptHubSpokeRequest + * @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.AcceptHubSpokeRequest; + + /** + * Decodes an AcceptHubSpokeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AcceptHubSpokeRequest + * @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.AcceptHubSpokeRequest; + + /** + * Verifies an AcceptHubSpokeRequest 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 AcceptHubSpokeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AcceptHubSpokeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest; + + /** + * Creates a plain object from an AcceptHubSpokeRequest message. Also converts values to other types if specified. + * @param message AcceptHubSpokeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AcceptHubSpokeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AcceptHubSpokeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AcceptHubSpokeResponse. */ + interface IAcceptHubSpokeResponse { + + /** AcceptHubSpokeResponse spoke */ + spoke?: (google.cloud.networkconnectivity.v1.ISpoke|null); + } + + /** Represents an AcceptHubSpokeResponse. */ + class AcceptHubSpokeResponse implements IAcceptHubSpokeResponse { + + /** + * Constructs a new AcceptHubSpokeResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkconnectivity.v1.IAcceptHubSpokeResponse); + + /** AcceptHubSpokeResponse spoke. */ + public spoke?: (google.cloud.networkconnectivity.v1.ISpoke|null); + + /** + * Creates a new AcceptHubSpokeResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AcceptHubSpokeResponse instance + */ + public static create(properties?: google.cloud.networkconnectivity.v1.IAcceptHubSpokeResponse): google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse; + + /** + * Encodes the specified AcceptHubSpokeResponse message. Does not implicitly {@link google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse.verify|verify} messages. + * @param message AcceptHubSpokeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkconnectivity.v1.IAcceptHubSpokeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AcceptHubSpokeResponse message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse.verify|verify} messages. + * @param message AcceptHubSpokeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IAcceptHubSpokeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AcceptHubSpokeResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AcceptHubSpokeResponse + * @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.AcceptHubSpokeResponse; + + /** + * Decodes an AcceptHubSpokeResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AcceptHubSpokeResponse + * @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.AcceptHubSpokeResponse; + + /** + * Verifies an AcceptHubSpokeResponse 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 AcceptHubSpokeResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AcceptHubSpokeResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse; + + /** + * Creates a plain object from an AcceptHubSpokeResponse message. Also converts values to other types if specified. + * @param message AcceptHubSpokeResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AcceptHubSpokeResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AcceptHubSpokeResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RejectHubSpokeRequest. */ + interface IRejectHubSpokeRequest { + + /** RejectHubSpokeRequest name */ + name?: (string|null); + + /** RejectHubSpokeRequest spokeUri */ + spokeUri?: (string|null); + + /** RejectHubSpokeRequest requestId */ + requestId?: (string|null); + + /** RejectHubSpokeRequest details */ + details?: (string|null); + } + + /** Represents a RejectHubSpokeRequest. */ + class RejectHubSpokeRequest implements IRejectHubSpokeRequest { + + /** + * Constructs a new RejectHubSpokeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkconnectivity.v1.IRejectHubSpokeRequest); + + /** RejectHubSpokeRequest name. */ + public name: string; + + /** RejectHubSpokeRequest spokeUri. */ + public spokeUri: string; + + /** RejectHubSpokeRequest requestId. */ + public requestId: string; + + /** RejectHubSpokeRequest details. */ + public details: string; + + /** + * Creates a new RejectHubSpokeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RejectHubSpokeRequest instance + */ + public static create(properties?: google.cloud.networkconnectivity.v1.IRejectHubSpokeRequest): google.cloud.networkconnectivity.v1.RejectHubSpokeRequest; + + /** + * Encodes the specified RejectHubSpokeRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.RejectHubSpokeRequest.verify|verify} messages. + * @param message RejectHubSpokeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkconnectivity.v1.IRejectHubSpokeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RejectHubSpokeRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.RejectHubSpokeRequest.verify|verify} messages. + * @param message RejectHubSpokeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IRejectHubSpokeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RejectHubSpokeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RejectHubSpokeRequest + * @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.RejectHubSpokeRequest; + + /** + * Decodes a RejectHubSpokeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RejectHubSpokeRequest + * @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.RejectHubSpokeRequest; + + /** + * Verifies a RejectHubSpokeRequest 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 RejectHubSpokeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RejectHubSpokeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.RejectHubSpokeRequest; + + /** + * Creates a plain object from a RejectHubSpokeRequest message. Also converts values to other types if specified. + * @param message RejectHubSpokeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkconnectivity.v1.RejectHubSpokeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RejectHubSpokeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RejectHubSpokeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RejectHubSpokeResponse. */ + interface IRejectHubSpokeResponse { + + /** RejectHubSpokeResponse spoke */ + spoke?: (google.cloud.networkconnectivity.v1.ISpoke|null); + } + + /** Represents a RejectHubSpokeResponse. */ + class RejectHubSpokeResponse implements IRejectHubSpokeResponse { + + /** + * Constructs a new RejectHubSpokeResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkconnectivity.v1.IRejectHubSpokeResponse); + + /** RejectHubSpokeResponse spoke. */ + public spoke?: (google.cloud.networkconnectivity.v1.ISpoke|null); + + /** + * Creates a new RejectHubSpokeResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RejectHubSpokeResponse instance + */ + public static create(properties?: google.cloud.networkconnectivity.v1.IRejectHubSpokeResponse): google.cloud.networkconnectivity.v1.RejectHubSpokeResponse; + + /** + * Encodes the specified RejectHubSpokeResponse message. Does not implicitly {@link google.cloud.networkconnectivity.v1.RejectHubSpokeResponse.verify|verify} messages. + * @param message RejectHubSpokeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkconnectivity.v1.IRejectHubSpokeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RejectHubSpokeResponse message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.RejectHubSpokeResponse.verify|verify} messages. + * @param message RejectHubSpokeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IRejectHubSpokeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RejectHubSpokeResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RejectHubSpokeResponse + * @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.RejectHubSpokeResponse; + + /** + * Decodes a RejectHubSpokeResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RejectHubSpokeResponse + * @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.RejectHubSpokeResponse; + + /** + * Verifies a RejectHubSpokeResponse 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 RejectHubSpokeResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RejectHubSpokeResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.RejectHubSpokeResponse; + + /** + * Creates a plain object from a RejectHubSpokeResponse message. Also converts values to other types if specified. + * @param message RejectHubSpokeResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkconnectivity.v1.RejectHubSpokeResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RejectHubSpokeResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RejectHubSpokeResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetRouteTableRequest. */ + interface IGetRouteTableRequest { + + /** GetRouteTableRequest name */ + name?: (string|null); + } + + /** Represents a GetRouteTableRequest. */ + class GetRouteTableRequest implements IGetRouteTableRequest { + + /** + * Constructs a new GetRouteTableRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkconnectivity.v1.IGetRouteTableRequest); + + /** GetRouteTableRequest name. */ + public name: string; + + /** + * Creates a new GetRouteTableRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRouteTableRequest instance + */ + public static create(properties?: google.cloud.networkconnectivity.v1.IGetRouteTableRequest): google.cloud.networkconnectivity.v1.GetRouteTableRequest; + + /** + * Encodes the specified GetRouteTableRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.GetRouteTableRequest.verify|verify} messages. + * @param message GetRouteTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkconnectivity.v1.IGetRouteTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRouteTableRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.GetRouteTableRequest.verify|verify} messages. + * @param message GetRouteTableRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IGetRouteTableRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRouteTableRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRouteTableRequest + * @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.GetRouteTableRequest; + + /** + * Decodes a GetRouteTableRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRouteTableRequest + * @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.GetRouteTableRequest; + + /** + * Verifies a GetRouteTableRequest 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 GetRouteTableRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRouteTableRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.GetRouteTableRequest; + + /** + * Creates a plain object from a GetRouteTableRequest message. Also converts values to other types if specified. + * @param message GetRouteTableRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkconnectivity.v1.GetRouteTableRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRouteTableRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetRouteTableRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetRouteRequest. */ + interface IGetRouteRequest { + + /** GetRouteRequest name */ + name?: (string|null); + } + + /** Represents a GetRouteRequest. */ + class GetRouteRequest implements IGetRouteRequest { + + /** + * Constructs a new GetRouteRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkconnectivity.v1.IGetRouteRequest); + + /** GetRouteRequest name. */ + public name: string; + + /** + * Creates a new GetRouteRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetRouteRequest instance + */ + public static create(properties?: google.cloud.networkconnectivity.v1.IGetRouteRequest): google.cloud.networkconnectivity.v1.GetRouteRequest; + + /** + * Encodes the specified GetRouteRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.GetRouteRequest.verify|verify} messages. + * @param message GetRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkconnectivity.v1.IGetRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.GetRouteRequest.verify|verify} messages. + * @param message GetRouteRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IGetRouteRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetRouteRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetRouteRequest + * @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.GetRouteRequest; + + /** + * Decodes a GetRouteRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetRouteRequest + * @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.GetRouteRequest; + + /** + * Verifies a GetRouteRequest 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 GetRouteRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetRouteRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.GetRouteRequest; + + /** + * Creates a plain object from a GetRouteRequest message. Also converts values to other types if specified. + * @param message GetRouteRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkconnectivity.v1.GetRouteRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetRouteRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetRouteRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRoutesRequest. */ + interface IListRoutesRequest { + + /** ListRoutesRequest parent */ + parent?: (string|null); + + /** ListRoutesRequest pageSize */ + pageSize?: (number|null); + + /** ListRoutesRequest pageToken */ + pageToken?: (string|null); + + /** ListRoutesRequest filter */ + filter?: (string|null); + + /** ListRoutesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListRoutesRequest. */ + class ListRoutesRequest implements IListRoutesRequest { + + /** + * Constructs a new ListRoutesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkconnectivity.v1.IListRoutesRequest); + + /** ListRoutesRequest parent. */ + public parent: string; + + /** ListRoutesRequest pageSize. */ + public pageSize: number; + + /** ListRoutesRequest pageToken. */ + public pageToken: string; + + /** ListRoutesRequest filter. */ + public filter: string; + + /** ListRoutesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListRoutesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRoutesRequest instance + */ + public static create(properties?: google.cloud.networkconnectivity.v1.IListRoutesRequest): google.cloud.networkconnectivity.v1.ListRoutesRequest; + + /** + * Encodes the specified ListRoutesRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListRoutesRequest.verify|verify} messages. + * @param message ListRoutesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkconnectivity.v1.IListRoutesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRoutesRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListRoutesRequest.verify|verify} messages. + * @param message ListRoutesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IListRoutesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRoutesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRoutesRequest + * @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.ListRoutesRequest; + + /** + * Decodes a ListRoutesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRoutesRequest + * @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.ListRoutesRequest; + + /** + * Verifies a ListRoutesRequest 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 ListRoutesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRoutesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.ListRoutesRequest; + + /** + * Creates a plain object from a ListRoutesRequest message. Also converts values to other types if specified. + * @param message ListRoutesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkconnectivity.v1.ListRoutesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRoutesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRoutesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRoutesResponse. */ + interface IListRoutesResponse { + + /** ListRoutesResponse routes */ + routes?: (google.cloud.networkconnectivity.v1.IRoute[]|null); + + /** ListRoutesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListRoutesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListRoutesResponse. */ + class ListRoutesResponse implements IListRoutesResponse { + + /** + * Constructs a new ListRoutesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkconnectivity.v1.IListRoutesResponse); + + /** ListRoutesResponse routes. */ + public routes: google.cloud.networkconnectivity.v1.IRoute[]; + + /** ListRoutesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListRoutesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListRoutesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRoutesResponse instance + */ + public static create(properties?: google.cloud.networkconnectivity.v1.IListRoutesResponse): google.cloud.networkconnectivity.v1.ListRoutesResponse; + + /** + * Encodes the specified ListRoutesResponse message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListRoutesResponse.verify|verify} messages. + * @param message ListRoutesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkconnectivity.v1.IListRoutesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRoutesResponse message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListRoutesResponse.verify|verify} messages. + * @param message ListRoutesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IListRoutesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRoutesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRoutesResponse + * @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.ListRoutesResponse; + + /** + * Decodes a ListRoutesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRoutesResponse + * @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.ListRoutesResponse; + + /** + * Verifies a ListRoutesResponse 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 ListRoutesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRoutesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.ListRoutesResponse; + + /** + * Creates a plain object from a ListRoutesResponse message. Also converts values to other types if specified. + * @param message ListRoutesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkconnectivity.v1.ListRoutesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRoutesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRoutesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRouteTablesRequest. */ + interface IListRouteTablesRequest { + + /** ListRouteTablesRequest parent */ + parent?: (string|null); + + /** ListRouteTablesRequest pageSize */ + pageSize?: (number|null); + + /** ListRouteTablesRequest pageToken */ + pageToken?: (string|null); + + /** ListRouteTablesRequest filter */ + filter?: (string|null); + + /** ListRouteTablesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListRouteTablesRequest. */ + class ListRouteTablesRequest implements IListRouteTablesRequest { + + /** + * Constructs a new ListRouteTablesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkconnectivity.v1.IListRouteTablesRequest); + + /** ListRouteTablesRequest parent. */ + public parent: string; + + /** ListRouteTablesRequest pageSize. */ + public pageSize: number; + + /** ListRouteTablesRequest pageToken. */ + public pageToken: string; + + /** ListRouteTablesRequest filter. */ + public filter: string; + + /** ListRouteTablesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListRouteTablesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRouteTablesRequest instance + */ + public static create(properties?: google.cloud.networkconnectivity.v1.IListRouteTablesRequest): google.cloud.networkconnectivity.v1.ListRouteTablesRequest; + + /** + * Encodes the specified ListRouteTablesRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListRouteTablesRequest.verify|verify} messages. + * @param message ListRouteTablesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkconnectivity.v1.IListRouteTablesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRouteTablesRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListRouteTablesRequest.verify|verify} messages. + * @param message ListRouteTablesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IListRouteTablesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRouteTablesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRouteTablesRequest + * @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.ListRouteTablesRequest; + + /** + * Decodes a ListRouteTablesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRouteTablesRequest + * @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.ListRouteTablesRequest; + + /** + * Verifies a ListRouteTablesRequest 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 ListRouteTablesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRouteTablesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.ListRouteTablesRequest; + + /** + * Creates a plain object from a ListRouteTablesRequest message. Also converts values to other types if specified. + * @param message ListRouteTablesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkconnectivity.v1.ListRouteTablesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRouteTablesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRouteTablesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListRouteTablesResponse. */ + interface IListRouteTablesResponse { + + /** ListRouteTablesResponse routeTables */ + routeTables?: (google.cloud.networkconnectivity.v1.IRouteTable[]|null); + + /** ListRouteTablesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListRouteTablesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListRouteTablesResponse. */ + class ListRouteTablesResponse implements IListRouteTablesResponse { + + /** + * Constructs a new ListRouteTablesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkconnectivity.v1.IListRouteTablesResponse); + + /** ListRouteTablesResponse routeTables. */ + public routeTables: google.cloud.networkconnectivity.v1.IRouteTable[]; + + /** ListRouteTablesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListRouteTablesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListRouteTablesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListRouteTablesResponse instance + */ + public static create(properties?: google.cloud.networkconnectivity.v1.IListRouteTablesResponse): google.cloud.networkconnectivity.v1.ListRouteTablesResponse; + + /** + * Encodes the specified ListRouteTablesResponse message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListRouteTablesResponse.verify|verify} messages. + * @param message ListRouteTablesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkconnectivity.v1.IListRouteTablesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListRouteTablesResponse message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListRouteTablesResponse.verify|verify} messages. + * @param message ListRouteTablesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IListRouteTablesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListRouteTablesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListRouteTablesResponse + * @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.ListRouteTablesResponse; + + /** + * Decodes a ListRouteTablesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListRouteTablesResponse + * @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.ListRouteTablesResponse; + + /** + * Verifies a ListRouteTablesResponse 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 ListRouteTablesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListRouteTablesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.ListRouteTablesResponse; + + /** + * Creates a plain object from a ListRouteTablesResponse message. Also converts values to other types if specified. + * @param message ListRouteTablesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkconnectivity.v1.ListRouteTablesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListRouteTablesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListRouteTablesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListGroupsRequest. */ + interface IListGroupsRequest { + + /** ListGroupsRequest parent */ + parent?: (string|null); + + /** ListGroupsRequest pageSize */ + pageSize?: (number|null); + + /** ListGroupsRequest pageToken */ + pageToken?: (string|null); + + /** ListGroupsRequest filter */ + filter?: (string|null); + + /** ListGroupsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListGroupsRequest. */ + class ListGroupsRequest implements IListGroupsRequest { + + /** + * Constructs a new ListGroupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkconnectivity.v1.IListGroupsRequest); + + /** ListGroupsRequest parent. */ + public parent: string; + + /** ListGroupsRequest pageSize. */ + public pageSize: number; + + /** ListGroupsRequest pageToken. */ + public pageToken: string; + + /** ListGroupsRequest filter. */ + public filter: string; + + /** ListGroupsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListGroupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGroupsRequest instance + */ + public static create(properties?: google.cloud.networkconnectivity.v1.IListGroupsRequest): google.cloud.networkconnectivity.v1.ListGroupsRequest; + + /** + * Encodes the specified ListGroupsRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListGroupsRequest.verify|verify} messages. + * @param message ListGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkconnectivity.v1.IListGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListGroupsRequest.verify|verify} messages. + * @param message ListGroupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IListGroupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGroupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGroupsRequest + * @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.ListGroupsRequest; + + /** + * Decodes a ListGroupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGroupsRequest + * @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.ListGroupsRequest; + + /** + * Verifies a ListGroupsRequest 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 ListGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGroupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.ListGroupsRequest; + + /** + * Creates a plain object from a ListGroupsRequest message. Also converts values to other types if specified. + * @param message ListGroupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkconnectivity.v1.ListGroupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGroupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGroupsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListGroupsResponse. */ + interface IListGroupsResponse { + + /** ListGroupsResponse groups */ + groups?: (google.cloud.networkconnectivity.v1.IGroup[]|null); + + /** ListGroupsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListGroupsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListGroupsResponse. */ + class ListGroupsResponse implements IListGroupsResponse { + + /** + * Constructs a new ListGroupsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkconnectivity.v1.IListGroupsResponse); + + /** ListGroupsResponse groups. */ + public groups: google.cloud.networkconnectivity.v1.IGroup[]; + + /** ListGroupsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListGroupsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListGroupsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListGroupsResponse instance + */ + public static create(properties?: google.cloud.networkconnectivity.v1.IListGroupsResponse): google.cloud.networkconnectivity.v1.ListGroupsResponse; + + /** + * Encodes the specified ListGroupsResponse message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListGroupsResponse.verify|verify} messages. + * @param message ListGroupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkconnectivity.v1.IListGroupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListGroupsResponse message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListGroupsResponse.verify|verify} messages. + * @param message ListGroupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IListGroupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListGroupsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListGroupsResponse + * @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.ListGroupsResponse; + + /** + * Decodes a ListGroupsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListGroupsResponse + * @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.ListGroupsResponse; + + /** + * Verifies a ListGroupsResponse 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 ListGroupsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListGroupsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.ListGroupsResponse; + + /** + * Creates a plain object from a ListGroupsResponse message. Also converts values to other types if specified. + * @param message ListGroupsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkconnectivity.v1.ListGroupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListGroupsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListGroupsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LinkedVpnTunnels. */ + interface ILinkedVpnTunnels { + + /** LinkedVpnTunnels uris */ + uris?: (string[]|null); + + /** LinkedVpnTunnels siteToSiteDataTransfer */ + siteToSiteDataTransfer?: (boolean|null); + + /** LinkedVpnTunnels vpcNetwork */ + vpcNetwork?: (string|null); + } + + /** Represents a LinkedVpnTunnels. */ + class LinkedVpnTunnels implements ILinkedVpnTunnels { + + /** + * Constructs a new LinkedVpnTunnels. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkconnectivity.v1.ILinkedVpnTunnels); + + /** LinkedVpnTunnels uris. */ + public uris: string[]; + + /** LinkedVpnTunnels siteToSiteDataTransfer. */ + public siteToSiteDataTransfer: boolean; + + /** LinkedVpnTunnels vpcNetwork. */ + public vpcNetwork: string; + + /** + * Creates a new LinkedVpnTunnels instance using the specified properties. + * @param [properties] Properties to set + * @returns LinkedVpnTunnels instance + */ + public static create(properties?: google.cloud.networkconnectivity.v1.ILinkedVpnTunnels): google.cloud.networkconnectivity.v1.LinkedVpnTunnels; + + /** + * Encodes the specified LinkedVpnTunnels message. Does not implicitly {@link google.cloud.networkconnectivity.v1.LinkedVpnTunnels.verify|verify} messages. + * @param message LinkedVpnTunnels message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkconnectivity.v1.ILinkedVpnTunnels, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LinkedVpnTunnels message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.LinkedVpnTunnels.verify|verify} messages. + * @param message LinkedVpnTunnels message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.ILinkedVpnTunnels, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LinkedVpnTunnels message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LinkedVpnTunnels + * @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.LinkedVpnTunnels; + + /** + * Decodes a LinkedVpnTunnels message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LinkedVpnTunnels + * @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.LinkedVpnTunnels; + + /** + * Verifies a LinkedVpnTunnels 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 LinkedVpnTunnels message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LinkedVpnTunnels + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.LinkedVpnTunnels; + + /** + * Creates a plain object from a LinkedVpnTunnels message. Also converts values to other types if specified. + * @param message LinkedVpnTunnels + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkconnectivity.v1.LinkedVpnTunnels, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LinkedVpnTunnels to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LinkedVpnTunnels + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LinkedInterconnectAttachments. */ + interface ILinkedInterconnectAttachments { + + /** LinkedInterconnectAttachments uris */ + uris?: (string[]|null); + + /** LinkedInterconnectAttachments siteToSiteDataTransfer */ + siteToSiteDataTransfer?: (boolean|null); + + /** LinkedInterconnectAttachments vpcNetwork */ + vpcNetwork?: (string|null); + } + + /** Represents a LinkedInterconnectAttachments. */ + class LinkedInterconnectAttachments implements ILinkedInterconnectAttachments { + + /** + * Constructs a new LinkedInterconnectAttachments. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkconnectivity.v1.ILinkedInterconnectAttachments); + + /** LinkedInterconnectAttachments uris. */ + public uris: string[]; + + /** LinkedInterconnectAttachments siteToSiteDataTransfer. */ + public siteToSiteDataTransfer: boolean; + + /** LinkedInterconnectAttachments vpcNetwork. */ + public vpcNetwork: string; + + /** + * Creates a new LinkedInterconnectAttachments instance using the specified properties. + * @param [properties] Properties to set + * @returns LinkedInterconnectAttachments instance + */ + public static create(properties?: google.cloud.networkconnectivity.v1.ILinkedInterconnectAttachments): google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments; + + /** + * Encodes the specified LinkedInterconnectAttachments message. Does not implicitly {@link google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments.verify|verify} messages. + * @param message LinkedInterconnectAttachments message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkconnectivity.v1.ILinkedInterconnectAttachments, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LinkedInterconnectAttachments message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments.verify|verify} messages. + * @param message LinkedInterconnectAttachments message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.ILinkedInterconnectAttachments, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LinkedInterconnectAttachments message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LinkedInterconnectAttachments + * @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.LinkedInterconnectAttachments; + + /** + * Decodes a LinkedInterconnectAttachments message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LinkedInterconnectAttachments + * @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.LinkedInterconnectAttachments; + + /** + * Verifies a LinkedInterconnectAttachments 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 LinkedInterconnectAttachments message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LinkedInterconnectAttachments + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments; + + /** + * Creates a plain object from a LinkedInterconnectAttachments message. Also converts values to other types if specified. + * @param message LinkedInterconnectAttachments + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LinkedInterconnectAttachments to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LinkedInterconnectAttachments + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LinkedRouterApplianceInstances. */ + interface ILinkedRouterApplianceInstances { + + /** LinkedRouterApplianceInstances instances */ + instances?: (google.cloud.networkconnectivity.v1.IRouterApplianceInstance[]|null); + + /** LinkedRouterApplianceInstances siteToSiteDataTransfer */ + siteToSiteDataTransfer?: (boolean|null); + + /** LinkedRouterApplianceInstances vpcNetwork */ + vpcNetwork?: (string|null); + } + + /** Represents a LinkedRouterApplianceInstances. */ + class LinkedRouterApplianceInstances implements ILinkedRouterApplianceInstances { + + /** + * Constructs a new LinkedRouterApplianceInstances. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkconnectivity.v1.ILinkedRouterApplianceInstances); + + /** LinkedRouterApplianceInstances instances. */ + public instances: google.cloud.networkconnectivity.v1.IRouterApplianceInstance[]; + + /** LinkedRouterApplianceInstances siteToSiteDataTransfer. */ + public siteToSiteDataTransfer: boolean; + + /** LinkedRouterApplianceInstances vpcNetwork. */ + public vpcNetwork: string; + + /** + * Creates a new LinkedRouterApplianceInstances instance using the specified properties. + * @param [properties] Properties to set + * @returns LinkedRouterApplianceInstances instance + */ + public static create(properties?: google.cloud.networkconnectivity.v1.ILinkedRouterApplianceInstances): google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances; + + /** + * Encodes the specified LinkedRouterApplianceInstances message. Does not implicitly {@link google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances.verify|verify} messages. + * @param message LinkedRouterApplianceInstances message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkconnectivity.v1.ILinkedRouterApplianceInstances, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LinkedRouterApplianceInstances message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances.verify|verify} messages. + * @param message LinkedRouterApplianceInstances message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.ILinkedRouterApplianceInstances, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LinkedRouterApplianceInstances message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LinkedRouterApplianceInstances + * @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.LinkedRouterApplianceInstances; + + /** + * Decodes a LinkedRouterApplianceInstances message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LinkedRouterApplianceInstances + * @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.LinkedRouterApplianceInstances; + + /** + * Verifies a LinkedRouterApplianceInstances 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 LinkedRouterApplianceInstances message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LinkedRouterApplianceInstances + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances; + + /** + * Creates a plain object from a LinkedRouterApplianceInstances message. Also converts values to other types if specified. + * @param message LinkedRouterApplianceInstances + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LinkedRouterApplianceInstances to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LinkedRouterApplianceInstances + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a LinkedVpcNetwork. */ + interface ILinkedVpcNetwork { + + /** LinkedVpcNetwork uri */ + uri?: (string|null); + + /** LinkedVpcNetwork excludeExportRanges */ + excludeExportRanges?: (string[]|null); + } + + /** Represents a LinkedVpcNetwork. */ + class LinkedVpcNetwork implements ILinkedVpcNetwork { + + /** + * Constructs a new LinkedVpcNetwork. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkconnectivity.v1.ILinkedVpcNetwork); + + /** LinkedVpcNetwork uri. */ + public uri: string; + + /** LinkedVpcNetwork excludeExportRanges. */ + public excludeExportRanges: string[]; + + /** + * Creates a new LinkedVpcNetwork instance using the specified properties. + * @param [properties] Properties to set + * @returns LinkedVpcNetwork instance + */ + public static create(properties?: google.cloud.networkconnectivity.v1.ILinkedVpcNetwork): google.cloud.networkconnectivity.v1.LinkedVpcNetwork; + + /** + * Encodes the specified LinkedVpcNetwork message. Does not implicitly {@link google.cloud.networkconnectivity.v1.LinkedVpcNetwork.verify|verify} messages. + * @param message LinkedVpcNetwork message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkconnectivity.v1.ILinkedVpcNetwork, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LinkedVpcNetwork message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.LinkedVpcNetwork.verify|verify} messages. + * @param message LinkedVpcNetwork message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.ILinkedVpcNetwork, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LinkedVpcNetwork message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LinkedVpcNetwork + * @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.LinkedVpcNetwork; + + /** + * Decodes a LinkedVpcNetwork message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LinkedVpcNetwork + * @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.LinkedVpcNetwork; + + /** + * Verifies a LinkedVpcNetwork 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 LinkedVpcNetwork message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LinkedVpcNetwork + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.LinkedVpcNetwork; + + /** + * Creates a plain object from a LinkedVpcNetwork message. Also converts values to other types if specified. + * @param message LinkedVpcNetwork + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkconnectivity.v1.LinkedVpcNetwork, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LinkedVpcNetwork to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LinkedVpcNetwork + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RouterApplianceInstance. */ + interface IRouterApplianceInstance { + + /** RouterApplianceInstance virtualMachine */ + virtualMachine?: (string|null); + + /** RouterApplianceInstance ipAddress */ + ipAddress?: (string|null); + } + + /** Represents a RouterApplianceInstance. */ + class RouterApplianceInstance implements IRouterApplianceInstance { + + /** + * Constructs a new RouterApplianceInstance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkconnectivity.v1.IRouterApplianceInstance); + + /** RouterApplianceInstance virtualMachine. */ + public virtualMachine: string; + + /** RouterApplianceInstance ipAddress. */ + public ipAddress: string; + + /** + * Creates a new RouterApplianceInstance instance using the specified properties. + * @param [properties] Properties to set + * @returns RouterApplianceInstance instance + */ + public static create(properties?: google.cloud.networkconnectivity.v1.IRouterApplianceInstance): google.cloud.networkconnectivity.v1.RouterApplianceInstance; + + /** + * Encodes the specified RouterApplianceInstance message. Does not implicitly {@link google.cloud.networkconnectivity.v1.RouterApplianceInstance.verify|verify} messages. + * @param message RouterApplianceInstance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkconnectivity.v1.IRouterApplianceInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RouterApplianceInstance message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.RouterApplianceInstance.verify|verify} messages. + * @param message RouterApplianceInstance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IRouterApplianceInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RouterApplianceInstance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RouterApplianceInstance + * @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.RouterApplianceInstance; + + /** + * Decodes a RouterApplianceInstance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RouterApplianceInstance + * @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.RouterApplianceInstance; + + /** + * Verifies a RouterApplianceInstance 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 RouterApplianceInstance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RouterApplianceInstance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.RouterApplianceInstance; + + /** + * Creates a plain object from a RouterApplianceInstance message. Also converts values to other types if specified. + * @param message RouterApplianceInstance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkconnectivity.v1.RouterApplianceInstance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RouterApplianceInstance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RouterApplianceInstance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** 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 }; + + /** + * Gets the default type url for LocationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NextHopVpcNetwork. */ + interface INextHopVpcNetwork { + + /** NextHopVpcNetwork uri */ + uri?: (string|null); + } + + /** Represents a NextHopVpcNetwork. */ + class NextHopVpcNetwork implements INextHopVpcNetwork { + + /** + * Constructs a new NextHopVpcNetwork. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkconnectivity.v1.INextHopVpcNetwork); + + /** NextHopVpcNetwork uri. */ + public uri: string; + + /** + * Creates a new NextHopVpcNetwork instance using the specified properties. + * @param [properties] Properties to set + * @returns NextHopVpcNetwork instance + */ + public static create(properties?: google.cloud.networkconnectivity.v1.INextHopVpcNetwork): google.cloud.networkconnectivity.v1.NextHopVpcNetwork; + + /** + * Encodes the specified NextHopVpcNetwork message. Does not implicitly {@link google.cloud.networkconnectivity.v1.NextHopVpcNetwork.verify|verify} messages. + * @param message NextHopVpcNetwork message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkconnectivity.v1.INextHopVpcNetwork, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NextHopVpcNetwork message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.NextHopVpcNetwork.verify|verify} messages. + * @param message NextHopVpcNetwork message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.INextHopVpcNetwork, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NextHopVpcNetwork message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NextHopVpcNetwork + * @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.NextHopVpcNetwork; + + /** + * Decodes a NextHopVpcNetwork message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NextHopVpcNetwork + * @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.NextHopVpcNetwork; + + /** + * Verifies a NextHopVpcNetwork 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 NextHopVpcNetwork message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NextHopVpcNetwork + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.NextHopVpcNetwork; + + /** + * Creates a plain object from a NextHopVpcNetwork message. Also converts values to other types if specified. + * @param message NextHopVpcNetwork + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkconnectivity.v1.NextHopVpcNetwork, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NextHopVpcNetwork to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NextHopVpcNetwork + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpokeSummary. */ + interface ISpokeSummary { + + /** SpokeSummary spokeTypeCounts */ + spokeTypeCounts?: (google.cloud.networkconnectivity.v1.SpokeSummary.ISpokeTypeCount[]|null); + + /** SpokeSummary spokeStateCounts */ + spokeStateCounts?: (google.cloud.networkconnectivity.v1.SpokeSummary.ISpokeStateCount[]|null); + + /** SpokeSummary spokeStateReasonCounts */ + spokeStateReasonCounts?: (google.cloud.networkconnectivity.v1.SpokeSummary.ISpokeStateReasonCount[]|null); + } + + /** Represents a SpokeSummary. */ + class SpokeSummary implements ISpokeSummary { + + /** + * Constructs a new SpokeSummary. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkconnectivity.v1.ISpokeSummary); + + /** SpokeSummary spokeTypeCounts. */ + public spokeTypeCounts: google.cloud.networkconnectivity.v1.SpokeSummary.ISpokeTypeCount[]; + + /** SpokeSummary spokeStateCounts. */ + public spokeStateCounts: google.cloud.networkconnectivity.v1.SpokeSummary.ISpokeStateCount[]; + + /** SpokeSummary spokeStateReasonCounts. */ + public spokeStateReasonCounts: google.cloud.networkconnectivity.v1.SpokeSummary.ISpokeStateReasonCount[]; + + /** + * Creates a new SpokeSummary instance using the specified properties. + * @param [properties] Properties to set + * @returns SpokeSummary instance + */ + public static create(properties?: google.cloud.networkconnectivity.v1.ISpokeSummary): google.cloud.networkconnectivity.v1.SpokeSummary; + + /** + * Encodes the specified SpokeSummary message. Does not implicitly {@link google.cloud.networkconnectivity.v1.SpokeSummary.verify|verify} messages. + * @param message SpokeSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkconnectivity.v1.ISpokeSummary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpokeSummary message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.SpokeSummary.verify|verify} messages. + * @param message SpokeSummary message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.ISpokeSummary, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpokeSummary message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpokeSummary + * @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.SpokeSummary; + + /** + * Decodes a SpokeSummary message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpokeSummary + * @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.SpokeSummary; + + /** + * Verifies a SpokeSummary 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 SpokeSummary message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpokeSummary + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.SpokeSummary; + + /** + * Creates a plain object from a SpokeSummary message. Also converts values to other types if specified. + * @param message SpokeSummary + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkconnectivity.v1.SpokeSummary, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpokeSummary to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpokeSummary + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace SpokeSummary { + + /** Properties of a SpokeTypeCount. */ + interface ISpokeTypeCount { + + /** SpokeTypeCount spokeType */ + spokeType?: (google.cloud.networkconnectivity.v1.SpokeType|keyof typeof google.cloud.networkconnectivity.v1.SpokeType|null); + + /** SpokeTypeCount count */ + count?: (number|Long|string|null); + } + + /** Represents a SpokeTypeCount. */ + class SpokeTypeCount implements ISpokeTypeCount { + + /** + * Constructs a new SpokeTypeCount. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkconnectivity.v1.SpokeSummary.ISpokeTypeCount); + + /** SpokeTypeCount spokeType. */ + public spokeType: (google.cloud.networkconnectivity.v1.SpokeType|keyof typeof google.cloud.networkconnectivity.v1.SpokeType); + + /** SpokeTypeCount count. */ + public count: (number|Long|string); + + /** + * Creates a new SpokeTypeCount instance using the specified properties. + * @param [properties] Properties to set + * @returns SpokeTypeCount instance + */ + public static create(properties?: google.cloud.networkconnectivity.v1.SpokeSummary.ISpokeTypeCount): google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount; + + /** + * Encodes the specified SpokeTypeCount message. Does not implicitly {@link google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount.verify|verify} messages. + * @param message SpokeTypeCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkconnectivity.v1.SpokeSummary.ISpokeTypeCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpokeTypeCount message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount.verify|verify} messages. + * @param message SpokeTypeCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.SpokeSummary.ISpokeTypeCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpokeTypeCount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpokeTypeCount + * @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.SpokeSummary.SpokeTypeCount; + + /** + * Decodes a SpokeTypeCount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpokeTypeCount + * @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.SpokeSummary.SpokeTypeCount; + + /** + * Verifies a SpokeTypeCount 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 SpokeTypeCount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpokeTypeCount + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount; + + /** + * Creates a plain object from a SpokeTypeCount message. Also converts values to other types if specified. + * @param message SpokeTypeCount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpokeTypeCount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpokeTypeCount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpokeStateCount. */ + interface ISpokeStateCount { + + /** SpokeStateCount state */ + state?: (google.cloud.networkconnectivity.v1.State|keyof typeof google.cloud.networkconnectivity.v1.State|null); + + /** SpokeStateCount count */ + count?: (number|Long|string|null); + } + + /** Represents a SpokeStateCount. */ + class SpokeStateCount implements ISpokeStateCount { + + /** + * Constructs a new SpokeStateCount. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkconnectivity.v1.SpokeSummary.ISpokeStateCount); + + /** SpokeStateCount state. */ + public state: (google.cloud.networkconnectivity.v1.State|keyof typeof google.cloud.networkconnectivity.v1.State); + + /** SpokeStateCount count. */ + public count: (number|Long|string); + + /** + * Creates a new SpokeStateCount instance using the specified properties. + * @param [properties] Properties to set + * @returns SpokeStateCount instance + */ + public static create(properties?: google.cloud.networkconnectivity.v1.SpokeSummary.ISpokeStateCount): google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount; + + /** + * Encodes the specified SpokeStateCount message. Does not implicitly {@link google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount.verify|verify} messages. + * @param message SpokeStateCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkconnectivity.v1.SpokeSummary.ISpokeStateCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpokeStateCount message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount.verify|verify} messages. + * @param message SpokeStateCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.SpokeSummary.ISpokeStateCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpokeStateCount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpokeStateCount + * @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.SpokeSummary.SpokeStateCount; + + /** + * Decodes a SpokeStateCount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpokeStateCount + * @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.SpokeSummary.SpokeStateCount; + + /** + * Verifies a SpokeStateCount 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 SpokeStateCount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpokeStateCount + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount; + + /** + * Creates a plain object from a SpokeStateCount message. Also converts values to other types if specified. + * @param message SpokeStateCount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpokeStateCount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpokeStateCount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a SpokeStateReasonCount. */ + interface ISpokeStateReasonCount { + + /** SpokeStateReasonCount stateReasonCode */ + stateReasonCode?: (google.cloud.networkconnectivity.v1.Spoke.StateReason.Code|keyof typeof google.cloud.networkconnectivity.v1.Spoke.StateReason.Code|null); + + /** SpokeStateReasonCount count */ + count?: (number|Long|string|null); + } + + /** Represents a SpokeStateReasonCount. */ + class SpokeStateReasonCount implements ISpokeStateReasonCount { + + /** + * Constructs a new SpokeStateReasonCount. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkconnectivity.v1.SpokeSummary.ISpokeStateReasonCount); + + /** SpokeStateReasonCount stateReasonCode. */ + public stateReasonCode: (google.cloud.networkconnectivity.v1.Spoke.StateReason.Code|keyof typeof google.cloud.networkconnectivity.v1.Spoke.StateReason.Code); + + /** SpokeStateReasonCount count. */ + public count: (number|Long|string); + + /** + * Creates a new SpokeStateReasonCount instance using the specified properties. + * @param [properties] Properties to set + * @returns SpokeStateReasonCount instance + */ + public static create(properties?: google.cloud.networkconnectivity.v1.SpokeSummary.ISpokeStateReasonCount): google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount; + + /** + * Encodes the specified SpokeStateReasonCount message. Does not implicitly {@link google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount.verify|verify} messages. + * @param message SpokeStateReasonCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkconnectivity.v1.SpokeSummary.ISpokeStateReasonCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpokeStateReasonCount message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount.verify|verify} messages. + * @param message SpokeStateReasonCount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.SpokeSummary.ISpokeStateReasonCount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpokeStateReasonCount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpokeStateReasonCount + * @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.SpokeSummary.SpokeStateReasonCount; + + /** + * Decodes a SpokeStateReasonCount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpokeStateReasonCount + * @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.SpokeSummary.SpokeStateReasonCount; + + /** + * Verifies a SpokeStateReasonCount 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 SpokeStateReasonCount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpokeStateReasonCount + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount; + + /** + * Creates a plain object from a SpokeStateReasonCount message. Also converts values to other types if specified. + * @param message SpokeStateReasonCount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpokeStateReasonCount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SpokeStateReasonCount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a GetGroupRequest. */ + interface IGetGroupRequest { + + /** GetGroupRequest name */ + name?: (string|null); + } + + /** Represents a GetGroupRequest. */ + class GetGroupRequest implements IGetGroupRequest { + + /** + * Constructs a new GetGroupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.networkconnectivity.v1.IGetGroupRequest); + + /** GetGroupRequest name. */ + public name: string; + + /** + * Creates a new GetGroupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetGroupRequest instance + */ + public static create(properties?: google.cloud.networkconnectivity.v1.IGetGroupRequest): google.cloud.networkconnectivity.v1.GetGroupRequest; + + /** + * Encodes the specified GetGroupRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.GetGroupRequest.verify|verify} messages. + * @param message GetGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.networkconnectivity.v1.IGetGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.GetGroupRequest.verify|verify} messages. + * @param message GetGroupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.networkconnectivity.v1.IGetGroupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetGroupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetGroupRequest + * @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.GetGroupRequest; + + /** + * Decodes a GetGroupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetGroupRequest + * @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.GetGroupRequest; + + /** + * Verifies a GetGroupRequest 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 GetGroupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetGroupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.networkconnectivity.v1.GetGroupRequest; + + /** + * Creates a plain object from a GetGroupRequest message. Also converts values to other types if specified. + * @param message GetGroupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.networkconnectivity.v1.GetGroupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetGroupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetGroupRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ diff --git a/packages/google-cloud-networkconnectivity/protos/protos.js b/packages/google-cloud-networkconnectivity/protos/protos.js index 797396aa842..ebabe7b9a5a 100644 --- a/packages/google-cloud-networkconnectivity/protos/protos.js +++ b/packages/google-cloud-networkconnectivity/protos/protos.js @@ -615,6 +615,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.networkconnectivity.v1.HubService|listHubSpokes}. + * @memberof google.cloud.networkconnectivity.v1.HubService + * @typedef ListHubSpokesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networkconnectivity.v1.ListHubSpokesResponse} [response] ListHubSpokesResponse + */ + + /** + * Calls ListHubSpokes. + * @function listHubSpokes + * @memberof google.cloud.networkconnectivity.v1.HubService + * @instance + * @param {google.cloud.networkconnectivity.v1.IListHubSpokesRequest} request ListHubSpokesRequest message or plain object + * @param {google.cloud.networkconnectivity.v1.HubService.ListHubSpokesCallback} callback Node-style callback called with the error, if any, and ListHubSpokesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(HubService.prototype.listHubSpokes = function listHubSpokes(request, callback) { + return this.rpcCall(listHubSpokes, $root.google.cloud.networkconnectivity.v1.ListHubSpokesRequest, $root.google.cloud.networkconnectivity.v1.ListHubSpokesResponse, request, callback); + }, "name", { value: "ListHubSpokes" }); + + /** + * Calls ListHubSpokes. + * @function listHubSpokes + * @memberof google.cloud.networkconnectivity.v1.HubService + * @instance + * @param {google.cloud.networkconnectivity.v1.IListHubSpokesRequest} request ListHubSpokesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.networkconnectivity.v1.HubService|listSpokes}. * @memberof google.cloud.networkconnectivity.v1.HubService @@ -747,6 +780,72 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.networkconnectivity.v1.HubService|rejectHubSpoke}. + * @memberof google.cloud.networkconnectivity.v1.HubService + * @typedef RejectHubSpokeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RejectHubSpoke. + * @function rejectHubSpoke + * @memberof google.cloud.networkconnectivity.v1.HubService + * @instance + * @param {google.cloud.networkconnectivity.v1.IRejectHubSpokeRequest} request RejectHubSpokeRequest message or plain object + * @param {google.cloud.networkconnectivity.v1.HubService.RejectHubSpokeCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(HubService.prototype.rejectHubSpoke = function rejectHubSpoke(request, callback) { + return this.rpcCall(rejectHubSpoke, $root.google.cloud.networkconnectivity.v1.RejectHubSpokeRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RejectHubSpoke" }); + + /** + * Calls RejectHubSpoke. + * @function rejectHubSpoke + * @memberof google.cloud.networkconnectivity.v1.HubService + * @instance + * @param {google.cloud.networkconnectivity.v1.IRejectHubSpokeRequest} request RejectHubSpokeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkconnectivity.v1.HubService|acceptHubSpoke}. + * @memberof google.cloud.networkconnectivity.v1.HubService + * @typedef AcceptHubSpokeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls AcceptHubSpoke. + * @function acceptHubSpoke + * @memberof google.cloud.networkconnectivity.v1.HubService + * @instance + * @param {google.cloud.networkconnectivity.v1.IAcceptHubSpokeRequest} request AcceptHubSpokeRequest message or plain object + * @param {google.cloud.networkconnectivity.v1.HubService.AcceptHubSpokeCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(HubService.prototype.acceptHubSpoke = function acceptHubSpoke(request, callback) { + return this.rpcCall(acceptHubSpoke, $root.google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "AcceptHubSpoke" }); + + /** + * Calls AcceptHubSpoke. + * @function acceptHubSpoke + * @memberof google.cloud.networkconnectivity.v1.HubService + * @instance + * @param {google.cloud.networkconnectivity.v1.IAcceptHubSpokeRequest} request AcceptHubSpokeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.networkconnectivity.v1.HubService|deleteSpoke}. * @memberof google.cloud.networkconnectivity.v1.HubService @@ -780,6 +879,204 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.networkconnectivity.v1.HubService|getRouteTable}. + * @memberof google.cloud.networkconnectivity.v1.HubService + * @typedef GetRouteTableCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networkconnectivity.v1.RouteTable} [response] RouteTable + */ + + /** + * Calls GetRouteTable. + * @function getRouteTable + * @memberof google.cloud.networkconnectivity.v1.HubService + * @instance + * @param {google.cloud.networkconnectivity.v1.IGetRouteTableRequest} request GetRouteTableRequest message or plain object + * @param {google.cloud.networkconnectivity.v1.HubService.GetRouteTableCallback} callback Node-style callback called with the error, if any, and RouteTable + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(HubService.prototype.getRouteTable = function getRouteTable(request, callback) { + return this.rpcCall(getRouteTable, $root.google.cloud.networkconnectivity.v1.GetRouteTableRequest, $root.google.cloud.networkconnectivity.v1.RouteTable, request, callback); + }, "name", { value: "GetRouteTable" }); + + /** + * Calls GetRouteTable. + * @function getRouteTable + * @memberof google.cloud.networkconnectivity.v1.HubService + * @instance + * @param {google.cloud.networkconnectivity.v1.IGetRouteTableRequest} request GetRouteTableRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkconnectivity.v1.HubService|getRoute}. + * @memberof google.cloud.networkconnectivity.v1.HubService + * @typedef GetRouteCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networkconnectivity.v1.Route} [response] Route + */ + + /** + * Calls GetRoute. + * @function getRoute + * @memberof google.cloud.networkconnectivity.v1.HubService + * @instance + * @param {google.cloud.networkconnectivity.v1.IGetRouteRequest} request GetRouteRequest message or plain object + * @param {google.cloud.networkconnectivity.v1.HubService.GetRouteCallback} callback Node-style callback called with the error, if any, and Route + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(HubService.prototype.getRoute = function getRoute(request, callback) { + return this.rpcCall(getRoute, $root.google.cloud.networkconnectivity.v1.GetRouteRequest, $root.google.cloud.networkconnectivity.v1.Route, request, callback); + }, "name", { value: "GetRoute" }); + + /** + * Calls GetRoute. + * @function getRoute + * @memberof google.cloud.networkconnectivity.v1.HubService + * @instance + * @param {google.cloud.networkconnectivity.v1.IGetRouteRequest} request GetRouteRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkconnectivity.v1.HubService|listRoutes}. + * @memberof google.cloud.networkconnectivity.v1.HubService + * @typedef ListRoutesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networkconnectivity.v1.ListRoutesResponse} [response] ListRoutesResponse + */ + + /** + * Calls ListRoutes. + * @function listRoutes + * @memberof google.cloud.networkconnectivity.v1.HubService + * @instance + * @param {google.cloud.networkconnectivity.v1.IListRoutesRequest} request ListRoutesRequest message or plain object + * @param {google.cloud.networkconnectivity.v1.HubService.ListRoutesCallback} callback Node-style callback called with the error, if any, and ListRoutesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(HubService.prototype.listRoutes = function listRoutes(request, callback) { + return this.rpcCall(listRoutes, $root.google.cloud.networkconnectivity.v1.ListRoutesRequest, $root.google.cloud.networkconnectivity.v1.ListRoutesResponse, request, callback); + }, "name", { value: "ListRoutes" }); + + /** + * Calls ListRoutes. + * @function listRoutes + * @memberof google.cloud.networkconnectivity.v1.HubService + * @instance + * @param {google.cloud.networkconnectivity.v1.IListRoutesRequest} request ListRoutesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkconnectivity.v1.HubService|listRouteTables}. + * @memberof google.cloud.networkconnectivity.v1.HubService + * @typedef ListRouteTablesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networkconnectivity.v1.ListRouteTablesResponse} [response] ListRouteTablesResponse + */ + + /** + * Calls ListRouteTables. + * @function listRouteTables + * @memberof google.cloud.networkconnectivity.v1.HubService + * @instance + * @param {google.cloud.networkconnectivity.v1.IListRouteTablesRequest} request ListRouteTablesRequest message or plain object + * @param {google.cloud.networkconnectivity.v1.HubService.ListRouteTablesCallback} callback Node-style callback called with the error, if any, and ListRouteTablesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(HubService.prototype.listRouteTables = function listRouteTables(request, callback) { + return this.rpcCall(listRouteTables, $root.google.cloud.networkconnectivity.v1.ListRouteTablesRequest, $root.google.cloud.networkconnectivity.v1.ListRouteTablesResponse, request, callback); + }, "name", { value: "ListRouteTables" }); + + /** + * Calls ListRouteTables. + * @function listRouteTables + * @memberof google.cloud.networkconnectivity.v1.HubService + * @instance + * @param {google.cloud.networkconnectivity.v1.IListRouteTablesRequest} request ListRouteTablesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkconnectivity.v1.HubService|getGroup}. + * @memberof google.cloud.networkconnectivity.v1.HubService + * @typedef GetGroupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networkconnectivity.v1.Group} [response] Group + */ + + /** + * Calls GetGroup. + * @function getGroup + * @memberof google.cloud.networkconnectivity.v1.HubService + * @instance + * @param {google.cloud.networkconnectivity.v1.IGetGroupRequest} request GetGroupRequest message or plain object + * @param {google.cloud.networkconnectivity.v1.HubService.GetGroupCallback} callback Node-style callback called with the error, if any, and Group + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(HubService.prototype.getGroup = function getGroup(request, callback) { + return this.rpcCall(getGroup, $root.google.cloud.networkconnectivity.v1.GetGroupRequest, $root.google.cloud.networkconnectivity.v1.Group, request, callback); + }, "name", { value: "GetGroup" }); + + /** + * Calls GetGroup. + * @function getGroup + * @memberof google.cloud.networkconnectivity.v1.HubService + * @instance + * @param {google.cloud.networkconnectivity.v1.IGetGroupRequest} request GetGroupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.networkconnectivity.v1.HubService|listGroups}. + * @memberof google.cloud.networkconnectivity.v1.HubService + * @typedef ListGroupsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.networkconnectivity.v1.ListGroupsResponse} [response] ListGroupsResponse + */ + + /** + * Calls ListGroups. + * @function listGroups + * @memberof google.cloud.networkconnectivity.v1.HubService + * @instance + * @param {google.cloud.networkconnectivity.v1.IListGroupsRequest} request ListGroupsRequest message or plain object + * @param {google.cloud.networkconnectivity.v1.HubService.ListGroupsCallback} callback Node-style callback called with the error, if any, and ListGroupsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(HubService.prototype.listGroups = function listGroups(request, callback) { + return this.rpcCall(listGroups, $root.google.cloud.networkconnectivity.v1.ListGroupsRequest, $root.google.cloud.networkconnectivity.v1.ListGroupsResponse, request, callback); + }, "name", { value: "ListGroups" }); + + /** + * Calls ListGroups. + * @function listGroups + * @memberof google.cloud.networkconnectivity.v1.HubService + * @instance + * @param {google.cloud.networkconnectivity.v1.IListGroupsRequest} request ListGroupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return HubService; })(); @@ -799,6 +1096,22 @@ return values; })(); + /** + * RouteType enum. + * @name google.cloud.networkconnectivity.v1.RouteType + * @enum {number} + * @property {number} ROUTE_TYPE_UNSPECIFIED=0 ROUTE_TYPE_UNSPECIFIED value + * @property {number} VPC_PRIMARY_SUBNET=1 VPC_PRIMARY_SUBNET value + * @property {number} VPC_SECONDARY_SUBNET=2 VPC_SECONDARY_SUBNET value + */ + v1.RouteType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ROUTE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "VPC_PRIMARY_SUBNET"] = 1; + values[valuesById[2] = "VPC_SECONDARY_SUBNET"] = 2; + return values; + })(); + /** * State enum. * @name google.cloud.networkconnectivity.v1.State @@ -807,7 +1120,11 @@ * @property {number} CREATING=1 CREATING value * @property {number} ACTIVE=2 ACTIVE value * @property {number} DELETING=3 DELETING value + * @property {number} ACCEPTING=8 ACCEPTING value + * @property {number} REJECTING=9 REJECTING value * @property {number} UPDATING=6 UPDATING value + * @property {number} INACTIVE=7 INACTIVE value + * @property {number} OBSOLETE=10 OBSOLETE value */ v1.State = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -815,7 +1132,31 @@ values[valuesById[1] = "CREATING"] = 1; values[valuesById[2] = "ACTIVE"] = 2; values[valuesById[3] = "DELETING"] = 3; + values[valuesById[8] = "ACCEPTING"] = 8; + values[valuesById[9] = "REJECTING"] = 9; values[valuesById[6] = "UPDATING"] = 6; + values[valuesById[7] = "INACTIVE"] = 7; + values[valuesById[10] = "OBSOLETE"] = 10; + return values; + })(); + + /** + * SpokeType enum. + * @name google.cloud.networkconnectivity.v1.SpokeType + * @enum {number} + * @property {number} SPOKE_TYPE_UNSPECIFIED=0 SPOKE_TYPE_UNSPECIFIED value + * @property {number} VPN_TUNNEL=1 VPN_TUNNEL value + * @property {number} INTERCONNECT_ATTACHMENT=2 INTERCONNECT_ATTACHMENT value + * @property {number} ROUTER_APPLIANCE=3 ROUTER_APPLIANCE value + * @property {number} VPC_NETWORK=4 VPC_NETWORK value + */ + v1.SpokeType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SPOKE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "VPN_TUNNEL"] = 1; + values[valuesById[2] = "INTERCONNECT_ATTACHMENT"] = 2; + values[valuesById[3] = "ROUTER_APPLIANCE"] = 3; + values[valuesById[4] = "VPC_NETWORK"] = 4; return values; })(); @@ -833,6 +1174,8 @@ * @property {string|null} [uniqueId] Hub uniqueId * @property {google.cloud.networkconnectivity.v1.State|null} [state] Hub state * @property {Array.|null} [routingVpcs] Hub routingVpcs + * @property {Array.|null} [routeTables] Hub routeTables + * @property {google.cloud.networkconnectivity.v1.ISpokeSummary|null} [spokeSummary] Hub spokeSummary */ /** @@ -846,6 +1189,7 @@ function Hub(properties) { this.labels = {}; this.routingVpcs = []; + this.routeTables = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -916,6 +1260,22 @@ */ Hub.prototype.routingVpcs = $util.emptyArray; + /** + * Hub routeTables. + * @member {Array.} routeTables + * @memberof google.cloud.networkconnectivity.v1.Hub + * @instance + */ + Hub.prototype.routeTables = $util.emptyArray; + + /** + * Hub spokeSummary. + * @member {google.cloud.networkconnectivity.v1.ISpokeSummary|null|undefined} spokeSummary + * @memberof google.cloud.networkconnectivity.v1.Hub + * @instance + */ + Hub.prototype.spokeSummary = null; + /** * Creates a new Hub instance using the specified properties. * @function create @@ -958,6 +1318,11 @@ if (message.routingVpcs != null && message.routingVpcs.length) for (var i = 0; i < message.routingVpcs.length; ++i) $root.google.cloud.networkconnectivity.v1.RoutingVPC.encode(message.routingVpcs[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.routeTables != null && message.routeTables.length) + for (var i = 0; i < message.routeTables.length; ++i) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.routeTables[i]); + if (message.spokeSummary != null && Object.hasOwnProperty.call(message, "spokeSummary")) + $root.google.cloud.networkconnectivity.v1.SpokeSummary.encode(message.spokeSummary, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); return writer; }; @@ -1045,6 +1410,16 @@ message.routingVpcs.push($root.google.cloud.networkconnectivity.v1.RoutingVPC.decode(reader, reader.uint32())); break; } + case 11: { + if (!(message.routeTables && message.routeTables.length)) + message.routeTables = []; + message.routeTables.push(reader.string()); + break; + } + case 12: { + message.spokeSummary = $root.google.cloud.networkconnectivity.v1.SpokeSummary.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -1115,7 +1490,11 @@ case 1: case 2: case 3: + case 8: + case 9: case 6: + case 7: + case 10: break; } if (message.routingVpcs != null && message.hasOwnProperty("routingVpcs")) { @@ -1127,6 +1506,18 @@ return "routingVpcs." + error; } } + if (message.routeTables != null && message.hasOwnProperty("routeTables")) { + if (!Array.isArray(message.routeTables)) + return "routeTables: array expected"; + for (var i = 0; i < message.routeTables.length; ++i) + if (!$util.isString(message.routeTables[i])) + return "routeTables: string[] expected"; + } + if (message.spokeSummary != null && message.hasOwnProperty("spokeSummary")) { + var error = $root.google.cloud.networkconnectivity.v1.SpokeSummary.verify(message.spokeSummary); + if (error) + return "spokeSummary." + error; + } return null; }; @@ -1188,10 +1579,26 @@ case 3: message.state = 3; break; + case "ACCEPTING": + case 8: + message.state = 8; + break; + case "REJECTING": + case 9: + message.state = 9; + break; case "UPDATING": case 6: message.state = 6; break; + case "INACTIVE": + case 7: + message.state = 7; + break; + case "OBSOLETE": + case 10: + message.state = 10; + break; } if (object.routingVpcs) { if (!Array.isArray(object.routingVpcs)) @@ -1203,6 +1610,18 @@ message.routingVpcs[i] = $root.google.cloud.networkconnectivity.v1.RoutingVPC.fromObject(object.routingVpcs[i]); } } + if (object.routeTables) { + if (!Array.isArray(object.routeTables)) + throw TypeError(".google.cloud.networkconnectivity.v1.Hub.routeTables: array expected"); + message.routeTables = []; + for (var i = 0; i < object.routeTables.length; ++i) + message.routeTables[i] = String(object.routeTables[i]); + } + if (object.spokeSummary != null) { + if (typeof object.spokeSummary !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.Hub.spokeSummary: object expected"); + message.spokeSummary = $root.google.cloud.networkconnectivity.v1.SpokeSummary.fromObject(object.spokeSummary); + } return message; }; @@ -1219,8 +1638,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.routingVpcs = []; + object.routeTables = []; + } if (options.objects || options.defaults) object.labels = {}; if (options.defaults) { @@ -1230,6 +1651,7 @@ object.description = ""; object.uniqueId = ""; object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.spokeSummary = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -1254,6 +1676,13 @@ for (var j = 0; j < message.routingVpcs.length; ++j) object.routingVpcs[j] = $root.google.cloud.networkconnectivity.v1.RoutingVPC.toObject(message.routingVpcs[j], options); } + if (message.routeTables && message.routeTables.length) { + object.routeTables = []; + for (var j = 0; j < message.routeTables.length; ++j) + object.routeTables[j] = message.routeTables[j]; + } + if (message.spokeSummary != null && message.hasOwnProperty("spokeSummary")) + object.spokeSummary = $root.google.cloud.networkconnectivity.v1.SpokeSummary.toObject(message.spokeSummary, options); return object; }; @@ -1525,11 +1954,15 @@ * @property {Object.|null} [labels] Spoke labels * @property {string|null} [description] Spoke description * @property {string|null} [hub] Spoke hub + * @property {string|null} [group] Spoke group * @property {google.cloud.networkconnectivity.v1.ILinkedVpnTunnels|null} [linkedVpnTunnels] Spoke linkedVpnTunnels * @property {google.cloud.networkconnectivity.v1.ILinkedInterconnectAttachments|null} [linkedInterconnectAttachments] Spoke linkedInterconnectAttachments * @property {google.cloud.networkconnectivity.v1.ILinkedRouterApplianceInstances|null} [linkedRouterApplianceInstances] Spoke linkedRouterApplianceInstances + * @property {google.cloud.networkconnectivity.v1.ILinkedVpcNetwork|null} [linkedVpcNetwork] Spoke linkedVpcNetwork * @property {string|null} [uniqueId] Spoke uniqueId * @property {google.cloud.networkconnectivity.v1.State|null} [state] Spoke state + * @property {Array.|null} [reasons] Spoke reasons + * @property {google.cloud.networkconnectivity.v1.SpokeType|null} [spokeType] Spoke spokeType */ /** @@ -1542,6 +1975,7 @@ */ function Spoke(properties) { this.labels = {}; + this.reasons = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1596,6 +2030,14 @@ */ Spoke.prototype.hub = ""; + /** + * Spoke group. + * @member {string} group + * @memberof google.cloud.networkconnectivity.v1.Spoke + * @instance + */ + Spoke.prototype.group = ""; + /** * Spoke linkedVpnTunnels. * @member {google.cloud.networkconnectivity.v1.ILinkedVpnTunnels|null|undefined} linkedVpnTunnels @@ -1620,6 +2062,14 @@ */ Spoke.prototype.linkedRouterApplianceInstances = null; + /** + * Spoke linkedVpcNetwork. + * @member {google.cloud.networkconnectivity.v1.ILinkedVpcNetwork|null|undefined} linkedVpcNetwork + * @memberof google.cloud.networkconnectivity.v1.Spoke + * @instance + */ + Spoke.prototype.linkedVpcNetwork = null; + /** * Spoke uniqueId. * @member {string} uniqueId @@ -1636,6 +2086,22 @@ */ Spoke.prototype.state = 0; + /** + * Spoke reasons. + * @member {Array.} reasons + * @memberof google.cloud.networkconnectivity.v1.Spoke + * @instance + */ + Spoke.prototype.reasons = $util.emptyArray; + + /** + * Spoke spokeType. + * @member {google.cloud.networkconnectivity.v1.SpokeType} spokeType + * @memberof google.cloud.networkconnectivity.v1.Spoke + * @instance + */ + Spoke.prototype.spokeType = 0; + /** * Creates a new Spoke instance using the specified properties. * @function create @@ -1683,6 +2149,15 @@ $root.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments.encode(message.linkedInterconnectAttachments, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); if (message.linkedRouterApplianceInstances != null && Object.hasOwnProperty.call(message, "linkedRouterApplianceInstances")) $root.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances.encode(message.linkedRouterApplianceInstances, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.linkedVpcNetwork != null && Object.hasOwnProperty.call(message, "linkedVpcNetwork")) + $root.google.cloud.networkconnectivity.v1.LinkedVpcNetwork.encode(message.linkedVpcNetwork, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.reasons != null && message.reasons.length) + for (var i = 0; i < message.reasons.length; ++i) + $root.google.cloud.networkconnectivity.v1.Spoke.StateReason.encode(message.reasons[i], writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.spokeType != null && Object.hasOwnProperty.call(message, "spokeType")) + writer.uint32(/* id 22, wireType 0 =*/176).int32(message.spokeType); + if (message.group != null && Object.hasOwnProperty.call(message, "group")) + writer.uint32(/* id 23, wireType 2 =*/186).string(message.group); return writer; }; @@ -1760,6 +2235,10 @@ message.hub = reader.string(); break; } + case 23: { + message.group = reader.string(); + break; + } case 17: { message.linkedVpnTunnels = $root.google.cloud.networkconnectivity.v1.LinkedVpnTunnels.decode(reader, reader.uint32()); break; @@ -1772,6 +2251,10 @@ message.linkedRouterApplianceInstances = $root.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances.decode(reader, reader.uint32()); break; } + case 20: { + message.linkedVpcNetwork = $root.google.cloud.networkconnectivity.v1.LinkedVpcNetwork.decode(reader, reader.uint32()); + break; + } case 11: { message.uniqueId = reader.string(); break; @@ -1780,6 +2263,16 @@ message.state = reader.int32(); break; } + case 21: { + if (!(message.reasons && message.reasons.length)) + message.reasons = []; + message.reasons.push($root.google.cloud.networkconnectivity.v1.Spoke.StateReason.decode(reader, reader.uint32())); + break; + } + case 22: { + message.spokeType = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -1842,6 +2335,9 @@ if (message.hub != null && message.hasOwnProperty("hub")) if (!$util.isString(message.hub)) return "hub: string expected"; + if (message.group != null && message.hasOwnProperty("group")) + if (!$util.isString(message.group)) + return "group: string expected"; if (message.linkedVpnTunnels != null && message.hasOwnProperty("linkedVpnTunnels")) { var error = $root.google.cloud.networkconnectivity.v1.LinkedVpnTunnels.verify(message.linkedVpnTunnels); if (error) @@ -1857,6 +2353,11 @@ if (error) return "linkedRouterApplianceInstances." + error; } + if (message.linkedVpcNetwork != null && message.hasOwnProperty("linkedVpcNetwork")) { + var error = $root.google.cloud.networkconnectivity.v1.LinkedVpcNetwork.verify(message.linkedVpcNetwork); + if (error) + return "linkedVpcNetwork." + error; + } if (message.uniqueId != null && message.hasOwnProperty("uniqueId")) if (!$util.isString(message.uniqueId)) return "uniqueId: string expected"; @@ -1868,14 +2369,38 @@ case 1: case 2: case 3: + case 8: + case 9: case 6: + case 7: + case 10: break; } - return null; - }; - - /** - * Creates a Spoke message from a plain object. Also converts values to their respective internal types. + if (message.reasons != null && message.hasOwnProperty("reasons")) { + if (!Array.isArray(message.reasons)) + return "reasons: array expected"; + for (var i = 0; i < message.reasons.length; ++i) { + var error = $root.google.cloud.networkconnectivity.v1.Spoke.StateReason.verify(message.reasons[i]); + if (error) + return "reasons." + error; + } + } + if (message.spokeType != null && message.hasOwnProperty("spokeType")) + switch (message.spokeType) { + default: + return "spokeType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a Spoke message from a plain object. Also converts values to their respective internal types. * @function fromObject * @memberof google.cloud.networkconnectivity.v1.Spoke * @static @@ -1909,6 +2434,8 @@ message.description = String(object.description); if (object.hub != null) message.hub = String(object.hub); + if (object.group != null) + message.group = String(object.group); if (object.linkedVpnTunnels != null) { if (typeof object.linkedVpnTunnels !== "object") throw TypeError(".google.cloud.networkconnectivity.v1.Spoke.linkedVpnTunnels: object expected"); @@ -1924,6 +2451,11 @@ throw TypeError(".google.cloud.networkconnectivity.v1.Spoke.linkedRouterApplianceInstances: object expected"); message.linkedRouterApplianceInstances = $root.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances.fromObject(object.linkedRouterApplianceInstances); } + if (object.linkedVpcNetwork != null) { + if (typeof object.linkedVpcNetwork !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.Spoke.linkedVpcNetwork: object expected"); + message.linkedVpcNetwork = $root.google.cloud.networkconnectivity.v1.LinkedVpcNetwork.fromObject(object.linkedVpcNetwork); + } if (object.uniqueId != null) message.uniqueId = String(object.uniqueId); switch (object.state) { @@ -1949,10 +2481,64 @@ case 3: message.state = 3; break; + case "ACCEPTING": + case 8: + message.state = 8; + break; + case "REJECTING": + case 9: + message.state = 9; + break; case "UPDATING": case 6: message.state = 6; break; + case "INACTIVE": + case 7: + message.state = 7; + break; + case "OBSOLETE": + case 10: + message.state = 10; + break; + } + if (object.reasons) { + if (!Array.isArray(object.reasons)) + throw TypeError(".google.cloud.networkconnectivity.v1.Spoke.reasons: array expected"); + message.reasons = []; + for (var i = 0; i < object.reasons.length; ++i) { + if (typeof object.reasons[i] !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.Spoke.reasons: object expected"); + message.reasons[i] = $root.google.cloud.networkconnectivity.v1.Spoke.StateReason.fromObject(object.reasons[i]); + } + } + switch (object.spokeType) { + default: + if (typeof object.spokeType === "number") { + message.spokeType = object.spokeType; + break; + } + break; + case "SPOKE_TYPE_UNSPECIFIED": + case 0: + message.spokeType = 0; + break; + case "VPN_TUNNEL": + case 1: + message.spokeType = 1; + break; + case "INTERCONNECT_ATTACHMENT": + case 2: + message.spokeType = 2; + break; + case "ROUTER_APPLIANCE": + case 3: + message.spokeType = 3; + break; + case "VPC_NETWORK": + case 4: + message.spokeType = 4; + break; } return message; }; @@ -1970,6 +2556,8 @@ if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.reasons = []; if (options.objects || options.defaults) object.labels = {}; if (options.defaults) { @@ -1983,6 +2571,9 @@ object.linkedVpnTunnels = null; object.linkedInterconnectAttachments = null; object.linkedRouterApplianceInstances = null; + object.linkedVpcNetwork = null; + object.spokeType = options.enums === String ? "SPOKE_TYPE_UNSPECIFIED" : 0; + object.group = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -2010,6 +2601,17 @@ object.linkedInterconnectAttachments = $root.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments.toObject(message.linkedInterconnectAttachments, options); if (message.linkedRouterApplianceInstances != null && message.hasOwnProperty("linkedRouterApplianceInstances")) object.linkedRouterApplianceInstances = $root.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances.toObject(message.linkedRouterApplianceInstances, options); + if (message.linkedVpcNetwork != null && message.hasOwnProperty("linkedVpcNetwork")) + object.linkedVpcNetwork = $root.google.cloud.networkconnectivity.v1.LinkedVpcNetwork.toObject(message.linkedVpcNetwork, options); + if (message.reasons && message.reasons.length) { + object.reasons = []; + for (var j = 0; j < message.reasons.length; ++j) + object.reasons[j] = $root.google.cloud.networkconnectivity.v1.Spoke.StateReason.toObject(message.reasons[j], options); + } + if (message.spokeType != null && message.hasOwnProperty("spokeType")) + object.spokeType = options.enums === String ? $root.google.cloud.networkconnectivity.v1.SpokeType[message.spokeType] === undefined ? message.spokeType : $root.google.cloud.networkconnectivity.v1.SpokeType[message.spokeType] : message.spokeType; + if (message.group != null && message.hasOwnProperty("group")) + object.group = message.group; return object; }; @@ -2039,31 +2641,338 @@ return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.Spoke"; }; + Spoke.StateReason = (function() { + + /** + * Properties of a StateReason. + * @memberof google.cloud.networkconnectivity.v1.Spoke + * @interface IStateReason + * @property {google.cloud.networkconnectivity.v1.Spoke.StateReason.Code|null} [code] StateReason code + * @property {string|null} [message] StateReason message + * @property {string|null} [userDetails] StateReason userDetails + */ + + /** + * Constructs a new StateReason. + * @memberof google.cloud.networkconnectivity.v1.Spoke + * @classdesc Represents a StateReason. + * @implements IStateReason + * @constructor + * @param {google.cloud.networkconnectivity.v1.Spoke.IStateReason=} [properties] Properties to set + */ + function StateReason(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]]; + } + + /** + * StateReason code. + * @member {google.cloud.networkconnectivity.v1.Spoke.StateReason.Code} code + * @memberof google.cloud.networkconnectivity.v1.Spoke.StateReason + * @instance + */ + StateReason.prototype.code = 0; + + /** + * StateReason message. + * @member {string} message + * @memberof google.cloud.networkconnectivity.v1.Spoke.StateReason + * @instance + */ + StateReason.prototype.message = ""; + + /** + * StateReason userDetails. + * @member {string} userDetails + * @memberof google.cloud.networkconnectivity.v1.Spoke.StateReason + * @instance + */ + StateReason.prototype.userDetails = ""; + + /** + * Creates a new StateReason instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.Spoke.StateReason + * @static + * @param {google.cloud.networkconnectivity.v1.Spoke.IStateReason=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.Spoke.StateReason} StateReason instance + */ + StateReason.create = function create(properties) { + return new StateReason(properties); + }; + + /** + * Encodes the specified StateReason message. Does not implicitly {@link google.cloud.networkconnectivity.v1.Spoke.StateReason.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkconnectivity.v1.Spoke.StateReason + * @static + * @param {google.cloud.networkconnectivity.v1.Spoke.IStateReason} message StateReason message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StateReason.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.code != null && Object.hasOwnProperty.call(message, "code")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.code); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.message); + if (message.userDetails != null && Object.hasOwnProperty.call(message, "userDetails")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.userDetails); + return writer; + }; + + /** + * Encodes the specified StateReason message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.Spoke.StateReason.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkconnectivity.v1.Spoke.StateReason + * @static + * @param {google.cloud.networkconnectivity.v1.Spoke.IStateReason} message StateReason message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StateReason.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StateReason message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkconnectivity.v1.Spoke.StateReason + * @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.Spoke.StateReason} StateReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StateReason.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.Spoke.StateReason(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.code = reader.int32(); + break; + } + case 2: { + message.message = reader.string(); + break; + } + case 3: { + message.userDetails = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StateReason message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.Spoke.StateReason + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.Spoke.StateReason} StateReason + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StateReason.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StateReason message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.Spoke.StateReason + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StateReason.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.code != null && message.hasOwnProperty("code")) + switch (message.code) { + default: + return "code: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.message != null && message.hasOwnProperty("message")) + if (!$util.isString(message.message)) + return "message: string expected"; + if (message.userDetails != null && message.hasOwnProperty("userDetails")) + if (!$util.isString(message.userDetails)) + return "userDetails: string expected"; + return null; + }; + + /** + * Creates a StateReason message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.Spoke.StateReason + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.Spoke.StateReason} StateReason + */ + StateReason.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.Spoke.StateReason) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.Spoke.StateReason(); + switch (object.code) { + default: + if (typeof object.code === "number") { + message.code = object.code; + break; + } + break; + case "CODE_UNSPECIFIED": + case 0: + message.code = 0; + break; + case "PENDING_REVIEW": + case 1: + message.code = 1; + break; + case "REJECTED": + case 2: + message.code = 2; + break; + case "PAUSED": + case 3: + message.code = 3; + break; + case "FAILED": + case 4: + message.code = 4; + break; + } + if (object.message != null) + message.message = String(object.message); + if (object.userDetails != null) + message.userDetails = String(object.userDetails); + return message; + }; + + /** + * Creates a plain object from a StateReason message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.Spoke.StateReason + * @static + * @param {google.cloud.networkconnectivity.v1.Spoke.StateReason} message StateReason + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StateReason.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.code = options.enums === String ? "CODE_UNSPECIFIED" : 0; + object.message = ""; + object.userDetails = ""; + } + if (message.code != null && message.hasOwnProperty("code")) + object.code = options.enums === String ? $root.google.cloud.networkconnectivity.v1.Spoke.StateReason.Code[message.code] === undefined ? message.code : $root.google.cloud.networkconnectivity.v1.Spoke.StateReason.Code[message.code] : message.code; + if (message.message != null && message.hasOwnProperty("message")) + object.message = message.message; + if (message.userDetails != null && message.hasOwnProperty("userDetails")) + object.userDetails = message.userDetails; + return object; + }; + + /** + * Converts this StateReason to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.Spoke.StateReason + * @instance + * @returns {Object.} JSON object + */ + StateReason.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StateReason + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.Spoke.StateReason + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StateReason.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.Spoke.StateReason"; + }; + + /** + * Code enum. + * @name google.cloud.networkconnectivity.v1.Spoke.StateReason.Code + * @enum {number} + * @property {number} CODE_UNSPECIFIED=0 CODE_UNSPECIFIED value + * @property {number} PENDING_REVIEW=1 PENDING_REVIEW value + * @property {number} REJECTED=2 REJECTED value + * @property {number} PAUSED=3 PAUSED value + * @property {number} FAILED=4 FAILED value + */ + StateReason.Code = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING_REVIEW"] = 1; + values[valuesById[2] = "REJECTED"] = 2; + values[valuesById[3] = "PAUSED"] = 3; + values[valuesById[4] = "FAILED"] = 4; + return values; + })(); + + return StateReason; + })(); + return Spoke; })(); - v1.ListHubsRequest = (function() { + v1.RouteTable = (function() { /** - * Properties of a ListHubsRequest. + * Properties of a RouteTable. * @memberof google.cloud.networkconnectivity.v1 - * @interface IListHubsRequest - * @property {string|null} [parent] ListHubsRequest parent - * @property {number|null} [pageSize] ListHubsRequest pageSize - * @property {string|null} [pageToken] ListHubsRequest pageToken - * @property {string|null} [filter] ListHubsRequest filter - * @property {string|null} [orderBy] ListHubsRequest orderBy + * @interface IRouteTable + * @property {string|null} [name] RouteTable name + * @property {google.protobuf.ITimestamp|null} [createTime] RouteTable createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] RouteTable updateTime + * @property {Object.|null} [labels] RouteTable labels + * @property {string|null} [description] RouteTable description + * @property {string|null} [uid] RouteTable uid + * @property {google.cloud.networkconnectivity.v1.State|null} [state] RouteTable state */ /** - * Constructs a new ListHubsRequest. + * Constructs a new RouteTable. * @memberof google.cloud.networkconnectivity.v1 - * @classdesc Represents a ListHubsRequest. - * @implements IListHubsRequest + * @classdesc Represents a RouteTable. + * @implements IRouteTable * @constructor - * @param {google.cloud.networkconnectivity.v1.IListHubsRequest=} [properties] Properties to set + * @param {google.cloud.networkconnectivity.v1.IRouteTable=} [properties] Properties to set */ - function ListHubsRequest(properties) { + function RouteTable(properties) { + this.labels = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2071,131 +2980,179 @@ } /** - * ListHubsRequest parent. - * @member {string} parent - * @memberof google.cloud.networkconnectivity.v1.ListHubsRequest + * RouteTable name. + * @member {string} name + * @memberof google.cloud.networkconnectivity.v1.RouteTable * @instance */ - ListHubsRequest.prototype.parent = ""; + RouteTable.prototype.name = ""; /** - * ListHubsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.networkconnectivity.v1.ListHubsRequest + * RouteTable createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.networkconnectivity.v1.RouteTable * @instance */ - ListHubsRequest.prototype.pageSize = 0; + RouteTable.prototype.createTime = null; /** - * ListHubsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.networkconnectivity.v1.ListHubsRequest + * RouteTable updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.networkconnectivity.v1.RouteTable * @instance */ - ListHubsRequest.prototype.pageToken = ""; + RouteTable.prototype.updateTime = null; /** - * ListHubsRequest filter. - * @member {string} filter - * @memberof google.cloud.networkconnectivity.v1.ListHubsRequest + * RouteTable labels. + * @member {Object.} labels + * @memberof google.cloud.networkconnectivity.v1.RouteTable * @instance */ - ListHubsRequest.prototype.filter = ""; + RouteTable.prototype.labels = $util.emptyObject; /** - * ListHubsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.networkconnectivity.v1.ListHubsRequest + * RouteTable description. + * @member {string} description + * @memberof google.cloud.networkconnectivity.v1.RouteTable * @instance */ - ListHubsRequest.prototype.orderBy = ""; + RouteTable.prototype.description = ""; /** - * Creates a new ListHubsRequest instance using the specified properties. + * RouteTable uid. + * @member {string} uid + * @memberof google.cloud.networkconnectivity.v1.RouteTable + * @instance + */ + RouteTable.prototype.uid = ""; + + /** + * RouteTable state. + * @member {google.cloud.networkconnectivity.v1.State} state + * @memberof google.cloud.networkconnectivity.v1.RouteTable + * @instance + */ + RouteTable.prototype.state = 0; + + /** + * Creates a new RouteTable instance using the specified properties. * @function create - * @memberof google.cloud.networkconnectivity.v1.ListHubsRequest + * @memberof google.cloud.networkconnectivity.v1.RouteTable * @static - * @param {google.cloud.networkconnectivity.v1.IListHubsRequest=} [properties] Properties to set - * @returns {google.cloud.networkconnectivity.v1.ListHubsRequest} ListHubsRequest instance + * @param {google.cloud.networkconnectivity.v1.IRouteTable=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.RouteTable} RouteTable instance */ - ListHubsRequest.create = function create(properties) { - return new ListHubsRequest(properties); + RouteTable.create = function create(properties) { + return new RouteTable(properties); }; /** - * Encodes the specified ListHubsRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListHubsRequest.verify|verify} messages. + * Encodes the specified RouteTable message. Does not implicitly {@link google.cloud.networkconnectivity.v1.RouteTable.verify|verify} messages. * @function encode - * @memberof google.cloud.networkconnectivity.v1.ListHubsRequest + * @memberof google.cloud.networkconnectivity.v1.RouteTable * @static - * @param {google.cloud.networkconnectivity.v1.IListHubsRequest} message ListHubsRequest message or plain object to encode + * @param {google.cloud.networkconnectivity.v1.IRouteTable} message RouteTable message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListHubsRequest.encode = function encode(message, writer) { + RouteTable.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.uid); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); return writer; }; /** - * Encodes the specified ListHubsRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListHubsRequest.verify|verify} messages. + * Encodes the specified RouteTable message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.RouteTable.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.networkconnectivity.v1.ListHubsRequest + * @memberof google.cloud.networkconnectivity.v1.RouteTable * @static - * @param {google.cloud.networkconnectivity.v1.IListHubsRequest} message ListHubsRequest message or plain object to encode + * @param {google.cloud.networkconnectivity.v1.IRouteTable} message RouteTable message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListHubsRequest.encodeDelimited = function encodeDelimited(message, writer) { + RouteTable.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListHubsRequest message from the specified reader or buffer. + * Decodes a RouteTable message from the specified reader or buffer. * @function decode - * @memberof google.cloud.networkconnectivity.v1.ListHubsRequest + * @memberof google.cloud.networkconnectivity.v1.RouteTable * @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.ListHubsRequest} ListHubsRequest + * @returns {google.cloud.networkconnectivity.v1.RouteTable} RouteTable * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListHubsRequest.decode = function decode(reader, length) { + RouteTable.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.ListHubsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkconnectivity.v1.RouteTable(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.name = reader.string(); break; } case 2: { - message.pageSize = reader.int32(); + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } case 3: { - message.pageToken = reader.string(); + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } case 4: { - message.filter = reader.string(); + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; break; } case 5: { - message.orderBy = reader.string(); + message.description = reader.string(); + break; + } + case 6: { + message.uid = reader.string(); + break; + } + case 7: { + message.state = reader.int32(); break; } default: @@ -2207,159 +3164,262 @@ }; /** - * Decodes a ListHubsRequest message from the specified reader or buffer, length delimited. + * Decodes a RouteTable message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.networkconnectivity.v1.ListHubsRequest + * @memberof google.cloud.networkconnectivity.v1.RouteTable * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networkconnectivity.v1.ListHubsRequest} ListHubsRequest + * @returns {google.cloud.networkconnectivity.v1.RouteTable} RouteTable * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListHubsRequest.decodeDelimited = function decodeDelimited(reader) { + RouteTable.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListHubsRequest message. + * Verifies a RouteTable message. * @function verify - * @memberof google.cloud.networkconnectivity.v1.ListHubsRequest + * @memberof google.cloud.networkconnectivity.v1.RouteTable * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListHubsRequest.verify = function verify(message) { + RouteTable.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 8: + case 9: + case 6: + case 7: + case 10: + break; + } return null; }; /** - * Creates a ListHubsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RouteTable message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.networkconnectivity.v1.ListHubsRequest + * @memberof google.cloud.networkconnectivity.v1.RouteTable * @static * @param {Object.} object Plain object - * @returns {google.cloud.networkconnectivity.v1.ListHubsRequest} ListHubsRequest + * @returns {google.cloud.networkconnectivity.v1.RouteTable} RouteTable */ - ListHubsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networkconnectivity.v1.ListHubsRequest) + RouteTable.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.RouteTable) return object; - var message = new $root.google.cloud.networkconnectivity.v1.ListHubsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); + var message = new $root.google.cloud.networkconnectivity.v1.RouteTable(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.RouteTable.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.RouteTable.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.RouteTable.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.description != null) + message.description = String(object.description); + if (object.uid != null) + message.uid = String(object.uid); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + case "ACCEPTING": + case 8: + message.state = 8; + break; + case "REJECTING": + case 9: + message.state = 9; + break; + case "UPDATING": + case 6: + message.state = 6; + break; + case "INACTIVE": + case 7: + message.state = 7; + break; + case "OBSOLETE": + case 10: + message.state = 10; + break; + } return message; }; /** - * Creates a plain object from a ListHubsRequest message. Also converts values to other types if specified. + * Creates a plain object from a RouteTable message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.networkconnectivity.v1.ListHubsRequest + * @memberof google.cloud.networkconnectivity.v1.RouteTable * @static - * @param {google.cloud.networkconnectivity.v1.ListHubsRequest} message ListHubsRequest + * @param {google.cloud.networkconnectivity.v1.RouteTable} message RouteTable * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListHubsRequest.toObject = function toObject(message, options) { + RouteTable.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.objects || options.defaults) + object.labels = {}; if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.description = ""; + object.uid = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - return object; - }; - - /** - * Converts this ListHubsRequest to JSON. - * @function toJSON - * @memberof google.cloud.networkconnectivity.v1.ListHubsRequest + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.networkconnectivity.v1.State[message.state] === undefined ? message.state : $root.google.cloud.networkconnectivity.v1.State[message.state] : message.state; + return object; + }; + + /** + * Converts this RouteTable to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.RouteTable * @instance * @returns {Object.} JSON object */ - ListHubsRequest.prototype.toJSON = function toJSON() { + RouteTable.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListHubsRequest + * Gets the default type url for RouteTable * @function getTypeUrl - * @memberof google.cloud.networkconnectivity.v1.ListHubsRequest + * @memberof google.cloud.networkconnectivity.v1.RouteTable * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListHubsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RouteTable.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.ListHubsRequest"; + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.RouteTable"; }; - return ListHubsRequest; + return RouteTable; })(); - v1.ListHubsResponse = (function() { + v1.Route = (function() { /** - * Properties of a ListHubsResponse. + * Properties of a Route. * @memberof google.cloud.networkconnectivity.v1 - * @interface IListHubsResponse - * @property {Array.|null} [hubs] ListHubsResponse hubs - * @property {string|null} [nextPageToken] ListHubsResponse nextPageToken - * @property {Array.|null} [unreachable] ListHubsResponse unreachable - */ - - /** - * Constructs a new ListHubsResponse. + * @interface IRoute + * @property {string|null} [name] Route name + * @property {google.protobuf.ITimestamp|null} [createTime] Route createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Route updateTime + * @property {string|null} [ipCidrRange] Route ipCidrRange + * @property {google.cloud.networkconnectivity.v1.RouteType|null} [type] Route type + * @property {google.cloud.networkconnectivity.v1.INextHopVpcNetwork|null} [nextHopVpcNetwork] Route nextHopVpcNetwork + * @property {Object.|null} [labels] Route labels + * @property {string|null} [description] Route description + * @property {string|null} [uid] Route uid + * @property {google.cloud.networkconnectivity.v1.State|null} [state] Route state + * @property {string|null} [spoke] Route spoke + * @property {string|null} [location] Route location + */ + + /** + * Constructs a new Route. * @memberof google.cloud.networkconnectivity.v1 - * @classdesc Represents a ListHubsResponse. - * @implements IListHubsResponse + * @classdesc Represents a Route. + * @implements IRoute * @constructor - * @param {google.cloud.networkconnectivity.v1.IListHubsResponse=} [properties] Properties to set + * @param {google.cloud.networkconnectivity.v1.IRoute=} [properties] Properties to set */ - function ListHubsResponse(properties) { - this.hubs = []; - this.unreachable = []; + function Route(properties) { + this.labels = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2367,109 +3427,249 @@ } /** - * ListHubsResponse hubs. - * @member {Array.} hubs - * @memberof google.cloud.networkconnectivity.v1.ListHubsResponse + * Route name. + * @member {string} name + * @memberof google.cloud.networkconnectivity.v1.Route * @instance */ - ListHubsResponse.prototype.hubs = $util.emptyArray; + Route.prototype.name = ""; /** - * ListHubsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.networkconnectivity.v1.ListHubsResponse + * Route createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.networkconnectivity.v1.Route * @instance */ - ListHubsResponse.prototype.nextPageToken = ""; + Route.prototype.createTime = null; /** - * ListHubsResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.networkconnectivity.v1.ListHubsResponse + * Route updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.networkconnectivity.v1.Route * @instance */ - ListHubsResponse.prototype.unreachable = $util.emptyArray; + Route.prototype.updateTime = null; /** - * Creates a new ListHubsResponse instance using the specified properties. + * Route ipCidrRange. + * @member {string} ipCidrRange + * @memberof google.cloud.networkconnectivity.v1.Route + * @instance + */ + Route.prototype.ipCidrRange = ""; + + /** + * Route type. + * @member {google.cloud.networkconnectivity.v1.RouteType} type + * @memberof google.cloud.networkconnectivity.v1.Route + * @instance + */ + Route.prototype.type = 0; + + /** + * Route nextHopVpcNetwork. + * @member {google.cloud.networkconnectivity.v1.INextHopVpcNetwork|null|undefined} nextHopVpcNetwork + * @memberof google.cloud.networkconnectivity.v1.Route + * @instance + */ + Route.prototype.nextHopVpcNetwork = null; + + /** + * Route labels. + * @member {Object.} labels + * @memberof google.cloud.networkconnectivity.v1.Route + * @instance + */ + Route.prototype.labels = $util.emptyObject; + + /** + * Route description. + * @member {string} description + * @memberof google.cloud.networkconnectivity.v1.Route + * @instance + */ + Route.prototype.description = ""; + + /** + * Route uid. + * @member {string} uid + * @memberof google.cloud.networkconnectivity.v1.Route + * @instance + */ + Route.prototype.uid = ""; + + /** + * Route state. + * @member {google.cloud.networkconnectivity.v1.State} state + * @memberof google.cloud.networkconnectivity.v1.Route + * @instance + */ + Route.prototype.state = 0; + + /** + * Route spoke. + * @member {string} spoke + * @memberof google.cloud.networkconnectivity.v1.Route + * @instance + */ + Route.prototype.spoke = ""; + + /** + * Route location. + * @member {string} location + * @memberof google.cloud.networkconnectivity.v1.Route + * @instance + */ + Route.prototype.location = ""; + + /** + * Creates a new Route instance using the specified properties. * @function create - * @memberof google.cloud.networkconnectivity.v1.ListHubsResponse + * @memberof google.cloud.networkconnectivity.v1.Route * @static - * @param {google.cloud.networkconnectivity.v1.IListHubsResponse=} [properties] Properties to set - * @returns {google.cloud.networkconnectivity.v1.ListHubsResponse} ListHubsResponse instance + * @param {google.cloud.networkconnectivity.v1.IRoute=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.Route} Route instance */ - ListHubsResponse.create = function create(properties) { - return new ListHubsResponse(properties); + Route.create = function create(properties) { + return new Route(properties); }; /** - * Encodes the specified ListHubsResponse message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListHubsResponse.verify|verify} messages. + * Encodes the specified Route message. Does not implicitly {@link google.cloud.networkconnectivity.v1.Route.verify|verify} messages. * @function encode - * @memberof google.cloud.networkconnectivity.v1.ListHubsResponse + * @memberof google.cloud.networkconnectivity.v1.Route * @static - * @param {google.cloud.networkconnectivity.v1.IListHubsResponse} message ListHubsResponse message or plain object to encode + * @param {google.cloud.networkconnectivity.v1.IRoute} message Route message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListHubsResponse.encode = function encode(message, writer) { + Route.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.hubs != null && message.hubs.length) - for (var i = 0; i < message.hubs.length; ++i) - $root.google.cloud.networkconnectivity.v1.Hub.encode(message.hubs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + if (message.ipCidrRange != null && Object.hasOwnProperty.call(message, "ipCidrRange")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ipCidrRange); + if (message.nextHopVpcNetwork != null && Object.hasOwnProperty.call(message, "nextHopVpcNetwork")) + $root.google.cloud.networkconnectivity.v1.NextHopVpcNetwork.encode(message.nextHopVpcNetwork, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.description); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.uid); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.state); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.type); + if (message.spoke != null && Object.hasOwnProperty.call(message, "spoke")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.spoke); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.location); return writer; }; /** - * Encodes the specified ListHubsResponse message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListHubsResponse.verify|verify} messages. + * Encodes the specified Route message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.Route.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.networkconnectivity.v1.ListHubsResponse + * @memberof google.cloud.networkconnectivity.v1.Route * @static - * @param {google.cloud.networkconnectivity.v1.IListHubsResponse} message ListHubsResponse message or plain object to encode + * @param {google.cloud.networkconnectivity.v1.IRoute} message Route message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListHubsResponse.encodeDelimited = function encodeDelimited(message, writer) { + Route.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListHubsResponse message from the specified reader or buffer. + * Decodes a Route message from the specified reader or buffer. * @function decode - * @memberof google.cloud.networkconnectivity.v1.ListHubsResponse + * @memberof google.cloud.networkconnectivity.v1.Route * @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.ListHubsResponse} ListHubsResponse + * @returns {google.cloud.networkconnectivity.v1.Route} Route * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListHubsResponse.decode = function decode(reader, length) { + Route.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.ListHubsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkconnectivity.v1.Route(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 3: { + message.name = reader.string(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } case 1: { - if (!(message.hubs && message.hubs.length)) - message.hubs = []; - message.hubs.push($root.google.cloud.networkconnectivity.v1.Hub.decode(reader, reader.uint32())); + message.ipCidrRange = reader.string(); + break; + } + case 10: { + message.type = reader.int32(); break; } case 2: { - message.nextPageToken = reader.string(); + message.nextHopVpcNetwork = $root.google.cloud.networkconnectivity.v1.NextHopVpcNetwork.decode(reader, reader.uint32()); break; } - case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); + case 6: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 7: { + message.description = reader.string(); + break; + } + case 8: { + message.uid = reader.string(); + break; + } + case 9: { + message.state = reader.int32(); + break; + } + case 11: { + message.spoke = reader.string(); + break; + } + case 12: { + message.location = reader.string(); break; } default: @@ -2481,169 +3681,326 @@ }; /** - * Decodes a ListHubsResponse message from the specified reader or buffer, length delimited. + * Decodes a Route message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.networkconnectivity.v1.ListHubsResponse + * @memberof google.cloud.networkconnectivity.v1.Route * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networkconnectivity.v1.ListHubsResponse} ListHubsResponse + * @returns {google.cloud.networkconnectivity.v1.Route} Route * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListHubsResponse.decodeDelimited = function decodeDelimited(reader) { + Route.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListHubsResponse message. + * Verifies a Route message. * @function verify - * @memberof google.cloud.networkconnectivity.v1.ListHubsResponse + * @memberof google.cloud.networkconnectivity.v1.Route * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListHubsResponse.verify = function verify(message) { + Route.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.hubs != null && message.hasOwnProperty("hubs")) { - if (!Array.isArray(message.hubs)) - return "hubs: array expected"; - for (var i = 0; i < message.hubs.length; ++i) { - var error = $root.google.cloud.networkconnectivity.v1.Hub.verify(message.hubs[i]); - if (error) - return "hubs." + error; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.ipCidrRange != null && message.hasOwnProperty("ipCidrRange")) + if (!$util.isString(message.ipCidrRange)) + return "ipCidrRange: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; } + if (message.nextHopVpcNetwork != null && message.hasOwnProperty("nextHopVpcNetwork")) { + var error = $root.google.cloud.networkconnectivity.v1.NextHopVpcNetwork.verify(message.nextHopVpcNetwork); + if (error) + return "nextHopVpcNetwork." + error; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; } - return null; - }; - - /** - * Creates a ListHubsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.networkconnectivity.v1.ListHubsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.networkconnectivity.v1.ListHubsResponse} ListHubsResponse - */ - ListHubsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networkconnectivity.v1.ListHubsResponse) + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 8: + case 9: + case 6: + case 7: + case 10: + break; + } + if (message.spoke != null && message.hasOwnProperty("spoke")) + if (!$util.isString(message.spoke)) + return "spoke: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates a Route message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.Route + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.Route} Route + */ + Route.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.Route) return object; - var message = new $root.google.cloud.networkconnectivity.v1.ListHubsResponse(); - if (object.hubs) { - if (!Array.isArray(object.hubs)) - throw TypeError(".google.cloud.networkconnectivity.v1.ListHubsResponse.hubs: array expected"); - message.hubs = []; - for (var i = 0; i < object.hubs.length; ++i) { - if (typeof object.hubs[i] !== "object") - throw TypeError(".google.cloud.networkconnectivity.v1.ListHubsResponse.hubs: object expected"); - message.hubs[i] = $root.google.cloud.networkconnectivity.v1.Hub.fromObject(object.hubs[i]); + var message = new $root.google.cloud.networkconnectivity.v1.Route(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.Route.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.Route.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.ipCidrRange != null) + message.ipCidrRange = String(object.ipCidrRange); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; } + break; + case "ROUTE_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "VPC_PRIMARY_SUBNET": + case 1: + message.type = 1; + break; + case "VPC_SECONDARY_SUBNET": + case 2: + message.type = 2; + break; } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.networkconnectivity.v1.ListHubsResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); + if (object.nextHopVpcNetwork != null) { + if (typeof object.nextHopVpcNetwork !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.Route.nextHopVpcNetwork: object expected"); + message.nextHopVpcNetwork = $root.google.cloud.networkconnectivity.v1.NextHopVpcNetwork.fromObject(object.nextHopVpcNetwork); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.Route.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.description != null) + message.description = String(object.description); + if (object.uid != null) + message.uid = String(object.uid); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + case "ACCEPTING": + case 8: + message.state = 8; + break; + case "REJECTING": + case 9: + message.state = 9; + break; + case "UPDATING": + case 6: + message.state = 6; + break; + case "INACTIVE": + case 7: + message.state = 7; + break; + case "OBSOLETE": + case 10: + message.state = 10; + break; } + if (object.spoke != null) + message.spoke = String(object.spoke); + if (object.location != null) + message.location = String(object.location); return message; }; /** - * Creates a plain object from a ListHubsResponse message. Also converts values to other types if specified. + * Creates a plain object from a Route message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.networkconnectivity.v1.ListHubsResponse + * @memberof google.cloud.networkconnectivity.v1.Route * @static - * @param {google.cloud.networkconnectivity.v1.ListHubsResponse} message ListHubsResponse + * @param {google.cloud.networkconnectivity.v1.Route} message Route * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListHubsResponse.toObject = function toObject(message, options) { + Route.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.hubs = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.hubs && message.hubs.length) { - object.hubs = []; - for (var j = 0; j < message.hubs.length; ++j) - object.hubs[j] = $root.google.cloud.networkconnectivity.v1.Hub.toObject(message.hubs[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.ipCidrRange = ""; + object.nextHopVpcNetwork = null; + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.description = ""; + object.uid = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.type = options.enums === String ? "ROUTE_TYPE_UNSPECIFIED" : 0; + object.spoke = ""; + object.location = ""; + } + if (message.ipCidrRange != null && message.hasOwnProperty("ipCidrRange")) + object.ipCidrRange = message.ipCidrRange; + if (message.nextHopVpcNetwork != null && message.hasOwnProperty("nextHopVpcNetwork")) + object.nextHopVpcNetwork = $root.google.cloud.networkconnectivity.v1.NextHopVpcNetwork.toObject(message.nextHopVpcNetwork, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.networkconnectivity.v1.State[message.state] === undefined ? message.state : $root.google.cloud.networkconnectivity.v1.State[message.state] : message.state; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.networkconnectivity.v1.RouteType[message.type] === undefined ? message.type : $root.google.cloud.networkconnectivity.v1.RouteType[message.type] : message.type; + if (message.spoke != null && message.hasOwnProperty("spoke")) + object.spoke = message.spoke; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; return object; }; /** - * Converts this ListHubsResponse to JSON. + * Converts this Route to JSON. * @function toJSON - * @memberof google.cloud.networkconnectivity.v1.ListHubsResponse + * @memberof google.cloud.networkconnectivity.v1.Route * @instance * @returns {Object.} JSON object */ - ListHubsResponse.prototype.toJSON = function toJSON() { + Route.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListHubsResponse + * Gets the default type url for Route * @function getTypeUrl - * @memberof google.cloud.networkconnectivity.v1.ListHubsResponse + * @memberof google.cloud.networkconnectivity.v1.Route * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListHubsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Route.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.ListHubsResponse"; + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.Route"; }; - return ListHubsResponse; + return Route; })(); - v1.GetHubRequest = (function() { + v1.Group = (function() { /** - * Properties of a GetHubRequest. + * Properties of a Group. * @memberof google.cloud.networkconnectivity.v1 - * @interface IGetHubRequest - * @property {string|null} [name] GetHubRequest name + * @interface IGroup + * @property {string|null} [name] Group name + * @property {google.protobuf.ITimestamp|null} [createTime] Group createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Group updateTime + * @property {Object.|null} [labels] Group labels + * @property {string|null} [description] Group description + * @property {string|null} [uid] Group uid + * @property {google.cloud.networkconnectivity.v1.State|null} [state] Group state */ /** - * Constructs a new GetHubRequest. + * Constructs a new Group. * @memberof google.cloud.networkconnectivity.v1 - * @classdesc Represents a GetHubRequest. - * @implements IGetHubRequest + * @classdesc Represents a Group. + * @implements IGroup * @constructor - * @param {google.cloud.networkconnectivity.v1.IGetHubRequest=} [properties] Properties to set + * @param {google.cloud.networkconnectivity.v1.IGroup=} [properties] Properties to set */ - function GetHubRequest(properties) { + function Group(properties) { + this.labels = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2651,70 +4008,131 @@ } /** - * GetHubRequest name. + * Group name. * @member {string} name - * @memberof google.cloud.networkconnectivity.v1.GetHubRequest + * @memberof google.cloud.networkconnectivity.v1.Group * @instance */ - GetHubRequest.prototype.name = ""; + Group.prototype.name = ""; /** - * Creates a new GetHubRequest instance using the specified properties. + * Group createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.networkconnectivity.v1.Group + * @instance + */ + Group.prototype.createTime = null; + + /** + * Group updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.networkconnectivity.v1.Group + * @instance + */ + Group.prototype.updateTime = null; + + /** + * Group labels. + * @member {Object.} labels + * @memberof google.cloud.networkconnectivity.v1.Group + * @instance + */ + Group.prototype.labels = $util.emptyObject; + + /** + * Group description. + * @member {string} description + * @memberof google.cloud.networkconnectivity.v1.Group + * @instance + */ + Group.prototype.description = ""; + + /** + * Group uid. + * @member {string} uid + * @memberof google.cloud.networkconnectivity.v1.Group + * @instance + */ + Group.prototype.uid = ""; + + /** + * Group state. + * @member {google.cloud.networkconnectivity.v1.State} state + * @memberof google.cloud.networkconnectivity.v1.Group + * @instance + */ + Group.prototype.state = 0; + + /** + * Creates a new Group instance using the specified properties. * @function create - * @memberof google.cloud.networkconnectivity.v1.GetHubRequest + * @memberof google.cloud.networkconnectivity.v1.Group * @static - * @param {google.cloud.networkconnectivity.v1.IGetHubRequest=} [properties] Properties to set - * @returns {google.cloud.networkconnectivity.v1.GetHubRequest} GetHubRequest instance + * @param {google.cloud.networkconnectivity.v1.IGroup=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.Group} Group instance */ - GetHubRequest.create = function create(properties) { - return new GetHubRequest(properties); + Group.create = function create(properties) { + return new Group(properties); }; /** - * Encodes the specified GetHubRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.GetHubRequest.verify|verify} messages. + * Encodes the specified Group message. Does not implicitly {@link google.cloud.networkconnectivity.v1.Group.verify|verify} messages. * @function encode - * @memberof google.cloud.networkconnectivity.v1.GetHubRequest + * @memberof google.cloud.networkconnectivity.v1.Group * @static - * @param {google.cloud.networkconnectivity.v1.IGetHubRequest} message GetHubRequest message or plain object to encode + * @param {google.cloud.networkconnectivity.v1.IGroup} message Group message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetHubRequest.encode = function encode(message, writer) { + Group.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.description); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.uid); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); return writer; }; /** - * Encodes the specified GetHubRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.GetHubRequest.verify|verify} messages. + * Encodes the specified Group message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.Group.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.networkconnectivity.v1.GetHubRequest + * @memberof google.cloud.networkconnectivity.v1.Group * @static - * @param {google.cloud.networkconnectivity.v1.IGetHubRequest} message GetHubRequest message or plain object to encode + * @param {google.cloud.networkconnectivity.v1.IGroup} message Group message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetHubRequest.encodeDelimited = function encodeDelimited(message, writer) { + Group.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetHubRequest message from the specified reader or buffer. + * Decodes a Group message from the specified reader or buffer. * @function decode - * @memberof google.cloud.networkconnectivity.v1.GetHubRequest + * @memberof google.cloud.networkconnectivity.v1.Group * @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.GetHubRequest} GetHubRequest + * @returns {google.cloud.networkconnectivity.v1.Group} Group * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetHubRequest.decode = function decode(reader, length) { + Group.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.GetHubRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkconnectivity.v1.Group(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -2722,134 +4140,306 @@ message.name = reader.string(); break; } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetHubRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.networkconnectivity.v1.GetHubRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networkconnectivity.v1.GetHubRequest} GetHubRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetHubRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetHubRequest message. - * @function verify - * @memberof google.cloud.networkconnectivity.v1.GetHubRequest - * @static - * @param {Object.} message Plain object to verify + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 5: { + message.description = reader.string(); + break; + } + case 6: { + message.uid = reader.string(); + break; + } + case 7: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Group message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.Group + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.Group} Group + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Group.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Group message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.Group + * @static + * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetHubRequest.verify = function verify(message) { + Group.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 8: + case 9: + case 6: + case 7: + case 10: + break; + } return null; }; /** - * Creates a GetHubRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Group message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.networkconnectivity.v1.GetHubRequest + * @memberof google.cloud.networkconnectivity.v1.Group * @static * @param {Object.} object Plain object - * @returns {google.cloud.networkconnectivity.v1.GetHubRequest} GetHubRequest + * @returns {google.cloud.networkconnectivity.v1.Group} Group */ - GetHubRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networkconnectivity.v1.GetHubRequest) + Group.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.Group) return object; - var message = new $root.google.cloud.networkconnectivity.v1.GetHubRequest(); + var message = new $root.google.cloud.networkconnectivity.v1.Group(); if (object.name != null) message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.Group.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.Group.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.Group.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.description != null) + message.description = String(object.description); + if (object.uid != null) + message.uid = String(object.uid); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + case "ACCEPTING": + case 8: + message.state = 8; + break; + case "REJECTING": + case 9: + message.state = 9; + break; + case "UPDATING": + case 6: + message.state = 6; + break; + case "INACTIVE": + case 7: + message.state = 7; + break; + case "OBSOLETE": + case 10: + message.state = 10; + break; + } return message; }; /** - * Creates a plain object from a GetHubRequest message. Also converts values to other types if specified. + * Creates a plain object from a Group message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.networkconnectivity.v1.GetHubRequest + * @memberof google.cloud.networkconnectivity.v1.Group * @static - * @param {google.cloud.networkconnectivity.v1.GetHubRequest} message GetHubRequest + * @param {google.cloud.networkconnectivity.v1.Group} message Group * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetHubRequest.toObject = function toObject(message, options) { + Group.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { object.name = ""; + object.createTime = null; + object.updateTime = null; + object.description = ""; + object.uid = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.networkconnectivity.v1.State[message.state] === undefined ? message.state : $root.google.cloud.networkconnectivity.v1.State[message.state] : message.state; return object; }; /** - * Converts this GetHubRequest to JSON. + * Converts this Group to JSON. * @function toJSON - * @memberof google.cloud.networkconnectivity.v1.GetHubRequest + * @memberof google.cloud.networkconnectivity.v1.Group * @instance * @returns {Object.} JSON object */ - GetHubRequest.prototype.toJSON = function toJSON() { + Group.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetHubRequest + * Gets the default type url for Group * @function getTypeUrl - * @memberof google.cloud.networkconnectivity.v1.GetHubRequest + * @memberof google.cloud.networkconnectivity.v1.Group * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetHubRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Group.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.GetHubRequest"; + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.Group"; }; - return GetHubRequest; + return Group; })(); - v1.CreateHubRequest = (function() { + v1.ListHubsRequest = (function() { /** - * Properties of a CreateHubRequest. + * Properties of a ListHubsRequest. * @memberof google.cloud.networkconnectivity.v1 - * @interface ICreateHubRequest - * @property {string|null} [parent] CreateHubRequest parent - * @property {string|null} [hubId] CreateHubRequest hubId - * @property {google.cloud.networkconnectivity.v1.IHub|null} [hub] CreateHubRequest hub - * @property {string|null} [requestId] CreateHubRequest requestId + * @interface IListHubsRequest + * @property {string|null} [parent] ListHubsRequest parent + * @property {number|null} [pageSize] ListHubsRequest pageSize + * @property {string|null} [pageToken] ListHubsRequest pageToken + * @property {string|null} [filter] ListHubsRequest filter + * @property {string|null} [orderBy] ListHubsRequest orderBy */ /** - * Constructs a new CreateHubRequest. + * Constructs a new ListHubsRequest. * @memberof google.cloud.networkconnectivity.v1 - * @classdesc Represents a CreateHubRequest. - * @implements ICreateHubRequest + * @classdesc Represents a ListHubsRequest. + * @implements IListHubsRequest * @constructor - * @param {google.cloud.networkconnectivity.v1.ICreateHubRequest=} [properties] Properties to set + * @param {google.cloud.networkconnectivity.v1.IListHubsRequest=} [properties] Properties to set */ - function CreateHubRequest(properties) { + function ListHubsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2857,100 +4447,110 @@ } /** - * CreateHubRequest parent. + * ListHubsRequest parent. * @member {string} parent - * @memberof google.cloud.networkconnectivity.v1.CreateHubRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubsRequest * @instance */ - CreateHubRequest.prototype.parent = ""; + ListHubsRequest.prototype.parent = ""; /** - * CreateHubRequest hubId. - * @member {string} hubId - * @memberof google.cloud.networkconnectivity.v1.CreateHubRequest + * ListHubsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networkconnectivity.v1.ListHubsRequest * @instance */ - CreateHubRequest.prototype.hubId = ""; + ListHubsRequest.prototype.pageSize = 0; /** - * CreateHubRequest hub. - * @member {google.cloud.networkconnectivity.v1.IHub|null|undefined} hub - * @memberof google.cloud.networkconnectivity.v1.CreateHubRequest + * ListHubsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networkconnectivity.v1.ListHubsRequest * @instance */ - CreateHubRequest.prototype.hub = null; + ListHubsRequest.prototype.pageToken = ""; /** - * CreateHubRequest requestId. - * @member {string} requestId - * @memberof google.cloud.networkconnectivity.v1.CreateHubRequest + * ListHubsRequest filter. + * @member {string} filter + * @memberof google.cloud.networkconnectivity.v1.ListHubsRequest * @instance */ - CreateHubRequest.prototype.requestId = ""; + ListHubsRequest.prototype.filter = ""; /** - * Creates a new CreateHubRequest instance using the specified properties. - * @function create - * @memberof google.cloud.networkconnectivity.v1.CreateHubRequest - * @static - * @param {google.cloud.networkconnectivity.v1.ICreateHubRequest=} [properties] Properties to set - * @returns {google.cloud.networkconnectivity.v1.CreateHubRequest} CreateHubRequest instance + * ListHubsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.networkconnectivity.v1.ListHubsRequest + * @instance */ - CreateHubRequest.create = function create(properties) { - return new CreateHubRequest(properties); + ListHubsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListHubsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.ListHubsRequest + * @static + * @param {google.cloud.networkconnectivity.v1.IListHubsRequest=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.ListHubsRequest} ListHubsRequest instance + */ + ListHubsRequest.create = function create(properties) { + return new ListHubsRequest(properties); }; /** - * Encodes the specified CreateHubRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.CreateHubRequest.verify|verify} messages. + * Encodes the specified ListHubsRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListHubsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.networkconnectivity.v1.CreateHubRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubsRequest * @static - * @param {google.cloud.networkconnectivity.v1.ICreateHubRequest} message CreateHubRequest message or plain object to encode + * @param {google.cloud.networkconnectivity.v1.IListHubsRequest} message ListHubsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateHubRequest.encode = function encode(message, writer) { + ListHubsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.hubId != null && Object.hasOwnProperty.call(message, "hubId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.hubId); - if (message.hub != null && Object.hasOwnProperty.call(message, "hub")) - $root.google.cloud.networkconnectivity.v1.Hub.encode(message.hub, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); return writer; }; /** - * Encodes the specified CreateHubRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.CreateHubRequest.verify|verify} messages. + * Encodes the specified ListHubsRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListHubsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.networkconnectivity.v1.CreateHubRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubsRequest * @static - * @param {google.cloud.networkconnectivity.v1.ICreateHubRequest} message CreateHubRequest message or plain object to encode + * @param {google.cloud.networkconnectivity.v1.IListHubsRequest} message ListHubsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateHubRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListHubsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateHubRequest message from the specified reader or buffer. + * Decodes a ListHubsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.networkconnectivity.v1.CreateHubRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubsRequest * @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.CreateHubRequest} CreateHubRequest + * @returns {google.cloud.networkconnectivity.v1.ListHubsRequest} ListHubsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateHubRequest.decode = function decode(reader, length) { + ListHubsRequest.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.CreateHubRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkconnectivity.v1.ListHubsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -2959,15 +4559,19 @@ break; } case 2: { - message.hubId = reader.string(); + message.pageSize = reader.int32(); break; } case 3: { - message.hub = $root.google.cloud.networkconnectivity.v1.Hub.decode(reader, reader.uint32()); + message.pageToken = reader.string(); break; } case 4: { - message.requestId = reader.string(); + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); break; } default: @@ -2979,154 +4583,159 @@ }; /** - * Decodes a CreateHubRequest message from the specified reader or buffer, length delimited. + * Decodes a ListHubsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.networkconnectivity.v1.CreateHubRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networkconnectivity.v1.CreateHubRequest} CreateHubRequest + * @returns {google.cloud.networkconnectivity.v1.ListHubsRequest} ListHubsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateHubRequest.decodeDelimited = function decodeDelimited(reader) { + ListHubsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateHubRequest message. + * Verifies a ListHubsRequest message. * @function verify - * @memberof google.cloud.networkconnectivity.v1.CreateHubRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateHubRequest.verify = function verify(message) { + ListHubsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.hubId != null && message.hasOwnProperty("hubId")) - if (!$util.isString(message.hubId)) - return "hubId: string expected"; - if (message.hub != null && message.hasOwnProperty("hub")) { - var error = $root.google.cloud.networkconnectivity.v1.Hub.verify(message.hub); - if (error) - return "hub." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; return null; }; /** - * Creates a CreateHubRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListHubsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.networkconnectivity.v1.CreateHubRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.networkconnectivity.v1.CreateHubRequest} CreateHubRequest + * @returns {google.cloud.networkconnectivity.v1.ListHubsRequest} ListHubsRequest */ - CreateHubRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networkconnectivity.v1.CreateHubRequest) + ListHubsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.ListHubsRequest) return object; - var message = new $root.google.cloud.networkconnectivity.v1.CreateHubRequest(); + var message = new $root.google.cloud.networkconnectivity.v1.ListHubsRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.hubId != null) - message.hubId = String(object.hubId); - if (object.hub != null) { - if (typeof object.hub !== "object") - throw TypeError(".google.cloud.networkconnectivity.v1.CreateHubRequest.hub: object expected"); - message.hub = $root.google.cloud.networkconnectivity.v1.Hub.fromObject(object.hub); - } - if (object.requestId != null) - message.requestId = String(object.requestId); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); return message; }; /** - * Creates a plain object from a CreateHubRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListHubsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.networkconnectivity.v1.CreateHubRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubsRequest * @static - * @param {google.cloud.networkconnectivity.v1.CreateHubRequest} message CreateHubRequest + * @param {google.cloud.networkconnectivity.v1.ListHubsRequest} message ListHubsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateHubRequest.toObject = function toObject(message, options) { + ListHubsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.hubId = ""; - object.hub = null; - object.requestId = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.hubId != null && message.hasOwnProperty("hubId")) - object.hubId = message.hubId; - if (message.hub != null && message.hasOwnProperty("hub")) - object.hub = $root.google.cloud.networkconnectivity.v1.Hub.toObject(message.hub, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; return object; }; /** - * Converts this CreateHubRequest to JSON. + * Converts this ListHubsRequest to JSON. * @function toJSON - * @memberof google.cloud.networkconnectivity.v1.CreateHubRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubsRequest * @instance * @returns {Object.} JSON object */ - CreateHubRequest.prototype.toJSON = function toJSON() { + ListHubsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateHubRequest + * Gets the default type url for ListHubsRequest * @function getTypeUrl - * @memberof google.cloud.networkconnectivity.v1.CreateHubRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubsRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateHubRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListHubsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.CreateHubRequest"; + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.ListHubsRequest"; }; - return CreateHubRequest; + return ListHubsRequest; })(); - v1.UpdateHubRequest = (function() { + v1.ListHubsResponse = (function() { /** - * Properties of an UpdateHubRequest. + * Properties of a ListHubsResponse. * @memberof google.cloud.networkconnectivity.v1 - * @interface IUpdateHubRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateHubRequest updateMask - * @property {google.cloud.networkconnectivity.v1.IHub|null} [hub] UpdateHubRequest hub - * @property {string|null} [requestId] UpdateHubRequest requestId + * @interface IListHubsResponse + * @property {Array.|null} [hubs] ListHubsResponse hubs + * @property {string|null} [nextPageToken] ListHubsResponse nextPageToken + * @property {Array.|null} [unreachable] ListHubsResponse unreachable */ /** - * Constructs a new UpdateHubRequest. + * Constructs a new ListHubsResponse. * @memberof google.cloud.networkconnectivity.v1 - * @classdesc Represents an UpdateHubRequest. - * @implements IUpdateHubRequest + * @classdesc Represents a ListHubsResponse. + * @implements IListHubsResponse * @constructor - * @param {google.cloud.networkconnectivity.v1.IUpdateHubRequest=} [properties] Properties to set + * @param {google.cloud.networkconnectivity.v1.IListHubsResponse=} [properties] Properties to set */ - function UpdateHubRequest(properties) { + function ListHubsResponse(properties) { + this.hubs = []; + this.unreachable = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3134,103 +4743,109 @@ } /** - * UpdateHubRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.networkconnectivity.v1.UpdateHubRequest + * ListHubsResponse hubs. + * @member {Array.} hubs + * @memberof google.cloud.networkconnectivity.v1.ListHubsResponse * @instance */ - UpdateHubRequest.prototype.updateMask = null; + ListHubsResponse.prototype.hubs = $util.emptyArray; /** - * UpdateHubRequest hub. - * @member {google.cloud.networkconnectivity.v1.IHub|null|undefined} hub - * @memberof google.cloud.networkconnectivity.v1.UpdateHubRequest + * ListHubsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networkconnectivity.v1.ListHubsResponse * @instance */ - UpdateHubRequest.prototype.hub = null; + ListHubsResponse.prototype.nextPageToken = ""; /** - * UpdateHubRequest requestId. - * @member {string} requestId - * @memberof google.cloud.networkconnectivity.v1.UpdateHubRequest + * ListHubsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.networkconnectivity.v1.ListHubsResponse * @instance */ - UpdateHubRequest.prototype.requestId = ""; + ListHubsResponse.prototype.unreachable = $util.emptyArray; /** - * Creates a new UpdateHubRequest instance using the specified properties. + * Creates a new ListHubsResponse instance using the specified properties. * @function create - * @memberof google.cloud.networkconnectivity.v1.UpdateHubRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubsResponse * @static - * @param {google.cloud.networkconnectivity.v1.IUpdateHubRequest=} [properties] Properties to set - * @returns {google.cloud.networkconnectivity.v1.UpdateHubRequest} UpdateHubRequest instance + * @param {google.cloud.networkconnectivity.v1.IListHubsResponse=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.ListHubsResponse} ListHubsResponse instance */ - UpdateHubRequest.create = function create(properties) { - return new UpdateHubRequest(properties); + ListHubsResponse.create = function create(properties) { + return new ListHubsResponse(properties); }; /** - * Encodes the specified UpdateHubRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.UpdateHubRequest.verify|verify} messages. + * Encodes the specified ListHubsResponse message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListHubsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.networkconnectivity.v1.UpdateHubRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubsResponse * @static - * @param {google.cloud.networkconnectivity.v1.IUpdateHubRequest} message UpdateHubRequest message or plain object to encode + * @param {google.cloud.networkconnectivity.v1.IListHubsResponse} message ListHubsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateHubRequest.encode = function encode(message, writer) { + ListHubsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.hub != null && Object.hasOwnProperty.call(message, "hub")) - $root.google.cloud.networkconnectivity.v1.Hub.encode(message.hub, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.hubs != null && message.hubs.length) + for (var i = 0; i < message.hubs.length; ++i) + $root.google.cloud.networkconnectivity.v1.Hub.encode(message.hubs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); return writer; }; /** - * Encodes the specified UpdateHubRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.UpdateHubRequest.verify|verify} messages. + * Encodes the specified ListHubsResponse message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListHubsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.networkconnectivity.v1.UpdateHubRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubsResponse * @static - * @param {google.cloud.networkconnectivity.v1.IUpdateHubRequest} message UpdateHubRequest message or plain object to encode + * @param {google.cloud.networkconnectivity.v1.IListHubsResponse} message ListHubsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateHubRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListHubsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateHubRequest message from the specified reader or buffer. + * Decodes a ListHubsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.networkconnectivity.v1.UpdateHubRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubsResponse * @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.UpdateHubRequest} UpdateHubRequest + * @returns {google.cloud.networkconnectivity.v1.ListHubsResponse} ListHubsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateHubRequest.decode = function decode(reader, length) { + ListHubsResponse.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.UpdateHubRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkconnectivity.v1.ListHubsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + if (!(message.hubs && message.hubs.length)) + message.hubs = []; + message.hubs.push($root.google.cloud.networkconnectivity.v1.Hub.decode(reader, reader.uint32())); break; } case 2: { - message.hub = $root.google.cloud.networkconnectivity.v1.Hub.decode(reader, reader.uint32()); + message.nextPageToken = reader.string(); break; } case 3: { - message.requestId = reader.string(); + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); break; } default: @@ -3242,150 +4857,169 @@ }; /** - * Decodes an UpdateHubRequest message from the specified reader or buffer, length delimited. + * Decodes a ListHubsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.networkconnectivity.v1.UpdateHubRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networkconnectivity.v1.UpdateHubRequest} UpdateHubRequest + * @returns {google.cloud.networkconnectivity.v1.ListHubsResponse} ListHubsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateHubRequest.decodeDelimited = function decodeDelimited(reader) { + ListHubsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateHubRequest message. + * Verifies a ListHubsResponse message. * @function verify - * @memberof google.cloud.networkconnectivity.v1.UpdateHubRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateHubRequest.verify = function verify(message) { + ListHubsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; + if (message.hubs != null && message.hasOwnProperty("hubs")) { + if (!Array.isArray(message.hubs)) + return "hubs: array expected"; + for (var i = 0; i < message.hubs.length; ++i) { + var error = $root.google.cloud.networkconnectivity.v1.Hub.verify(message.hubs[i]); + if (error) + return "hubs." + error; + } } - if (message.hub != null && message.hasOwnProperty("hub")) { - var error = $root.google.cloud.networkconnectivity.v1.Hub.verify(message.hub); - if (error) - return "hub." + error; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; return null; }; /** - * Creates an UpdateHubRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListHubsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.networkconnectivity.v1.UpdateHubRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.networkconnectivity.v1.UpdateHubRequest} UpdateHubRequest + * @returns {google.cloud.networkconnectivity.v1.ListHubsResponse} ListHubsResponse */ - UpdateHubRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networkconnectivity.v1.UpdateHubRequest) + ListHubsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.ListHubsResponse) return object; - var message = new $root.google.cloud.networkconnectivity.v1.UpdateHubRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.networkconnectivity.v1.UpdateHubRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + var message = new $root.google.cloud.networkconnectivity.v1.ListHubsResponse(); + if (object.hubs) { + if (!Array.isArray(object.hubs)) + throw TypeError(".google.cloud.networkconnectivity.v1.ListHubsResponse.hubs: array expected"); + message.hubs = []; + for (var i = 0; i < object.hubs.length; ++i) { + if (typeof object.hubs[i] !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.ListHubsResponse.hubs: object expected"); + message.hubs[i] = $root.google.cloud.networkconnectivity.v1.Hub.fromObject(object.hubs[i]); + } } - if (object.hub != null) { - if (typeof object.hub !== "object") - throw TypeError(".google.cloud.networkconnectivity.v1.UpdateHubRequest.hub: object expected"); - message.hub = $root.google.cloud.networkconnectivity.v1.Hub.fromObject(object.hub); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.networkconnectivity.v1.ListHubsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); } - if (object.requestId != null) - message.requestId = String(object.requestId); return message; }; /** - * Creates a plain object from an UpdateHubRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListHubsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.networkconnectivity.v1.UpdateHubRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubsResponse * @static - * @param {google.cloud.networkconnectivity.v1.UpdateHubRequest} message UpdateHubRequest + * @param {google.cloud.networkconnectivity.v1.ListHubsResponse} message ListHubsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateHubRequest.toObject = function toObject(message, options) { + ListHubsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.updateMask = null; - object.hub = null; - object.requestId = ""; + if (options.arrays || options.defaults) { + object.hubs = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.hubs && message.hubs.length) { + object.hubs = []; + for (var j = 0; j < message.hubs.length; ++j) + object.hubs[j] = $root.google.cloud.networkconnectivity.v1.Hub.toObject(message.hubs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.hub != null && message.hasOwnProperty("hub")) - object.hub = $root.google.cloud.networkconnectivity.v1.Hub.toObject(message.hub, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; return object; }; /** - * Converts this UpdateHubRequest to JSON. + * Converts this ListHubsResponse to JSON. * @function toJSON - * @memberof google.cloud.networkconnectivity.v1.UpdateHubRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubsResponse * @instance * @returns {Object.} JSON object */ - UpdateHubRequest.prototype.toJSON = function toJSON() { + ListHubsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateHubRequest + * Gets the default type url for ListHubsResponse * @function getTypeUrl - * @memberof google.cloud.networkconnectivity.v1.UpdateHubRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubsResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateHubRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListHubsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.UpdateHubRequest"; + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.ListHubsResponse"; }; - return UpdateHubRequest; + return ListHubsResponse; })(); - v1.DeleteHubRequest = (function() { + v1.GetHubRequest = (function() { /** - * Properties of a DeleteHubRequest. + * Properties of a GetHubRequest. * @memberof google.cloud.networkconnectivity.v1 - * @interface IDeleteHubRequest - * @property {string|null} [name] DeleteHubRequest name - * @property {string|null} [requestId] DeleteHubRequest requestId + * @interface IGetHubRequest + * @property {string|null} [name] GetHubRequest name */ /** - * Constructs a new DeleteHubRequest. + * Constructs a new GetHubRequest. * @memberof google.cloud.networkconnectivity.v1 - * @classdesc Represents a DeleteHubRequest. - * @implements IDeleteHubRequest + * @classdesc Represents a GetHubRequest. + * @implements IGetHubRequest * @constructor - * @param {google.cloud.networkconnectivity.v1.IDeleteHubRequest=} [properties] Properties to set + * @param {google.cloud.networkconnectivity.v1.IGetHubRequest=} [properties] Properties to set */ - function DeleteHubRequest(properties) { + function GetHubRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3393,80 +5027,70 @@ } /** - * DeleteHubRequest name. + * GetHubRequest name. * @member {string} name - * @memberof google.cloud.networkconnectivity.v1.DeleteHubRequest - * @instance - */ - DeleteHubRequest.prototype.name = ""; - - /** - * DeleteHubRequest requestId. - * @member {string} requestId - * @memberof google.cloud.networkconnectivity.v1.DeleteHubRequest + * @memberof google.cloud.networkconnectivity.v1.GetHubRequest * @instance */ - DeleteHubRequest.prototype.requestId = ""; + GetHubRequest.prototype.name = ""; /** - * Creates a new DeleteHubRequest instance using the specified properties. + * Creates a new GetHubRequest instance using the specified properties. * @function create - * @memberof google.cloud.networkconnectivity.v1.DeleteHubRequest + * @memberof google.cloud.networkconnectivity.v1.GetHubRequest * @static - * @param {google.cloud.networkconnectivity.v1.IDeleteHubRequest=} [properties] Properties to set - * @returns {google.cloud.networkconnectivity.v1.DeleteHubRequest} DeleteHubRequest instance + * @param {google.cloud.networkconnectivity.v1.IGetHubRequest=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.GetHubRequest} GetHubRequest instance */ - DeleteHubRequest.create = function create(properties) { - return new DeleteHubRequest(properties); + GetHubRequest.create = function create(properties) { + return new GetHubRequest(properties); }; /** - * Encodes the specified DeleteHubRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.DeleteHubRequest.verify|verify} messages. + * Encodes the specified GetHubRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.GetHubRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.networkconnectivity.v1.DeleteHubRequest + * @memberof google.cloud.networkconnectivity.v1.GetHubRequest * @static - * @param {google.cloud.networkconnectivity.v1.IDeleteHubRequest} message DeleteHubRequest message or plain object to encode + * @param {google.cloud.networkconnectivity.v1.IGetHubRequest} message GetHubRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteHubRequest.encode = function encode(message, writer) { + GetHubRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); return writer; }; /** - * Encodes the specified DeleteHubRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.DeleteHubRequest.verify|verify} messages. + * Encodes the specified GetHubRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.GetHubRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.networkconnectivity.v1.DeleteHubRequest + * @memberof google.cloud.networkconnectivity.v1.GetHubRequest * @static - * @param {google.cloud.networkconnectivity.v1.IDeleteHubRequest} message DeleteHubRequest message or plain object to encode + * @param {google.cloud.networkconnectivity.v1.IGetHubRequest} message GetHubRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteHubRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetHubRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteHubRequest message from the specified reader or buffer. + * Decodes a GetHubRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.networkconnectivity.v1.DeleteHubRequest + * @memberof google.cloud.networkconnectivity.v1.GetHubRequest * @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.DeleteHubRequest} DeleteHubRequest + * @returns {google.cloud.networkconnectivity.v1.GetHubRequest} GetHubRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteHubRequest.decode = function decode(reader, length) { + GetHubRequest.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.DeleteHubRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkconnectivity.v1.GetHubRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -3474,10 +5098,6 @@ message.name = reader.string(); break; } - case 2: { - message.requestId = reader.string(); - break; - } default: reader.skipType(tag & 7); break; @@ -3487,135 +5107,125 @@ }; /** - * Decodes a DeleteHubRequest message from the specified reader or buffer, length delimited. + * Decodes a GetHubRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.networkconnectivity.v1.DeleteHubRequest + * @memberof google.cloud.networkconnectivity.v1.GetHubRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networkconnectivity.v1.DeleteHubRequest} DeleteHubRequest + * @returns {google.cloud.networkconnectivity.v1.GetHubRequest} GetHubRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteHubRequest.decodeDelimited = function decodeDelimited(reader) { + GetHubRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteHubRequest message. + * Verifies a GetHubRequest message. * @function verify - * @memberof google.cloud.networkconnectivity.v1.DeleteHubRequest + * @memberof google.cloud.networkconnectivity.v1.GetHubRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteHubRequest.verify = function verify(message) { + GetHubRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; return null; }; /** - * Creates a DeleteHubRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetHubRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.networkconnectivity.v1.DeleteHubRequest + * @memberof google.cloud.networkconnectivity.v1.GetHubRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.networkconnectivity.v1.DeleteHubRequest} DeleteHubRequest + * @returns {google.cloud.networkconnectivity.v1.GetHubRequest} GetHubRequest */ - DeleteHubRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networkconnectivity.v1.DeleteHubRequest) + GetHubRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.GetHubRequest) return object; - var message = new $root.google.cloud.networkconnectivity.v1.DeleteHubRequest(); + var message = new $root.google.cloud.networkconnectivity.v1.GetHubRequest(); if (object.name != null) message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); return message; }; /** - * Creates a plain object from a DeleteHubRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetHubRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.networkconnectivity.v1.DeleteHubRequest + * @memberof google.cloud.networkconnectivity.v1.GetHubRequest * @static - * @param {google.cloud.networkconnectivity.v1.DeleteHubRequest} message DeleteHubRequest + * @param {google.cloud.networkconnectivity.v1.GetHubRequest} message GetHubRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteHubRequest.toObject = function toObject(message, options) { + GetHubRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { + if (options.defaults) object.name = ""; - object.requestId = ""; - } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; return object; }; /** - * Converts this DeleteHubRequest to JSON. + * Converts this GetHubRequest to JSON. * @function toJSON - * @memberof google.cloud.networkconnectivity.v1.DeleteHubRequest + * @memberof google.cloud.networkconnectivity.v1.GetHubRequest * @instance * @returns {Object.} JSON object */ - DeleteHubRequest.prototype.toJSON = function toJSON() { + GetHubRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteHubRequest + * Gets the default type url for GetHubRequest * @function getTypeUrl - * @memberof google.cloud.networkconnectivity.v1.DeleteHubRequest + * @memberof google.cloud.networkconnectivity.v1.GetHubRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteHubRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetHubRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.DeleteHubRequest"; + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.GetHubRequest"; }; - return DeleteHubRequest; + return GetHubRequest; })(); - v1.ListSpokesRequest = (function() { + v1.CreateHubRequest = (function() { /** - * Properties of a ListSpokesRequest. + * Properties of a CreateHubRequest. * @memberof google.cloud.networkconnectivity.v1 - * @interface IListSpokesRequest - * @property {string|null} [parent] ListSpokesRequest parent - * @property {number|null} [pageSize] ListSpokesRequest pageSize - * @property {string|null} [pageToken] ListSpokesRequest pageToken - * @property {string|null} [filter] ListSpokesRequest filter - * @property {string|null} [orderBy] ListSpokesRequest orderBy + * @interface ICreateHubRequest + * @property {string|null} [parent] CreateHubRequest parent + * @property {string|null} [hubId] CreateHubRequest hubId + * @property {google.cloud.networkconnectivity.v1.IHub|null} [hub] CreateHubRequest hub + * @property {string|null} [requestId] CreateHubRequest requestId */ /** - * Constructs a new ListSpokesRequest. + * Constructs a new CreateHubRequest. * @memberof google.cloud.networkconnectivity.v1 - * @classdesc Represents a ListSpokesRequest. - * @implements IListSpokesRequest + * @classdesc Represents a CreateHubRequest. + * @implements ICreateHubRequest * @constructor - * @param {google.cloud.networkconnectivity.v1.IListSpokesRequest=} [properties] Properties to set + * @param {google.cloud.networkconnectivity.v1.ICreateHubRequest=} [properties] Properties to set */ - function ListSpokesRequest(properties) { + function CreateHubRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3623,110 +5233,100 @@ } /** - * ListSpokesRequest parent. + * CreateHubRequest parent. * @member {string} parent - * @memberof google.cloud.networkconnectivity.v1.ListSpokesRequest - * @instance - */ - ListSpokesRequest.prototype.parent = ""; - - /** - * ListSpokesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.networkconnectivity.v1.ListSpokesRequest + * @memberof google.cloud.networkconnectivity.v1.CreateHubRequest * @instance */ - ListSpokesRequest.prototype.pageSize = 0; + CreateHubRequest.prototype.parent = ""; /** - * ListSpokesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.networkconnectivity.v1.ListSpokesRequest + * CreateHubRequest hubId. + * @member {string} hubId + * @memberof google.cloud.networkconnectivity.v1.CreateHubRequest * @instance */ - ListSpokesRequest.prototype.pageToken = ""; + CreateHubRequest.prototype.hubId = ""; /** - * ListSpokesRequest filter. - * @member {string} filter - * @memberof google.cloud.networkconnectivity.v1.ListSpokesRequest + * CreateHubRequest hub. + * @member {google.cloud.networkconnectivity.v1.IHub|null|undefined} hub + * @memberof google.cloud.networkconnectivity.v1.CreateHubRequest * @instance */ - ListSpokesRequest.prototype.filter = ""; + CreateHubRequest.prototype.hub = null; /** - * ListSpokesRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.networkconnectivity.v1.ListSpokesRequest + * CreateHubRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networkconnectivity.v1.CreateHubRequest * @instance */ - ListSpokesRequest.prototype.orderBy = ""; + CreateHubRequest.prototype.requestId = ""; /** - * Creates a new ListSpokesRequest instance using the specified properties. + * Creates a new CreateHubRequest instance using the specified properties. * @function create - * @memberof google.cloud.networkconnectivity.v1.ListSpokesRequest + * @memberof google.cloud.networkconnectivity.v1.CreateHubRequest * @static - * @param {google.cloud.networkconnectivity.v1.IListSpokesRequest=} [properties] Properties to set - * @returns {google.cloud.networkconnectivity.v1.ListSpokesRequest} ListSpokesRequest instance + * @param {google.cloud.networkconnectivity.v1.ICreateHubRequest=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.CreateHubRequest} CreateHubRequest instance */ - ListSpokesRequest.create = function create(properties) { - return new ListSpokesRequest(properties); + CreateHubRequest.create = function create(properties) { + return new CreateHubRequest(properties); }; /** - * Encodes the specified ListSpokesRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListSpokesRequest.verify|verify} messages. + * Encodes the specified CreateHubRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.CreateHubRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.networkconnectivity.v1.ListSpokesRequest + * @memberof google.cloud.networkconnectivity.v1.CreateHubRequest * @static - * @param {google.cloud.networkconnectivity.v1.IListSpokesRequest} message ListSpokesRequest message or plain object to encode + * @param {google.cloud.networkconnectivity.v1.ICreateHubRequest} message CreateHubRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSpokesRequest.encode = function encode(message, writer) { + CreateHubRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + if (message.hubId != null && Object.hasOwnProperty.call(message, "hubId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.hubId); + if (message.hub != null && Object.hasOwnProperty.call(message, "hub")) + $root.google.cloud.networkconnectivity.v1.Hub.encode(message.hub, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); return writer; }; /** - * Encodes the specified ListSpokesRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListSpokesRequest.verify|verify} messages. + * Encodes the specified CreateHubRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.CreateHubRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.networkconnectivity.v1.ListSpokesRequest + * @memberof google.cloud.networkconnectivity.v1.CreateHubRequest * @static - * @param {google.cloud.networkconnectivity.v1.IListSpokesRequest} message ListSpokesRequest message or plain object to encode + * @param {google.cloud.networkconnectivity.v1.ICreateHubRequest} message CreateHubRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSpokesRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateHubRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListSpokesRequest message from the specified reader or buffer. + * Decodes a CreateHubRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.networkconnectivity.v1.ListSpokesRequest + * @memberof google.cloud.networkconnectivity.v1.CreateHubRequest * @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.ListSpokesRequest} ListSpokesRequest + * @returns {google.cloud.networkconnectivity.v1.CreateHubRequest} CreateHubRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSpokesRequest.decode = function decode(reader, length) { + CreateHubRequest.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.ListSpokesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkconnectivity.v1.CreateHubRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -3735,19 +5335,15 @@ break; } case 2: { - message.pageSize = reader.int32(); + message.hubId = reader.string(); break; } case 3: { - message.pageToken = reader.string(); + message.hub = $root.google.cloud.networkconnectivity.v1.Hub.decode(reader, reader.uint32()); break; } case 4: { - message.filter = reader.string(); - break; - } - case 5: { - message.orderBy = reader.string(); + message.requestId = reader.string(); break; } default: @@ -3759,159 +5355,154 @@ }; /** - * Decodes a ListSpokesRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateHubRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.networkconnectivity.v1.ListSpokesRequest + * @memberof google.cloud.networkconnectivity.v1.CreateHubRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networkconnectivity.v1.ListSpokesRequest} ListSpokesRequest + * @returns {google.cloud.networkconnectivity.v1.CreateHubRequest} CreateHubRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSpokesRequest.decodeDelimited = function decodeDelimited(reader) { + CreateHubRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListSpokesRequest message. + * Verifies a CreateHubRequest message. * @function verify - * @memberof google.cloud.networkconnectivity.v1.ListSpokesRequest + * @memberof google.cloud.networkconnectivity.v1.CreateHubRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListSpokesRequest.verify = function verify(message) { + CreateHubRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; + if (message.hubId != null && message.hasOwnProperty("hubId")) + if (!$util.isString(message.hubId)) + return "hubId: string expected"; + if (message.hub != null && message.hasOwnProperty("hub")) { + var error = $root.google.cloud.networkconnectivity.v1.Hub.verify(message.hub); + if (error) + return "hub." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; return null; }; /** - * Creates a ListSpokesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateHubRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.networkconnectivity.v1.ListSpokesRequest + * @memberof google.cloud.networkconnectivity.v1.CreateHubRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.networkconnectivity.v1.ListSpokesRequest} ListSpokesRequest + * @returns {google.cloud.networkconnectivity.v1.CreateHubRequest} CreateHubRequest */ - ListSpokesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networkconnectivity.v1.ListSpokesRequest) + CreateHubRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.CreateHubRequest) return object; - var message = new $root.google.cloud.networkconnectivity.v1.ListSpokesRequest(); + var message = new $root.google.cloud.networkconnectivity.v1.CreateHubRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); - if (object.orderBy != null) - message.orderBy = String(object.orderBy); + if (object.hubId != null) + message.hubId = String(object.hubId); + if (object.hub != null) { + if (typeof object.hub !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.CreateHubRequest.hub: object expected"); + message.hub = $root.google.cloud.networkconnectivity.v1.Hub.fromObject(object.hub); + } + if (object.requestId != null) + message.requestId = String(object.requestId); return message; }; /** - * Creates a plain object from a ListSpokesRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateHubRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.networkconnectivity.v1.ListSpokesRequest + * @memberof google.cloud.networkconnectivity.v1.CreateHubRequest * @static - * @param {google.cloud.networkconnectivity.v1.ListSpokesRequest} message ListSpokesRequest + * @param {google.cloud.networkconnectivity.v1.CreateHubRequest} message CreateHubRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListSpokesRequest.toObject = function toObject(message, options) { + CreateHubRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; + object.hubId = ""; + object.hub = null; + object.requestId = ""; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; + if (message.hubId != null && message.hasOwnProperty("hubId")) + object.hubId = message.hubId; + if (message.hub != null && message.hasOwnProperty("hub")) + object.hub = $root.google.cloud.networkconnectivity.v1.Hub.toObject(message.hub, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; return object; }; /** - * Converts this ListSpokesRequest to JSON. + * Converts this CreateHubRequest to JSON. * @function toJSON - * @memberof google.cloud.networkconnectivity.v1.ListSpokesRequest + * @memberof google.cloud.networkconnectivity.v1.CreateHubRequest * @instance * @returns {Object.} JSON object */ - ListSpokesRequest.prototype.toJSON = function toJSON() { + CreateHubRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListSpokesRequest + * Gets the default type url for CreateHubRequest * @function getTypeUrl - * @memberof google.cloud.networkconnectivity.v1.ListSpokesRequest + * @memberof google.cloud.networkconnectivity.v1.CreateHubRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListSpokesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateHubRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.ListSpokesRequest"; + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.CreateHubRequest"; }; - return ListSpokesRequest; + return CreateHubRequest; })(); - v1.ListSpokesResponse = (function() { + v1.UpdateHubRequest = (function() { /** - * Properties of a ListSpokesResponse. + * Properties of an UpdateHubRequest. * @memberof google.cloud.networkconnectivity.v1 - * @interface IListSpokesResponse - * @property {Array.|null} [spokes] ListSpokesResponse spokes - * @property {string|null} [nextPageToken] ListSpokesResponse nextPageToken - * @property {Array.|null} [unreachable] ListSpokesResponse unreachable + * @interface IUpdateHubRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateHubRequest updateMask + * @property {google.cloud.networkconnectivity.v1.IHub|null} [hub] UpdateHubRequest hub + * @property {string|null} [requestId] UpdateHubRequest requestId */ /** - * Constructs a new ListSpokesResponse. + * Constructs a new UpdateHubRequest. * @memberof google.cloud.networkconnectivity.v1 - * @classdesc Represents a ListSpokesResponse. - * @implements IListSpokesResponse + * @classdesc Represents an UpdateHubRequest. + * @implements IUpdateHubRequest * @constructor - * @param {google.cloud.networkconnectivity.v1.IListSpokesResponse=} [properties] Properties to set + * @param {google.cloud.networkconnectivity.v1.IUpdateHubRequest=} [properties] Properties to set */ - function ListSpokesResponse(properties) { - this.spokes = []; - this.unreachable = []; + function UpdateHubRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3919,109 +5510,103 @@ } /** - * ListSpokesResponse spokes. - * @member {Array.} spokes - * @memberof google.cloud.networkconnectivity.v1.ListSpokesResponse + * UpdateHubRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.networkconnectivity.v1.UpdateHubRequest * @instance */ - ListSpokesResponse.prototype.spokes = $util.emptyArray; + UpdateHubRequest.prototype.updateMask = null; /** - * ListSpokesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.networkconnectivity.v1.ListSpokesResponse + * UpdateHubRequest hub. + * @member {google.cloud.networkconnectivity.v1.IHub|null|undefined} hub + * @memberof google.cloud.networkconnectivity.v1.UpdateHubRequest * @instance */ - ListSpokesResponse.prototype.nextPageToken = ""; + UpdateHubRequest.prototype.hub = null; /** - * ListSpokesResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.networkconnectivity.v1.ListSpokesResponse + * UpdateHubRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networkconnectivity.v1.UpdateHubRequest * @instance */ - ListSpokesResponse.prototype.unreachable = $util.emptyArray; + UpdateHubRequest.prototype.requestId = ""; /** - * Creates a new ListSpokesResponse instance using the specified properties. + * Creates a new UpdateHubRequest instance using the specified properties. * @function create - * @memberof google.cloud.networkconnectivity.v1.ListSpokesResponse + * @memberof google.cloud.networkconnectivity.v1.UpdateHubRequest * @static - * @param {google.cloud.networkconnectivity.v1.IListSpokesResponse=} [properties] Properties to set - * @returns {google.cloud.networkconnectivity.v1.ListSpokesResponse} ListSpokesResponse instance + * @param {google.cloud.networkconnectivity.v1.IUpdateHubRequest=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.UpdateHubRequest} UpdateHubRequest instance */ - ListSpokesResponse.create = function create(properties) { - return new ListSpokesResponse(properties); + UpdateHubRequest.create = function create(properties) { + return new UpdateHubRequest(properties); }; /** - * Encodes the specified ListSpokesResponse message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListSpokesResponse.verify|verify} messages. + * Encodes the specified UpdateHubRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.UpdateHubRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.networkconnectivity.v1.ListSpokesResponse + * @memberof google.cloud.networkconnectivity.v1.UpdateHubRequest * @static - * @param {google.cloud.networkconnectivity.v1.IListSpokesResponse} message ListSpokesResponse message or plain object to encode + * @param {google.cloud.networkconnectivity.v1.IUpdateHubRequest} message UpdateHubRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSpokesResponse.encode = function encode(message, writer) { + UpdateHubRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.spokes != null && message.spokes.length) - for (var i = 0; i < message.spokes.length; ++i) - $root.google.cloud.networkconnectivity.v1.Spoke.encode(message.spokes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - if (message.unreachable != null && message.unreachable.length) - for (var i = 0; i < message.unreachable.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.hub != null && Object.hasOwnProperty.call(message, "hub")) + $root.google.cloud.networkconnectivity.v1.Hub.encode(message.hub, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); return writer; }; /** - * Encodes the specified ListSpokesResponse message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListSpokesResponse.verify|verify} messages. + * Encodes the specified UpdateHubRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.UpdateHubRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.networkconnectivity.v1.ListSpokesResponse + * @memberof google.cloud.networkconnectivity.v1.UpdateHubRequest * @static - * @param {google.cloud.networkconnectivity.v1.IListSpokesResponse} message ListSpokesResponse message or plain object to encode + * @param {google.cloud.networkconnectivity.v1.IUpdateHubRequest} message UpdateHubRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSpokesResponse.encodeDelimited = function encodeDelimited(message, writer) { + UpdateHubRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListSpokesResponse message from the specified reader or buffer. + * Decodes an UpdateHubRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.networkconnectivity.v1.ListSpokesResponse + * @memberof google.cloud.networkconnectivity.v1.UpdateHubRequest * @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.ListSpokesResponse} ListSpokesResponse + * @returns {google.cloud.networkconnectivity.v1.UpdateHubRequest} UpdateHubRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSpokesResponse.decode = function decode(reader, length) { + UpdateHubRequest.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.ListSpokesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkconnectivity.v1.UpdateHubRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.spokes && message.spokes.length)) - message.spokes = []; - message.spokes.push($root.google.cloud.networkconnectivity.v1.Spoke.decode(reader, reader.uint32())); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } case 2: { - message.nextPageToken = reader.string(); + message.hub = $root.google.cloud.networkconnectivity.v1.Hub.decode(reader, reader.uint32()); break; } case 3: { - if (!(message.unreachable && message.unreachable.length)) - message.unreachable = []; - message.unreachable.push(reader.string()); + message.requestId = reader.string(); break; } default: @@ -4033,169 +5618,150 @@ }; /** - * Decodes a ListSpokesResponse message from the specified reader or buffer, length delimited. + * Decodes an UpdateHubRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.networkconnectivity.v1.ListSpokesResponse + * @memberof google.cloud.networkconnectivity.v1.UpdateHubRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networkconnectivity.v1.ListSpokesResponse} ListSpokesResponse + * @returns {google.cloud.networkconnectivity.v1.UpdateHubRequest} UpdateHubRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSpokesResponse.decodeDelimited = function decodeDelimited(reader) { + UpdateHubRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListSpokesResponse message. + * Verifies an UpdateHubRequest message. * @function verify - * @memberof google.cloud.networkconnectivity.v1.ListSpokesResponse + * @memberof google.cloud.networkconnectivity.v1.UpdateHubRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListSpokesResponse.verify = function verify(message) { + UpdateHubRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.spokes != null && message.hasOwnProperty("spokes")) { - if (!Array.isArray(message.spokes)) - return "spokes: array expected"; - for (var i = 0; i < message.spokes.length; ++i) { - var error = $root.google.cloud.networkconnectivity.v1.Spoke.verify(message.spokes[i]); - if (error) - return "spokes." + error; - } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - if (message.unreachable != null && message.hasOwnProperty("unreachable")) { - if (!Array.isArray(message.unreachable)) - return "unreachable: array expected"; - for (var i = 0; i < message.unreachable.length; ++i) - if (!$util.isString(message.unreachable[i])) - return "unreachable: string[] expected"; + if (message.hub != null && message.hasOwnProperty("hub")) { + var error = $root.google.cloud.networkconnectivity.v1.Hub.verify(message.hub); + if (error) + return "hub." + error; } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; return null; }; /** - * Creates a ListSpokesResponse message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateHubRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.networkconnectivity.v1.ListSpokesResponse + * @memberof google.cloud.networkconnectivity.v1.UpdateHubRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.networkconnectivity.v1.ListSpokesResponse} ListSpokesResponse + * @returns {google.cloud.networkconnectivity.v1.UpdateHubRequest} UpdateHubRequest */ - ListSpokesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networkconnectivity.v1.ListSpokesResponse) + UpdateHubRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.UpdateHubRequest) return object; - var message = new $root.google.cloud.networkconnectivity.v1.ListSpokesResponse(); - if (object.spokes) { - if (!Array.isArray(object.spokes)) - throw TypeError(".google.cloud.networkconnectivity.v1.ListSpokesResponse.spokes: array expected"); - message.spokes = []; - for (var i = 0; i < object.spokes.length; ++i) { - if (typeof object.spokes[i] !== "object") - throw TypeError(".google.cloud.networkconnectivity.v1.ListSpokesResponse.spokes: object expected"); - message.spokes[i] = $root.google.cloud.networkconnectivity.v1.Spoke.fromObject(object.spokes[i]); - } + var message = new $root.google.cloud.networkconnectivity.v1.UpdateHubRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.UpdateHubRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.networkconnectivity.v1.ListSpokesResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); + if (object.hub != null) { + if (typeof object.hub !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.UpdateHubRequest.hub: object expected"); + message.hub = $root.google.cloud.networkconnectivity.v1.Hub.fromObject(object.hub); } + if (object.requestId != null) + message.requestId = String(object.requestId); return message; }; /** - * Creates a plain object from a ListSpokesResponse message. Also converts values to other types if specified. + * Creates a plain object from an UpdateHubRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.networkconnectivity.v1.ListSpokesResponse + * @memberof google.cloud.networkconnectivity.v1.UpdateHubRequest * @static - * @param {google.cloud.networkconnectivity.v1.ListSpokesResponse} message ListSpokesResponse + * @param {google.cloud.networkconnectivity.v1.UpdateHubRequest} message UpdateHubRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListSpokesResponse.toObject = function toObject(message, options) { + UpdateHubRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.spokes = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.spokes && message.spokes.length) { - object.spokes = []; - for (var j = 0; j < message.spokes.length; ++j) - object.spokes[j] = $root.google.cloud.networkconnectivity.v1.Spoke.toObject(message.spokes[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - if (message.unreachable && message.unreachable.length) { - object.unreachable = []; - for (var j = 0; j < message.unreachable.length; ++j) - object.unreachable[j] = message.unreachable[j]; + if (options.defaults) { + object.updateMask = null; + object.hub = null; + object.requestId = ""; } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.hub != null && message.hasOwnProperty("hub")) + object.hub = $root.google.cloud.networkconnectivity.v1.Hub.toObject(message.hub, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; return object; }; /** - * Converts this ListSpokesResponse to JSON. + * Converts this UpdateHubRequest to JSON. * @function toJSON - * @memberof google.cloud.networkconnectivity.v1.ListSpokesResponse + * @memberof google.cloud.networkconnectivity.v1.UpdateHubRequest * @instance * @returns {Object.} JSON object */ - ListSpokesResponse.prototype.toJSON = function toJSON() { + UpdateHubRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListSpokesResponse + * Gets the default type url for UpdateHubRequest * @function getTypeUrl - * @memberof google.cloud.networkconnectivity.v1.ListSpokesResponse + * @memberof google.cloud.networkconnectivity.v1.UpdateHubRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListSpokesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateHubRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.ListSpokesResponse"; + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.UpdateHubRequest"; }; - return ListSpokesResponse; + return UpdateHubRequest; })(); - v1.GetSpokeRequest = (function() { + v1.DeleteHubRequest = (function() { /** - * Properties of a GetSpokeRequest. + * Properties of a DeleteHubRequest. * @memberof google.cloud.networkconnectivity.v1 - * @interface IGetSpokeRequest - * @property {string|null} [name] GetSpokeRequest name + * @interface IDeleteHubRequest + * @property {string|null} [name] DeleteHubRequest name + * @property {string|null} [requestId] DeleteHubRequest requestId */ /** - * Constructs a new GetSpokeRequest. + * Constructs a new DeleteHubRequest. * @memberof google.cloud.networkconnectivity.v1 - * @classdesc Represents a GetSpokeRequest. - * @implements IGetSpokeRequest + * @classdesc Represents a DeleteHubRequest. + * @implements IDeleteHubRequest * @constructor - * @param {google.cloud.networkconnectivity.v1.IGetSpokeRequest=} [properties] Properties to set + * @param {google.cloud.networkconnectivity.v1.IDeleteHubRequest=} [properties] Properties to set */ - function GetSpokeRequest(properties) { + function DeleteHubRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4203,70 +5769,80 @@ } /** - * GetSpokeRequest name. + * DeleteHubRequest name. * @member {string} name - * @memberof google.cloud.networkconnectivity.v1.GetSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.DeleteHubRequest * @instance */ - GetSpokeRequest.prototype.name = ""; + DeleteHubRequest.prototype.name = ""; /** - * Creates a new GetSpokeRequest instance using the specified properties. + * DeleteHubRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networkconnectivity.v1.DeleteHubRequest + * @instance + */ + DeleteHubRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteHubRequest instance using the specified properties. * @function create - * @memberof google.cloud.networkconnectivity.v1.GetSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.DeleteHubRequest * @static - * @param {google.cloud.networkconnectivity.v1.IGetSpokeRequest=} [properties] Properties to set - * @returns {google.cloud.networkconnectivity.v1.GetSpokeRequest} GetSpokeRequest instance + * @param {google.cloud.networkconnectivity.v1.IDeleteHubRequest=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.DeleteHubRequest} DeleteHubRequest instance */ - GetSpokeRequest.create = function create(properties) { - return new GetSpokeRequest(properties); + DeleteHubRequest.create = function create(properties) { + return new DeleteHubRequest(properties); }; /** - * Encodes the specified GetSpokeRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.GetSpokeRequest.verify|verify} messages. + * Encodes the specified DeleteHubRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.DeleteHubRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.networkconnectivity.v1.GetSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.DeleteHubRequest * @static - * @param {google.cloud.networkconnectivity.v1.IGetSpokeRequest} message GetSpokeRequest message or plain object to encode + * @param {google.cloud.networkconnectivity.v1.IDeleteHubRequest} message DeleteHubRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetSpokeRequest.encode = function encode(message, writer) { + DeleteHubRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); return writer; }; /** - * Encodes the specified GetSpokeRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.GetSpokeRequest.verify|verify} messages. + * Encodes the specified DeleteHubRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.DeleteHubRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.networkconnectivity.v1.GetSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.DeleteHubRequest * @static - * @param {google.cloud.networkconnectivity.v1.IGetSpokeRequest} message GetSpokeRequest message or plain object to encode + * @param {google.cloud.networkconnectivity.v1.IDeleteHubRequest} message DeleteHubRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetSpokeRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteHubRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetSpokeRequest message from the specified reader or buffer. + * Decodes a DeleteHubRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.networkconnectivity.v1.GetSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.DeleteHubRequest * @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.GetSpokeRequest} GetSpokeRequest + * @returns {google.cloud.networkconnectivity.v1.DeleteHubRequest} DeleteHubRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetSpokeRequest.decode = function decode(reader, length) { + DeleteHubRequest.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.GetSpokeRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkconnectivity.v1.DeleteHubRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -4274,6 +5850,10 @@ message.name = reader.string(); break; } + case 2: { + message.requestId = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -4283,125 +5863,138 @@ }; /** - * Decodes a GetSpokeRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteHubRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.networkconnectivity.v1.GetSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.DeleteHubRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networkconnectivity.v1.GetSpokeRequest} GetSpokeRequest + * @returns {google.cloud.networkconnectivity.v1.DeleteHubRequest} DeleteHubRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetSpokeRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteHubRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetSpokeRequest message. + * Verifies a DeleteHubRequest message. * @function verify - * @memberof google.cloud.networkconnectivity.v1.GetSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.DeleteHubRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetSpokeRequest.verify = function verify(message) { + DeleteHubRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; return null; }; /** - * Creates a GetSpokeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteHubRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.networkconnectivity.v1.GetSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.DeleteHubRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.networkconnectivity.v1.GetSpokeRequest} GetSpokeRequest + * @returns {google.cloud.networkconnectivity.v1.DeleteHubRequest} DeleteHubRequest */ - GetSpokeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networkconnectivity.v1.GetSpokeRequest) + DeleteHubRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.DeleteHubRequest) return object; - var message = new $root.google.cloud.networkconnectivity.v1.GetSpokeRequest(); + var message = new $root.google.cloud.networkconnectivity.v1.DeleteHubRequest(); if (object.name != null) message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); return message; }; /** - * Creates a plain object from a GetSpokeRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteHubRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.networkconnectivity.v1.GetSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.DeleteHubRequest * @static - * @param {google.cloud.networkconnectivity.v1.GetSpokeRequest} message GetSpokeRequest + * @param {google.cloud.networkconnectivity.v1.DeleteHubRequest} message DeleteHubRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetSpokeRequest.toObject = function toObject(message, options) { + DeleteHubRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.name = ""; + object.requestId = ""; + } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; return object; }; /** - * Converts this GetSpokeRequest to JSON. + * Converts this DeleteHubRequest to JSON. * @function toJSON - * @memberof google.cloud.networkconnectivity.v1.GetSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.DeleteHubRequest * @instance * @returns {Object.} JSON object */ - GetSpokeRequest.prototype.toJSON = function toJSON() { + DeleteHubRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetSpokeRequest + * Gets the default type url for DeleteHubRequest * @function getTypeUrl - * @memberof google.cloud.networkconnectivity.v1.GetSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.DeleteHubRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetSpokeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteHubRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.GetSpokeRequest"; + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.DeleteHubRequest"; }; - return GetSpokeRequest; + return DeleteHubRequest; })(); - v1.CreateSpokeRequest = (function() { + v1.ListHubSpokesRequest = (function() { /** - * Properties of a CreateSpokeRequest. + * Properties of a ListHubSpokesRequest. * @memberof google.cloud.networkconnectivity.v1 - * @interface ICreateSpokeRequest - * @property {string|null} [parent] CreateSpokeRequest parent - * @property {string|null} [spokeId] CreateSpokeRequest spokeId - * @property {google.cloud.networkconnectivity.v1.ISpoke|null} [spoke] CreateSpokeRequest spoke - * @property {string|null} [requestId] CreateSpokeRequest requestId + * @interface IListHubSpokesRequest + * @property {string|null} [name] ListHubSpokesRequest name + * @property {Array.|null} [spokeLocations] ListHubSpokesRequest spokeLocations + * @property {number|null} [pageSize] ListHubSpokesRequest pageSize + * @property {string|null} [pageToken] ListHubSpokesRequest pageToken + * @property {string|null} [filter] ListHubSpokesRequest filter + * @property {string|null} [orderBy] ListHubSpokesRequest orderBy + * @property {google.cloud.networkconnectivity.v1.ListHubSpokesRequest.SpokeView|null} [view] ListHubSpokesRequest view */ /** - * Constructs a new CreateSpokeRequest. + * Constructs a new ListHubSpokesRequest. * @memberof google.cloud.networkconnectivity.v1 - * @classdesc Represents a CreateSpokeRequest. - * @implements ICreateSpokeRequest + * @classdesc Represents a ListHubSpokesRequest. + * @implements IListHubSpokesRequest * @constructor - * @param {google.cloud.networkconnectivity.v1.ICreateSpokeRequest=} [properties] Properties to set + * @param {google.cloud.networkconnectivity.v1.IListHubSpokesRequest=} [properties] Properties to set */ - function CreateSpokeRequest(properties) { + function ListHubSpokesRequest(properties) { + this.spokeLocations = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4409,117 +6002,162 @@ } /** - * CreateSpokeRequest parent. - * @member {string} parent - * @memberof google.cloud.networkconnectivity.v1.CreateSpokeRequest + * ListHubSpokesRequest name. + * @member {string} name + * @memberof google.cloud.networkconnectivity.v1.ListHubSpokesRequest * @instance */ - CreateSpokeRequest.prototype.parent = ""; + ListHubSpokesRequest.prototype.name = ""; /** - * CreateSpokeRequest spokeId. - * @member {string} spokeId - * @memberof google.cloud.networkconnectivity.v1.CreateSpokeRequest + * ListHubSpokesRequest spokeLocations. + * @member {Array.} spokeLocations + * @memberof google.cloud.networkconnectivity.v1.ListHubSpokesRequest * @instance */ - CreateSpokeRequest.prototype.spokeId = ""; + ListHubSpokesRequest.prototype.spokeLocations = $util.emptyArray; /** - * CreateSpokeRequest spoke. - * @member {google.cloud.networkconnectivity.v1.ISpoke|null|undefined} spoke - * @memberof google.cloud.networkconnectivity.v1.CreateSpokeRequest + * ListHubSpokesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networkconnectivity.v1.ListHubSpokesRequest * @instance */ - CreateSpokeRequest.prototype.spoke = null; + ListHubSpokesRequest.prototype.pageSize = 0; /** - * CreateSpokeRequest requestId. - * @member {string} requestId - * @memberof google.cloud.networkconnectivity.v1.CreateSpokeRequest + * ListHubSpokesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networkconnectivity.v1.ListHubSpokesRequest * @instance */ - CreateSpokeRequest.prototype.requestId = ""; + ListHubSpokesRequest.prototype.pageToken = ""; /** - * Creates a new CreateSpokeRequest instance using the specified properties. + * ListHubSpokesRequest filter. + * @member {string} filter + * @memberof google.cloud.networkconnectivity.v1.ListHubSpokesRequest + * @instance + */ + ListHubSpokesRequest.prototype.filter = ""; + + /** + * ListHubSpokesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.networkconnectivity.v1.ListHubSpokesRequest + * @instance + */ + ListHubSpokesRequest.prototype.orderBy = ""; + + /** + * ListHubSpokesRequest view. + * @member {google.cloud.networkconnectivity.v1.ListHubSpokesRequest.SpokeView} view + * @memberof google.cloud.networkconnectivity.v1.ListHubSpokesRequest + * @instance + */ + ListHubSpokesRequest.prototype.view = 0; + + /** + * Creates a new ListHubSpokesRequest instance using the specified properties. * @function create - * @memberof google.cloud.networkconnectivity.v1.CreateSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubSpokesRequest * @static - * @param {google.cloud.networkconnectivity.v1.ICreateSpokeRequest=} [properties] Properties to set - * @returns {google.cloud.networkconnectivity.v1.CreateSpokeRequest} CreateSpokeRequest instance + * @param {google.cloud.networkconnectivity.v1.IListHubSpokesRequest=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.ListHubSpokesRequest} ListHubSpokesRequest instance */ - CreateSpokeRequest.create = function create(properties) { - return new CreateSpokeRequest(properties); + ListHubSpokesRequest.create = function create(properties) { + return new ListHubSpokesRequest(properties); }; /** - * Encodes the specified CreateSpokeRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.CreateSpokeRequest.verify|verify} messages. + * Encodes the specified ListHubSpokesRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListHubSpokesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.networkconnectivity.v1.CreateSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubSpokesRequest * @static - * @param {google.cloud.networkconnectivity.v1.ICreateSpokeRequest} message CreateSpokeRequest message or plain object to encode + * @param {google.cloud.networkconnectivity.v1.IListHubSpokesRequest} message ListHubSpokesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateSpokeRequest.encode = function encode(message, writer) { + ListHubSpokesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.spokeId != null && Object.hasOwnProperty.call(message, "spokeId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.spokeId); - if (message.spoke != null && Object.hasOwnProperty.call(message, "spoke")) - $root.google.cloud.networkconnectivity.v1.Spoke.encode(message.spoke, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.spokeLocations != null && message.spokeLocations.length) + for (var i = 0; i < message.spokeLocations.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.spokeLocations[i]); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.orderBy); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.view); return writer; }; /** - * Encodes the specified CreateSpokeRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.CreateSpokeRequest.verify|verify} messages. + * Encodes the specified ListHubSpokesRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListHubSpokesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.networkconnectivity.v1.CreateSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubSpokesRequest * @static - * @param {google.cloud.networkconnectivity.v1.ICreateSpokeRequest} message CreateSpokeRequest message or plain object to encode + * @param {google.cloud.networkconnectivity.v1.IListHubSpokesRequest} message ListHubSpokesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateSpokeRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListHubSpokesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateSpokeRequest message from the specified reader or buffer. + * Decodes a ListHubSpokesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.networkconnectivity.v1.CreateSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubSpokesRequest * @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.CreateSpokeRequest} CreateSpokeRequest + * @returns {google.cloud.networkconnectivity.v1.ListHubSpokesRequest} ListHubSpokesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateSpokeRequest.decode = function decode(reader, length) { + ListHubSpokesRequest.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.CreateSpokeRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkconnectivity.v1.ListHubSpokesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + message.name = reader.string(); break; } case 2: { - message.spokeId = reader.string(); + if (!(message.spokeLocations && message.spokeLocations.length)) + message.spokeLocations = []; + message.spokeLocations.push(reader.string()); break; } case 3: { - message.spoke = $root.google.cloud.networkconnectivity.v1.Spoke.decode(reader, reader.uint32()); + message.pageSize = reader.int32(); break; } case 4: { - message.requestId = reader.string(); + message.pageToken = reader.string(); + break; + } + case 5: { + message.filter = reader.string(); + break; + } + case 6: { + message.orderBy = reader.string(); + break; + } + case 7: { + message.view = reader.int32(); break; } default: @@ -4531,154 +6169,228 @@ }; /** - * Decodes a CreateSpokeRequest message from the specified reader or buffer, length delimited. + * Decodes a ListHubSpokesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.networkconnectivity.v1.CreateSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubSpokesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networkconnectivity.v1.CreateSpokeRequest} CreateSpokeRequest + * @returns {google.cloud.networkconnectivity.v1.ListHubSpokesRequest} ListHubSpokesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateSpokeRequest.decodeDelimited = function decodeDelimited(reader) { + ListHubSpokesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateSpokeRequest message. + * Verifies a ListHubSpokesRequest message. * @function verify - * @memberof google.cloud.networkconnectivity.v1.CreateSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubSpokesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateSpokeRequest.verify = function verify(message) { + ListHubSpokesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.spokeId != null && message.hasOwnProperty("spokeId")) - if (!$util.isString(message.spokeId)) - return "spokeId: string expected"; - if (message.spoke != null && message.hasOwnProperty("spoke")) { - var error = $root.google.cloud.networkconnectivity.v1.Spoke.verify(message.spoke); - if (error) - return "spoke." + error; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.spokeLocations != null && message.hasOwnProperty("spokeLocations")) { + if (!Array.isArray(message.spokeLocations)) + return "spokeLocations: array expected"; + for (var i = 0; i < message.spokeLocations.length; ++i) + if (!$util.isString(message.spokeLocations[i])) + return "spokeLocations: string[] expected"; } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; /** - * Creates a CreateSpokeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListHubSpokesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.networkconnectivity.v1.CreateSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubSpokesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.networkconnectivity.v1.CreateSpokeRequest} CreateSpokeRequest + * @returns {google.cloud.networkconnectivity.v1.ListHubSpokesRequest} ListHubSpokesRequest */ - CreateSpokeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networkconnectivity.v1.CreateSpokeRequest) + ListHubSpokesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.ListHubSpokesRequest) return object; - var message = new $root.google.cloud.networkconnectivity.v1.CreateSpokeRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.spokeId != null) - message.spokeId = String(object.spokeId); - if (object.spoke != null) { - if (typeof object.spoke !== "object") - throw TypeError(".google.cloud.networkconnectivity.v1.CreateSpokeRequest.spoke: object expected"); - message.spoke = $root.google.cloud.networkconnectivity.v1.Spoke.fromObject(object.spoke); + var message = new $root.google.cloud.networkconnectivity.v1.ListHubSpokesRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.spokeLocations) { + if (!Array.isArray(object.spokeLocations)) + throw TypeError(".google.cloud.networkconnectivity.v1.ListHubSpokesRequest.spokeLocations: array expected"); + message.spokeLocations = []; + for (var i = 0; i < object.spokeLocations.length; ++i) + message.spokeLocations[i] = String(object.spokeLocations[i]); + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "SPOKE_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BASIC": + case 1: + message.view = 1; + break; + case "DETAILED": + case 2: + message.view = 2; + break; } - if (object.requestId != null) - message.requestId = String(object.requestId); return message; }; /** - * Creates a plain object from a CreateSpokeRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListHubSpokesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.networkconnectivity.v1.CreateSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubSpokesRequest * @static - * @param {google.cloud.networkconnectivity.v1.CreateSpokeRequest} message CreateSpokeRequest + * @param {google.cloud.networkconnectivity.v1.ListHubSpokesRequest} message ListHubSpokesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateSpokeRequest.toObject = function toObject(message, options) { + ListHubSpokesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.spokeLocations = []; if (options.defaults) { - object.parent = ""; - object.spokeId = ""; - object.spoke = null; - object.requestId = ""; + object.name = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + object.view = options.enums === String ? "SPOKE_VIEW_UNSPECIFIED" : 0; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.spokeId != null && message.hasOwnProperty("spokeId")) - object.spokeId = message.spokeId; - if (message.spoke != null && message.hasOwnProperty("spoke")) - object.spoke = $root.google.cloud.networkconnectivity.v1.Spoke.toObject(message.spoke, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.spokeLocations && message.spokeLocations.length) { + object.spokeLocations = []; + for (var j = 0; j < message.spokeLocations.length; ++j) + object.spokeLocations[j] = message.spokeLocations[j]; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.networkconnectivity.v1.ListHubSpokesRequest.SpokeView[message.view] === undefined ? message.view : $root.google.cloud.networkconnectivity.v1.ListHubSpokesRequest.SpokeView[message.view] : message.view; return object; }; /** - * Converts this CreateSpokeRequest to JSON. + * Converts this ListHubSpokesRequest to JSON. * @function toJSON - * @memberof google.cloud.networkconnectivity.v1.CreateSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubSpokesRequest * @instance * @returns {Object.} JSON object */ - CreateSpokeRequest.prototype.toJSON = function toJSON() { + ListHubSpokesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateSpokeRequest + * Gets the default type url for ListHubSpokesRequest * @function getTypeUrl - * @memberof google.cloud.networkconnectivity.v1.CreateSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubSpokesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateSpokeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListHubSpokesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.CreateSpokeRequest"; + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.ListHubSpokesRequest"; }; - return CreateSpokeRequest; + /** + * SpokeView enum. + * @name google.cloud.networkconnectivity.v1.ListHubSpokesRequest.SpokeView + * @enum {number} + * @property {number} SPOKE_VIEW_UNSPECIFIED=0 SPOKE_VIEW_UNSPECIFIED value + * @property {number} BASIC=1 BASIC value + * @property {number} DETAILED=2 DETAILED value + */ + ListHubSpokesRequest.SpokeView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SPOKE_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "BASIC"] = 1; + values[valuesById[2] = "DETAILED"] = 2; + return values; + })(); + + return ListHubSpokesRequest; })(); - v1.UpdateSpokeRequest = (function() { + v1.ListHubSpokesResponse = (function() { /** - * Properties of an UpdateSpokeRequest. + * Properties of a ListHubSpokesResponse. * @memberof google.cloud.networkconnectivity.v1 - * @interface IUpdateSpokeRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSpokeRequest updateMask - * @property {google.cloud.networkconnectivity.v1.ISpoke|null} [spoke] UpdateSpokeRequest spoke - * @property {string|null} [requestId] UpdateSpokeRequest requestId + * @interface IListHubSpokesResponse + * @property {Array.|null} [spokes] ListHubSpokesResponse spokes + * @property {string|null} [nextPageToken] ListHubSpokesResponse nextPageToken + * @property {Array.|null} [unreachable] ListHubSpokesResponse unreachable */ /** - * Constructs a new UpdateSpokeRequest. + * Constructs a new ListHubSpokesResponse. * @memberof google.cloud.networkconnectivity.v1 - * @classdesc Represents an UpdateSpokeRequest. - * @implements IUpdateSpokeRequest + * @classdesc Represents a ListHubSpokesResponse. + * @implements IListHubSpokesResponse * @constructor - * @param {google.cloud.networkconnectivity.v1.IUpdateSpokeRequest=} [properties] Properties to set + * @param {google.cloud.networkconnectivity.v1.IListHubSpokesResponse=} [properties] Properties to set */ - function UpdateSpokeRequest(properties) { + function ListHubSpokesResponse(properties) { + this.spokes = []; + this.unreachable = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4686,103 +6398,109 @@ } /** - * UpdateSpokeRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.networkconnectivity.v1.UpdateSpokeRequest + * ListHubSpokesResponse spokes. + * @member {Array.} spokes + * @memberof google.cloud.networkconnectivity.v1.ListHubSpokesResponse * @instance */ - UpdateSpokeRequest.prototype.updateMask = null; + ListHubSpokesResponse.prototype.spokes = $util.emptyArray; /** - * UpdateSpokeRequest spoke. - * @member {google.cloud.networkconnectivity.v1.ISpoke|null|undefined} spoke - * @memberof google.cloud.networkconnectivity.v1.UpdateSpokeRequest + * ListHubSpokesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networkconnectivity.v1.ListHubSpokesResponse * @instance */ - UpdateSpokeRequest.prototype.spoke = null; + ListHubSpokesResponse.prototype.nextPageToken = ""; /** - * UpdateSpokeRequest requestId. - * @member {string} requestId - * @memberof google.cloud.networkconnectivity.v1.UpdateSpokeRequest + * ListHubSpokesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.networkconnectivity.v1.ListHubSpokesResponse * @instance */ - UpdateSpokeRequest.prototype.requestId = ""; + ListHubSpokesResponse.prototype.unreachable = $util.emptyArray; /** - * Creates a new UpdateSpokeRequest instance using the specified properties. + * Creates a new ListHubSpokesResponse instance using the specified properties. * @function create - * @memberof google.cloud.networkconnectivity.v1.UpdateSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubSpokesResponse * @static - * @param {google.cloud.networkconnectivity.v1.IUpdateSpokeRequest=} [properties] Properties to set - * @returns {google.cloud.networkconnectivity.v1.UpdateSpokeRequest} UpdateSpokeRequest instance + * @param {google.cloud.networkconnectivity.v1.IListHubSpokesResponse=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.ListHubSpokesResponse} ListHubSpokesResponse instance */ - UpdateSpokeRequest.create = function create(properties) { - return new UpdateSpokeRequest(properties); + ListHubSpokesResponse.create = function create(properties) { + return new ListHubSpokesResponse(properties); }; /** - * Encodes the specified UpdateSpokeRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.UpdateSpokeRequest.verify|verify} messages. + * Encodes the specified ListHubSpokesResponse message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListHubSpokesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.networkconnectivity.v1.UpdateSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubSpokesResponse * @static - * @param {google.cloud.networkconnectivity.v1.IUpdateSpokeRequest} message UpdateSpokeRequest message or plain object to encode + * @param {google.cloud.networkconnectivity.v1.IListHubSpokesResponse} message ListHubSpokesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateSpokeRequest.encode = function encode(message, writer) { + ListHubSpokesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.spoke != null && Object.hasOwnProperty.call(message, "spoke")) - $root.google.cloud.networkconnectivity.v1.Spoke.encode(message.spoke, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.spokes != null && message.spokes.length) + for (var i = 0; i < message.spokes.length; ++i) + $root.google.cloud.networkconnectivity.v1.Spoke.encode(message.spokes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); return writer; }; /** - * Encodes the specified UpdateSpokeRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.UpdateSpokeRequest.verify|verify} messages. + * Encodes the specified ListHubSpokesResponse message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListHubSpokesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.networkconnectivity.v1.UpdateSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubSpokesResponse * @static - * @param {google.cloud.networkconnectivity.v1.IUpdateSpokeRequest} message UpdateSpokeRequest message or plain object to encode + * @param {google.cloud.networkconnectivity.v1.IListHubSpokesResponse} message ListHubSpokesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateSpokeRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListHubSpokesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateSpokeRequest message from the specified reader or buffer. + * Decodes a ListHubSpokesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.networkconnectivity.v1.UpdateSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubSpokesResponse * @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.UpdateSpokeRequest} UpdateSpokeRequest + * @returns {google.cloud.networkconnectivity.v1.ListHubSpokesResponse} ListHubSpokesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateSpokeRequest.decode = function decode(reader, length) { + ListHubSpokesResponse.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.UpdateSpokeRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkconnectivity.v1.ListHubSpokesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + if (!(message.spokes && message.spokes.length)) + message.spokes = []; + message.spokes.push($root.google.cloud.networkconnectivity.v1.Spoke.decode(reader, reader.uint32())); break; } case 2: { - message.spoke = $root.google.cloud.networkconnectivity.v1.Spoke.decode(reader, reader.uint32()); + message.nextPageToken = reader.string(); break; } case 3: { - message.requestId = reader.string(); + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); break; } default: @@ -4794,150 +6512,173 @@ }; /** - * Decodes an UpdateSpokeRequest message from the specified reader or buffer, length delimited. + * Decodes a ListHubSpokesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.networkconnectivity.v1.UpdateSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubSpokesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networkconnectivity.v1.UpdateSpokeRequest} UpdateSpokeRequest + * @returns {google.cloud.networkconnectivity.v1.ListHubSpokesResponse} ListHubSpokesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateSpokeRequest.decodeDelimited = function decodeDelimited(reader) { + ListHubSpokesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateSpokeRequest message. + * Verifies a ListHubSpokesResponse message. * @function verify - * @memberof google.cloud.networkconnectivity.v1.UpdateSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubSpokesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateSpokeRequest.verify = function verify(message) { + ListHubSpokesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; + if (message.spokes != null && message.hasOwnProperty("spokes")) { + if (!Array.isArray(message.spokes)) + return "spokes: array expected"; + for (var i = 0; i < message.spokes.length; ++i) { + var error = $root.google.cloud.networkconnectivity.v1.Spoke.verify(message.spokes[i]); + if (error) + return "spokes." + error; + } } - if (message.spoke != null && message.hasOwnProperty("spoke")) { - var error = $root.google.cloud.networkconnectivity.v1.Spoke.verify(message.spoke); - if (error) - return "spoke." + error; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; return null; }; /** - * Creates an UpdateSpokeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListHubSpokesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.networkconnectivity.v1.UpdateSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubSpokesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.networkconnectivity.v1.UpdateSpokeRequest} UpdateSpokeRequest + * @returns {google.cloud.networkconnectivity.v1.ListHubSpokesResponse} ListHubSpokesResponse */ - UpdateSpokeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networkconnectivity.v1.UpdateSpokeRequest) + ListHubSpokesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.ListHubSpokesResponse) return object; - var message = new $root.google.cloud.networkconnectivity.v1.UpdateSpokeRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.networkconnectivity.v1.UpdateSpokeRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + var message = new $root.google.cloud.networkconnectivity.v1.ListHubSpokesResponse(); + if (object.spokes) { + if (!Array.isArray(object.spokes)) + throw TypeError(".google.cloud.networkconnectivity.v1.ListHubSpokesResponse.spokes: array expected"); + message.spokes = []; + for (var i = 0; i < object.spokes.length; ++i) { + if (typeof object.spokes[i] !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.ListHubSpokesResponse.spokes: object expected"); + message.spokes[i] = $root.google.cloud.networkconnectivity.v1.Spoke.fromObject(object.spokes[i]); + } } - if (object.spoke != null) { - if (typeof object.spoke !== "object") - throw TypeError(".google.cloud.networkconnectivity.v1.UpdateSpokeRequest.spoke: object expected"); - message.spoke = $root.google.cloud.networkconnectivity.v1.Spoke.fromObject(object.spoke); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.networkconnectivity.v1.ListHubSpokesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); } - if (object.requestId != null) - message.requestId = String(object.requestId); return message; }; /** - * Creates a plain object from an UpdateSpokeRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListHubSpokesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.networkconnectivity.v1.UpdateSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubSpokesResponse * @static - * @param {google.cloud.networkconnectivity.v1.UpdateSpokeRequest} message UpdateSpokeRequest + * @param {google.cloud.networkconnectivity.v1.ListHubSpokesResponse} message ListHubSpokesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateSpokeRequest.toObject = function toObject(message, options) { + ListHubSpokesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.updateMask = null; - object.spoke = null; - object.requestId = ""; + if (options.arrays || options.defaults) { + object.spokes = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.spokes && message.spokes.length) { + object.spokes = []; + for (var j = 0; j < message.spokes.length; ++j) + object.spokes[j] = $root.google.cloud.networkconnectivity.v1.Spoke.toObject(message.spokes[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.spoke != null && message.hasOwnProperty("spoke")) - object.spoke = $root.google.cloud.networkconnectivity.v1.Spoke.toObject(message.spoke, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; return object; }; /** - * Converts this UpdateSpokeRequest to JSON. + * Converts this ListHubSpokesResponse to JSON. * @function toJSON - * @memberof google.cloud.networkconnectivity.v1.UpdateSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubSpokesResponse * @instance * @returns {Object.} JSON object */ - UpdateSpokeRequest.prototype.toJSON = function toJSON() { + ListHubSpokesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateSpokeRequest + * Gets the default type url for ListHubSpokesResponse * @function getTypeUrl - * @memberof google.cloud.networkconnectivity.v1.UpdateSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.ListHubSpokesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateSpokeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListHubSpokesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.UpdateSpokeRequest"; + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.ListHubSpokesResponse"; }; - return UpdateSpokeRequest; + return ListHubSpokesResponse; })(); - v1.DeleteSpokeRequest = (function() { + v1.ListSpokesRequest = (function() { /** - * Properties of a DeleteSpokeRequest. + * Properties of a ListSpokesRequest. * @memberof google.cloud.networkconnectivity.v1 - * @interface IDeleteSpokeRequest - * @property {string|null} [name] DeleteSpokeRequest name - * @property {string|null} [requestId] DeleteSpokeRequest requestId + * @interface IListSpokesRequest + * @property {string|null} [parent] ListSpokesRequest parent + * @property {number|null} [pageSize] ListSpokesRequest pageSize + * @property {string|null} [pageToken] ListSpokesRequest pageToken + * @property {string|null} [filter] ListSpokesRequest filter + * @property {string|null} [orderBy] ListSpokesRequest orderBy */ /** - * Constructs a new DeleteSpokeRequest. + * Constructs a new ListSpokesRequest. * @memberof google.cloud.networkconnectivity.v1 - * @classdesc Represents a DeleteSpokeRequest. - * @implements IDeleteSpokeRequest + * @classdesc Represents a ListSpokesRequest. + * @implements IListSpokesRequest * @constructor - * @param {google.cloud.networkconnectivity.v1.IDeleteSpokeRequest=} [properties] Properties to set + * @param {google.cloud.networkconnectivity.v1.IListSpokesRequest=} [properties] Properties to set */ - function DeleteSpokeRequest(properties) { + function ListSpokesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4945,89 +6686,131 @@ } /** - * DeleteSpokeRequest name. - * @member {string} name - * @memberof google.cloud.networkconnectivity.v1.DeleteSpokeRequest + * ListSpokesRequest parent. + * @member {string} parent + * @memberof google.cloud.networkconnectivity.v1.ListSpokesRequest * @instance */ - DeleteSpokeRequest.prototype.name = ""; + ListSpokesRequest.prototype.parent = ""; /** - * DeleteSpokeRequest requestId. - * @member {string} requestId - * @memberof google.cloud.networkconnectivity.v1.DeleteSpokeRequest + * ListSpokesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networkconnectivity.v1.ListSpokesRequest * @instance */ - DeleteSpokeRequest.prototype.requestId = ""; + ListSpokesRequest.prototype.pageSize = 0; /** - * Creates a new DeleteSpokeRequest instance using the specified properties. + * ListSpokesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networkconnectivity.v1.ListSpokesRequest + * @instance + */ + ListSpokesRequest.prototype.pageToken = ""; + + /** + * ListSpokesRequest filter. + * @member {string} filter + * @memberof google.cloud.networkconnectivity.v1.ListSpokesRequest + * @instance + */ + ListSpokesRequest.prototype.filter = ""; + + /** + * ListSpokesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.networkconnectivity.v1.ListSpokesRequest + * @instance + */ + ListSpokesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListSpokesRequest instance using the specified properties. * @function create - * @memberof google.cloud.networkconnectivity.v1.DeleteSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.ListSpokesRequest * @static - * @param {google.cloud.networkconnectivity.v1.IDeleteSpokeRequest=} [properties] Properties to set - * @returns {google.cloud.networkconnectivity.v1.DeleteSpokeRequest} DeleteSpokeRequest instance + * @param {google.cloud.networkconnectivity.v1.IListSpokesRequest=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.ListSpokesRequest} ListSpokesRequest instance */ - DeleteSpokeRequest.create = function create(properties) { - return new DeleteSpokeRequest(properties); + ListSpokesRequest.create = function create(properties) { + return new ListSpokesRequest(properties); }; /** - * Encodes the specified DeleteSpokeRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.DeleteSpokeRequest.verify|verify} messages. + * Encodes the specified ListSpokesRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListSpokesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.networkconnectivity.v1.DeleteSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.ListSpokesRequest * @static - * @param {google.cloud.networkconnectivity.v1.IDeleteSpokeRequest} message DeleteSpokeRequest message or plain object to encode + * @param {google.cloud.networkconnectivity.v1.IListSpokesRequest} message ListSpokesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteSpokeRequest.encode = function encode(message, writer) { + ListSpokesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); return writer; }; /** - * Encodes the specified DeleteSpokeRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.DeleteSpokeRequest.verify|verify} messages. + * Encodes the specified ListSpokesRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListSpokesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.networkconnectivity.v1.DeleteSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.ListSpokesRequest * @static - * @param {google.cloud.networkconnectivity.v1.IDeleteSpokeRequest} message DeleteSpokeRequest message or plain object to encode + * @param {google.cloud.networkconnectivity.v1.IListSpokesRequest} message ListSpokesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteSpokeRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListSpokesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteSpokeRequest message from the specified reader or buffer. + * Decodes a ListSpokesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.networkconnectivity.v1.DeleteSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.ListSpokesRequest * @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.DeleteSpokeRequest} DeleteSpokeRequest + * @returns {google.cloud.networkconnectivity.v1.ListSpokesRequest} ListSpokesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteSpokeRequest.decode = function decode(reader, length) { + ListSpokesRequest.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.DeleteSpokeRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkconnectivity.v1.ListSpokesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.parent = reader.string(); break; } case 2: { - message.requestId = reader.string(); + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); break; } default: @@ -5039,134 +6822,159 @@ }; /** - * Decodes a DeleteSpokeRequest message from the specified reader or buffer, length delimited. + * Decodes a ListSpokesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.networkconnectivity.v1.DeleteSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.ListSpokesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networkconnectivity.v1.DeleteSpokeRequest} DeleteSpokeRequest + * @returns {google.cloud.networkconnectivity.v1.ListSpokesRequest} ListSpokesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteSpokeRequest.decodeDelimited = function decodeDelimited(reader) { + ListSpokesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteSpokeRequest message. + * Verifies a ListSpokesRequest message. * @function verify - * @memberof google.cloud.networkconnectivity.v1.DeleteSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.ListSpokesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteSpokeRequest.verify = function verify(message) { + ListSpokesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; return null; }; /** - * Creates a DeleteSpokeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListSpokesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.networkconnectivity.v1.DeleteSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.ListSpokesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.networkconnectivity.v1.DeleteSpokeRequest} DeleteSpokeRequest + * @returns {google.cloud.networkconnectivity.v1.ListSpokesRequest} ListSpokesRequest */ - DeleteSpokeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networkconnectivity.v1.DeleteSpokeRequest) + ListSpokesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.ListSpokesRequest) return object; - var message = new $root.google.cloud.networkconnectivity.v1.DeleteSpokeRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); + var message = new $root.google.cloud.networkconnectivity.v1.ListSpokesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); return message; }; /** - * Creates a plain object from a DeleteSpokeRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListSpokesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.networkconnectivity.v1.DeleteSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.ListSpokesRequest * @static - * @param {google.cloud.networkconnectivity.v1.DeleteSpokeRequest} message DeleteSpokeRequest + * @param {google.cloud.networkconnectivity.v1.ListSpokesRequest} message ListSpokesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteSpokeRequest.toObject = function toObject(message, options) { + ListSpokesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; - object.requestId = ""; + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; return object; }; /** - * Converts this DeleteSpokeRequest to JSON. + * Converts this ListSpokesRequest to JSON. * @function toJSON - * @memberof google.cloud.networkconnectivity.v1.DeleteSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.ListSpokesRequest * @instance * @returns {Object.} JSON object */ - DeleteSpokeRequest.prototype.toJSON = function toJSON() { + ListSpokesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteSpokeRequest + * Gets the default type url for ListSpokesRequest * @function getTypeUrl - * @memberof google.cloud.networkconnectivity.v1.DeleteSpokeRequest + * @memberof google.cloud.networkconnectivity.v1.ListSpokesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteSpokeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListSpokesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.DeleteSpokeRequest"; + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.ListSpokesRequest"; }; - return DeleteSpokeRequest; + return ListSpokesRequest; })(); - v1.LinkedVpnTunnels = (function() { + v1.ListSpokesResponse = (function() { /** - * Properties of a LinkedVpnTunnels. + * Properties of a ListSpokesResponse. * @memberof google.cloud.networkconnectivity.v1 - * @interface ILinkedVpnTunnels - * @property {Array.|null} [uris] LinkedVpnTunnels uris - * @property {boolean|null} [siteToSiteDataTransfer] LinkedVpnTunnels siteToSiteDataTransfer - * @property {string|null} [vpcNetwork] LinkedVpnTunnels vpcNetwork + * @interface IListSpokesResponse + * @property {Array.|null} [spokes] ListSpokesResponse spokes + * @property {string|null} [nextPageToken] ListSpokesResponse nextPageToken + * @property {Array.|null} [unreachable] ListSpokesResponse unreachable */ /** - * Constructs a new LinkedVpnTunnels. + * Constructs a new ListSpokesResponse. * @memberof google.cloud.networkconnectivity.v1 - * @classdesc Represents a LinkedVpnTunnels. - * @implements ILinkedVpnTunnels + * @classdesc Represents a ListSpokesResponse. + * @implements IListSpokesResponse * @constructor - * @param {google.cloud.networkconnectivity.v1.ILinkedVpnTunnels=} [properties] Properties to set + * @param {google.cloud.networkconnectivity.v1.IListSpokesResponse=} [properties] Properties to set */ - function LinkedVpnTunnels(properties) { - this.uris = []; + function ListSpokesResponse(properties) { + this.spokes = []; + this.unreachable = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5174,106 +6982,109 @@ } /** - * LinkedVpnTunnels uris. - * @member {Array.} uris - * @memberof google.cloud.networkconnectivity.v1.LinkedVpnTunnels + * ListSpokesResponse spokes. + * @member {Array.} spokes + * @memberof google.cloud.networkconnectivity.v1.ListSpokesResponse * @instance */ - LinkedVpnTunnels.prototype.uris = $util.emptyArray; + ListSpokesResponse.prototype.spokes = $util.emptyArray; /** - * LinkedVpnTunnels siteToSiteDataTransfer. - * @member {boolean} siteToSiteDataTransfer - * @memberof google.cloud.networkconnectivity.v1.LinkedVpnTunnels + * ListSpokesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networkconnectivity.v1.ListSpokesResponse * @instance */ - LinkedVpnTunnels.prototype.siteToSiteDataTransfer = false; + ListSpokesResponse.prototype.nextPageToken = ""; /** - * LinkedVpnTunnels vpcNetwork. - * @member {string} vpcNetwork - * @memberof google.cloud.networkconnectivity.v1.LinkedVpnTunnels + * ListSpokesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.networkconnectivity.v1.ListSpokesResponse * @instance */ - LinkedVpnTunnels.prototype.vpcNetwork = ""; + ListSpokesResponse.prototype.unreachable = $util.emptyArray; /** - * Creates a new LinkedVpnTunnels instance using the specified properties. + * Creates a new ListSpokesResponse instance using the specified properties. * @function create - * @memberof google.cloud.networkconnectivity.v1.LinkedVpnTunnels + * @memberof google.cloud.networkconnectivity.v1.ListSpokesResponse * @static - * @param {google.cloud.networkconnectivity.v1.ILinkedVpnTunnels=} [properties] Properties to set - * @returns {google.cloud.networkconnectivity.v1.LinkedVpnTunnels} LinkedVpnTunnels instance + * @param {google.cloud.networkconnectivity.v1.IListSpokesResponse=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.ListSpokesResponse} ListSpokesResponse instance */ - LinkedVpnTunnels.create = function create(properties) { - return new LinkedVpnTunnels(properties); + ListSpokesResponse.create = function create(properties) { + return new ListSpokesResponse(properties); }; /** - * Encodes the specified LinkedVpnTunnels message. Does not implicitly {@link google.cloud.networkconnectivity.v1.LinkedVpnTunnels.verify|verify} messages. + * Encodes the specified ListSpokesResponse message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListSpokesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.networkconnectivity.v1.LinkedVpnTunnels + * @memberof google.cloud.networkconnectivity.v1.ListSpokesResponse * @static - * @param {google.cloud.networkconnectivity.v1.ILinkedVpnTunnels} message LinkedVpnTunnels message or plain object to encode + * @param {google.cloud.networkconnectivity.v1.IListSpokesResponse} message ListSpokesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LinkedVpnTunnels.encode = function encode(message, writer) { + ListSpokesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.uris != null && message.uris.length) - for (var i = 0; i < message.uris.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.uris[i]); - if (message.siteToSiteDataTransfer != null && Object.hasOwnProperty.call(message, "siteToSiteDataTransfer")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.siteToSiteDataTransfer); - if (message.vpcNetwork != null && Object.hasOwnProperty.call(message, "vpcNetwork")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.vpcNetwork); + if (message.spokes != null && message.spokes.length) + for (var i = 0; i < message.spokes.length; ++i) + $root.google.cloud.networkconnectivity.v1.Spoke.encode(message.spokes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); return writer; }; /** - * Encodes the specified LinkedVpnTunnels message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.LinkedVpnTunnels.verify|verify} messages. + * Encodes the specified ListSpokesResponse message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListSpokesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.networkconnectivity.v1.LinkedVpnTunnels + * @memberof google.cloud.networkconnectivity.v1.ListSpokesResponse * @static - * @param {google.cloud.networkconnectivity.v1.ILinkedVpnTunnels} message LinkedVpnTunnels message or plain object to encode + * @param {google.cloud.networkconnectivity.v1.IListSpokesResponse} message ListSpokesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LinkedVpnTunnels.encodeDelimited = function encodeDelimited(message, writer) { + ListSpokesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a LinkedVpnTunnels message from the specified reader or buffer. + * Decodes a ListSpokesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.networkconnectivity.v1.LinkedVpnTunnels + * @memberof google.cloud.networkconnectivity.v1.ListSpokesResponse * @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.LinkedVpnTunnels} LinkedVpnTunnels + * @returns {google.cloud.networkconnectivity.v1.ListSpokesResponse} ListSpokesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LinkedVpnTunnels.decode = function decode(reader, length) { + ListSpokesResponse.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.LinkedVpnTunnels(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkconnectivity.v1.ListSpokesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.uris && message.uris.length)) - message.uris = []; - message.uris.push(reader.string()); + if (!(message.spokes && message.spokes.length)) + message.spokes = []; + message.spokes.push($root.google.cloud.networkconnectivity.v1.Spoke.decode(reader, reader.uint32())); break; } case 2: { - message.siteToSiteDataTransfer = reader.bool(); + message.nextPageToken = reader.string(); break; } case 3: { - message.vpcNetwork = reader.string(); + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); break; } default: @@ -5285,155 +7096,169 @@ }; /** - * Decodes a LinkedVpnTunnels message from the specified reader or buffer, length delimited. + * Decodes a ListSpokesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.networkconnectivity.v1.LinkedVpnTunnels + * @memberof google.cloud.networkconnectivity.v1.ListSpokesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networkconnectivity.v1.LinkedVpnTunnels} LinkedVpnTunnels + * @returns {google.cloud.networkconnectivity.v1.ListSpokesResponse} ListSpokesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LinkedVpnTunnels.decodeDelimited = function decodeDelimited(reader) { + ListSpokesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a LinkedVpnTunnels message. + * Verifies a ListSpokesResponse message. * @function verify - * @memberof google.cloud.networkconnectivity.v1.LinkedVpnTunnels + * @memberof google.cloud.networkconnectivity.v1.ListSpokesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - LinkedVpnTunnels.verify = function verify(message) { + ListSpokesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.uris != null && message.hasOwnProperty("uris")) { - if (!Array.isArray(message.uris)) - return "uris: array expected"; - for (var i = 0; i < message.uris.length; ++i) - if (!$util.isString(message.uris[i])) - return "uris: string[] expected"; + if (message.spokes != null && message.hasOwnProperty("spokes")) { + if (!Array.isArray(message.spokes)) + return "spokes: array expected"; + for (var i = 0; i < message.spokes.length; ++i) { + var error = $root.google.cloud.networkconnectivity.v1.Spoke.verify(message.spokes[i]); + if (error) + return "spokes." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; } - if (message.siteToSiteDataTransfer != null && message.hasOwnProperty("siteToSiteDataTransfer")) - if (typeof message.siteToSiteDataTransfer !== "boolean") - return "siteToSiteDataTransfer: boolean expected"; - if (message.vpcNetwork != null && message.hasOwnProperty("vpcNetwork")) - if (!$util.isString(message.vpcNetwork)) - return "vpcNetwork: string expected"; return null; }; /** - * Creates a LinkedVpnTunnels message from a plain object. Also converts values to their respective internal types. + * Creates a ListSpokesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.networkconnectivity.v1.LinkedVpnTunnels + * @memberof google.cloud.networkconnectivity.v1.ListSpokesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.networkconnectivity.v1.LinkedVpnTunnels} LinkedVpnTunnels + * @returns {google.cloud.networkconnectivity.v1.ListSpokesResponse} ListSpokesResponse */ - LinkedVpnTunnels.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networkconnectivity.v1.LinkedVpnTunnels) + ListSpokesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.ListSpokesResponse) return object; - var message = new $root.google.cloud.networkconnectivity.v1.LinkedVpnTunnels(); - if (object.uris) { - if (!Array.isArray(object.uris)) - throw TypeError(".google.cloud.networkconnectivity.v1.LinkedVpnTunnels.uris: array expected"); - message.uris = []; - for (var i = 0; i < object.uris.length; ++i) - message.uris[i] = String(object.uris[i]); + var message = new $root.google.cloud.networkconnectivity.v1.ListSpokesResponse(); + if (object.spokes) { + if (!Array.isArray(object.spokes)) + throw TypeError(".google.cloud.networkconnectivity.v1.ListSpokesResponse.spokes: array expected"); + message.spokes = []; + for (var i = 0; i < object.spokes.length; ++i) { + if (typeof object.spokes[i] !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.ListSpokesResponse.spokes: object expected"); + message.spokes[i] = $root.google.cloud.networkconnectivity.v1.Spoke.fromObject(object.spokes[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.networkconnectivity.v1.ListSpokesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); } - if (object.siteToSiteDataTransfer != null) - message.siteToSiteDataTransfer = Boolean(object.siteToSiteDataTransfer); - if (object.vpcNetwork != null) - message.vpcNetwork = String(object.vpcNetwork); return message; }; /** - * Creates a plain object from a LinkedVpnTunnels message. Also converts values to other types if specified. + * Creates a plain object from a ListSpokesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.networkconnectivity.v1.LinkedVpnTunnels + * @memberof google.cloud.networkconnectivity.v1.ListSpokesResponse * @static - * @param {google.cloud.networkconnectivity.v1.LinkedVpnTunnels} message LinkedVpnTunnels + * @param {google.cloud.networkconnectivity.v1.ListSpokesResponse} message ListSpokesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - LinkedVpnTunnels.toObject = function toObject(message, options) { + ListSpokesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.uris = []; - if (options.defaults) { - object.siteToSiteDataTransfer = false; - object.vpcNetwork = ""; + if (options.arrays || options.defaults) { + object.spokes = []; + object.unreachable = []; } - if (message.uris && message.uris.length) { - object.uris = []; - for (var j = 0; j < message.uris.length; ++j) - object.uris[j] = message.uris[j]; + if (options.defaults) + object.nextPageToken = ""; + if (message.spokes && message.spokes.length) { + object.spokes = []; + for (var j = 0; j < message.spokes.length; ++j) + object.spokes[j] = $root.google.cloud.networkconnectivity.v1.Spoke.toObject(message.spokes[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; } - if (message.siteToSiteDataTransfer != null && message.hasOwnProperty("siteToSiteDataTransfer")) - object.siteToSiteDataTransfer = message.siteToSiteDataTransfer; - if (message.vpcNetwork != null && message.hasOwnProperty("vpcNetwork")) - object.vpcNetwork = message.vpcNetwork; return object; }; /** - * Converts this LinkedVpnTunnels to JSON. + * Converts this ListSpokesResponse to JSON. * @function toJSON - * @memberof google.cloud.networkconnectivity.v1.LinkedVpnTunnels + * @memberof google.cloud.networkconnectivity.v1.ListSpokesResponse * @instance * @returns {Object.} JSON object */ - LinkedVpnTunnels.prototype.toJSON = function toJSON() { + ListSpokesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for LinkedVpnTunnels + * Gets the default type url for ListSpokesResponse * @function getTypeUrl - * @memberof google.cloud.networkconnectivity.v1.LinkedVpnTunnels + * @memberof google.cloud.networkconnectivity.v1.ListSpokesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - LinkedVpnTunnels.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListSpokesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.LinkedVpnTunnels"; + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.ListSpokesResponse"; }; - return LinkedVpnTunnels; + return ListSpokesResponse; })(); - v1.LinkedInterconnectAttachments = (function() { + v1.GetSpokeRequest = (function() { /** - * Properties of a LinkedInterconnectAttachments. + * Properties of a GetSpokeRequest. * @memberof google.cloud.networkconnectivity.v1 - * @interface ILinkedInterconnectAttachments - * @property {Array.|null} [uris] LinkedInterconnectAttachments uris - * @property {boolean|null} [siteToSiteDataTransfer] LinkedInterconnectAttachments siteToSiteDataTransfer - * @property {string|null} [vpcNetwork] LinkedInterconnectAttachments vpcNetwork + * @interface IGetSpokeRequest + * @property {string|null} [name] GetSpokeRequest name */ /** - * Constructs a new LinkedInterconnectAttachments. + * Constructs a new GetSpokeRequest. * @memberof google.cloud.networkconnectivity.v1 - * @classdesc Represents a LinkedInterconnectAttachments. - * @implements ILinkedInterconnectAttachments + * @classdesc Represents a GetSpokeRequest. + * @implements IGetSpokeRequest * @constructor - * @param {google.cloud.networkconnectivity.v1.ILinkedInterconnectAttachments=} [properties] Properties to set + * @param {google.cloud.networkconnectivity.v1.IGetSpokeRequest=} [properties] Properties to set */ - function LinkedInterconnectAttachments(properties) { - this.uris = []; + function GetSpokeRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5441,106 +7266,75 @@ } /** - * LinkedInterconnectAttachments uris. - * @member {Array.} uris - * @memberof google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments - * @instance - */ - LinkedInterconnectAttachments.prototype.uris = $util.emptyArray; - - /** - * LinkedInterconnectAttachments siteToSiteDataTransfer. - * @member {boolean} siteToSiteDataTransfer - * @memberof google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments - * @instance - */ - LinkedInterconnectAttachments.prototype.siteToSiteDataTransfer = false; - - /** - * LinkedInterconnectAttachments vpcNetwork. - * @member {string} vpcNetwork - * @memberof google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + * GetSpokeRequest name. + * @member {string} name + * @memberof google.cloud.networkconnectivity.v1.GetSpokeRequest * @instance */ - LinkedInterconnectAttachments.prototype.vpcNetwork = ""; + GetSpokeRequest.prototype.name = ""; /** - * Creates a new LinkedInterconnectAttachments instance using the specified properties. + * Creates a new GetSpokeRequest instance using the specified properties. * @function create - * @memberof google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + * @memberof google.cloud.networkconnectivity.v1.GetSpokeRequest * @static - * @param {google.cloud.networkconnectivity.v1.ILinkedInterconnectAttachments=} [properties] Properties to set - * @returns {google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments} LinkedInterconnectAttachments instance + * @param {google.cloud.networkconnectivity.v1.IGetSpokeRequest=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.GetSpokeRequest} GetSpokeRequest instance */ - LinkedInterconnectAttachments.create = function create(properties) { - return new LinkedInterconnectAttachments(properties); + GetSpokeRequest.create = function create(properties) { + return new GetSpokeRequest(properties); }; /** - * Encodes the specified LinkedInterconnectAttachments message. Does not implicitly {@link google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments.verify|verify} messages. + * Encodes the specified GetSpokeRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.GetSpokeRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + * @memberof google.cloud.networkconnectivity.v1.GetSpokeRequest * @static - * @param {google.cloud.networkconnectivity.v1.ILinkedInterconnectAttachments} message LinkedInterconnectAttachments message or plain object to encode + * @param {google.cloud.networkconnectivity.v1.IGetSpokeRequest} message GetSpokeRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LinkedInterconnectAttachments.encode = function encode(message, writer) { + GetSpokeRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.uris != null && message.uris.length) - for (var i = 0; i < message.uris.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.uris[i]); - if (message.siteToSiteDataTransfer != null && Object.hasOwnProperty.call(message, "siteToSiteDataTransfer")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.siteToSiteDataTransfer); - if (message.vpcNetwork != null && Object.hasOwnProperty.call(message, "vpcNetwork")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.vpcNetwork); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified LinkedInterconnectAttachments message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments.verify|verify} messages. + * Encodes the specified GetSpokeRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.GetSpokeRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + * @memberof google.cloud.networkconnectivity.v1.GetSpokeRequest * @static - * @param {google.cloud.networkconnectivity.v1.ILinkedInterconnectAttachments} message LinkedInterconnectAttachments message or plain object to encode + * @param {google.cloud.networkconnectivity.v1.IGetSpokeRequest} message GetSpokeRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LinkedInterconnectAttachments.encodeDelimited = function encodeDelimited(message, writer) { + GetSpokeRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a LinkedInterconnectAttachments message from the specified reader or buffer. + * Decodes a GetSpokeRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + * @memberof google.cloud.networkconnectivity.v1.GetSpokeRequest * @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.LinkedInterconnectAttachments} LinkedInterconnectAttachments + * @returns {google.cloud.networkconnectivity.v1.GetSpokeRequest} GetSpokeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LinkedInterconnectAttachments.decode = function decode(reader, length) { + GetSpokeRequest.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.LinkedInterconnectAttachments(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkconnectivity.v1.GetSpokeRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.uris && message.uris.length)) - message.uris = []; - message.uris.push(reader.string()); - break; - } - case 2: { - message.siteToSiteDataTransfer = reader.bool(); - break; - } - case 3: { - message.vpcNetwork = reader.string(); + message.name = reader.string(); break; } default: @@ -5552,155 +7346,125 @@ }; /** - * Decodes a LinkedInterconnectAttachments message from the specified reader or buffer, length delimited. + * Decodes a GetSpokeRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + * @memberof google.cloud.networkconnectivity.v1.GetSpokeRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments} LinkedInterconnectAttachments + * @returns {google.cloud.networkconnectivity.v1.GetSpokeRequest} GetSpokeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LinkedInterconnectAttachments.decodeDelimited = function decodeDelimited(reader) { + GetSpokeRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a LinkedInterconnectAttachments message. + * Verifies a GetSpokeRequest message. * @function verify - * @memberof google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + * @memberof google.cloud.networkconnectivity.v1.GetSpokeRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - LinkedInterconnectAttachments.verify = function verify(message) { + GetSpokeRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.uris != null && message.hasOwnProperty("uris")) { - if (!Array.isArray(message.uris)) - return "uris: array expected"; - for (var i = 0; i < message.uris.length; ++i) - if (!$util.isString(message.uris[i])) - return "uris: string[] expected"; - } - if (message.siteToSiteDataTransfer != null && message.hasOwnProperty("siteToSiteDataTransfer")) - if (typeof message.siteToSiteDataTransfer !== "boolean") - return "siteToSiteDataTransfer: boolean expected"; - if (message.vpcNetwork != null && message.hasOwnProperty("vpcNetwork")) - if (!$util.isString(message.vpcNetwork)) - return "vpcNetwork: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a LinkedInterconnectAttachments message from a plain object. Also converts values to their respective internal types. + * Creates a GetSpokeRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + * @memberof google.cloud.networkconnectivity.v1.GetSpokeRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments} LinkedInterconnectAttachments + * @returns {google.cloud.networkconnectivity.v1.GetSpokeRequest} GetSpokeRequest */ - LinkedInterconnectAttachments.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments) + GetSpokeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.GetSpokeRequest) return object; - var message = new $root.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments(); - if (object.uris) { - if (!Array.isArray(object.uris)) - throw TypeError(".google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments.uris: array expected"); - message.uris = []; - for (var i = 0; i < object.uris.length; ++i) - message.uris[i] = String(object.uris[i]); - } - if (object.siteToSiteDataTransfer != null) - message.siteToSiteDataTransfer = Boolean(object.siteToSiteDataTransfer); - if (object.vpcNetwork != null) - message.vpcNetwork = String(object.vpcNetwork); + var message = new $root.google.cloud.networkconnectivity.v1.GetSpokeRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a LinkedInterconnectAttachments message. Also converts values to other types if specified. + * Creates a plain object from a GetSpokeRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + * @memberof google.cloud.networkconnectivity.v1.GetSpokeRequest * @static - * @param {google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments} message LinkedInterconnectAttachments + * @param {google.cloud.networkconnectivity.v1.GetSpokeRequest} message GetSpokeRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - LinkedInterconnectAttachments.toObject = function toObject(message, options) { + GetSpokeRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.uris = []; - if (options.defaults) { - object.siteToSiteDataTransfer = false; - object.vpcNetwork = ""; - } - if (message.uris && message.uris.length) { - object.uris = []; - for (var j = 0; j < message.uris.length; ++j) - object.uris[j] = message.uris[j]; - } - if (message.siteToSiteDataTransfer != null && message.hasOwnProperty("siteToSiteDataTransfer")) - object.siteToSiteDataTransfer = message.siteToSiteDataTransfer; - if (message.vpcNetwork != null && message.hasOwnProperty("vpcNetwork")) - object.vpcNetwork = message.vpcNetwork; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this LinkedInterconnectAttachments to JSON. + * Converts this GetSpokeRequest to JSON. * @function toJSON - * @memberof google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + * @memberof google.cloud.networkconnectivity.v1.GetSpokeRequest * @instance * @returns {Object.} JSON object */ - LinkedInterconnectAttachments.prototype.toJSON = function toJSON() { + GetSpokeRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for LinkedInterconnectAttachments + * Gets the default type url for GetSpokeRequest * @function getTypeUrl - * @memberof google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + * @memberof google.cloud.networkconnectivity.v1.GetSpokeRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - LinkedInterconnectAttachments.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetSpokeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments"; + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.GetSpokeRequest"; }; - return LinkedInterconnectAttachments; + return GetSpokeRequest; })(); - v1.LinkedRouterApplianceInstances = (function() { + v1.CreateSpokeRequest = (function() { /** - * Properties of a LinkedRouterApplianceInstances. + * Properties of a CreateSpokeRequest. * @memberof google.cloud.networkconnectivity.v1 - * @interface ILinkedRouterApplianceInstances - * @property {Array.|null} [instances] LinkedRouterApplianceInstances instances - * @property {boolean|null} [siteToSiteDataTransfer] LinkedRouterApplianceInstances siteToSiteDataTransfer - * @property {string|null} [vpcNetwork] LinkedRouterApplianceInstances vpcNetwork + * @interface ICreateSpokeRequest + * @property {string|null} [parent] CreateSpokeRequest parent + * @property {string|null} [spokeId] CreateSpokeRequest spokeId + * @property {google.cloud.networkconnectivity.v1.ISpoke|null} [spoke] CreateSpokeRequest spoke + * @property {string|null} [requestId] CreateSpokeRequest requestId */ /** - * Constructs a new LinkedRouterApplianceInstances. + * Constructs a new CreateSpokeRequest. * @memberof google.cloud.networkconnectivity.v1 - * @classdesc Represents a LinkedRouterApplianceInstances. - * @implements ILinkedRouterApplianceInstances + * @classdesc Represents a CreateSpokeRequest. + * @implements ICreateSpokeRequest * @constructor - * @param {google.cloud.networkconnectivity.v1.ILinkedRouterApplianceInstances=} [properties] Properties to set + * @param {google.cloud.networkconnectivity.v1.ICreateSpokeRequest=} [properties] Properties to set */ - function LinkedRouterApplianceInstances(properties) { - this.instances = []; + function CreateSpokeRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5708,106 +7472,117 @@ } /** - * LinkedRouterApplianceInstances instances. - * @member {Array.} instances - * @memberof google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + * CreateSpokeRequest parent. + * @member {string} parent + * @memberof google.cloud.networkconnectivity.v1.CreateSpokeRequest * @instance */ - LinkedRouterApplianceInstances.prototype.instances = $util.emptyArray; + CreateSpokeRequest.prototype.parent = ""; /** - * LinkedRouterApplianceInstances siteToSiteDataTransfer. - * @member {boolean} siteToSiteDataTransfer - * @memberof google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + * CreateSpokeRequest spokeId. + * @member {string} spokeId + * @memberof google.cloud.networkconnectivity.v1.CreateSpokeRequest * @instance */ - LinkedRouterApplianceInstances.prototype.siteToSiteDataTransfer = false; + CreateSpokeRequest.prototype.spokeId = ""; /** - * LinkedRouterApplianceInstances vpcNetwork. - * @member {string} vpcNetwork - * @memberof google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + * CreateSpokeRequest spoke. + * @member {google.cloud.networkconnectivity.v1.ISpoke|null|undefined} spoke + * @memberof google.cloud.networkconnectivity.v1.CreateSpokeRequest * @instance */ - LinkedRouterApplianceInstances.prototype.vpcNetwork = ""; + CreateSpokeRequest.prototype.spoke = null; /** - * Creates a new LinkedRouterApplianceInstances instance using the specified properties. + * CreateSpokeRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networkconnectivity.v1.CreateSpokeRequest + * @instance + */ + CreateSpokeRequest.prototype.requestId = ""; + + /** + * Creates a new CreateSpokeRequest instance using the specified properties. * @function create - * @memberof google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + * @memberof google.cloud.networkconnectivity.v1.CreateSpokeRequest * @static - * @param {google.cloud.networkconnectivity.v1.ILinkedRouterApplianceInstances=} [properties] Properties to set - * @returns {google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances} LinkedRouterApplianceInstances instance + * @param {google.cloud.networkconnectivity.v1.ICreateSpokeRequest=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.CreateSpokeRequest} CreateSpokeRequest instance */ - LinkedRouterApplianceInstances.create = function create(properties) { - return new LinkedRouterApplianceInstances(properties); + CreateSpokeRequest.create = function create(properties) { + return new CreateSpokeRequest(properties); }; /** - * Encodes the specified LinkedRouterApplianceInstances message. Does not implicitly {@link google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances.verify|verify} messages. + * Encodes the specified CreateSpokeRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.CreateSpokeRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + * @memberof google.cloud.networkconnectivity.v1.CreateSpokeRequest * @static - * @param {google.cloud.networkconnectivity.v1.ILinkedRouterApplianceInstances} message LinkedRouterApplianceInstances message or plain object to encode + * @param {google.cloud.networkconnectivity.v1.ICreateSpokeRequest} message CreateSpokeRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LinkedRouterApplianceInstances.encode = function encode(message, writer) { + CreateSpokeRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.instances != null && message.instances.length) - for (var i = 0; i < message.instances.length; ++i) - $root.google.cloud.networkconnectivity.v1.RouterApplianceInstance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.siteToSiteDataTransfer != null && Object.hasOwnProperty.call(message, "siteToSiteDataTransfer")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.siteToSiteDataTransfer); - if (message.vpcNetwork != null && Object.hasOwnProperty.call(message, "vpcNetwork")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.vpcNetwork); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.spokeId != null && Object.hasOwnProperty.call(message, "spokeId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.spokeId); + if (message.spoke != null && Object.hasOwnProperty.call(message, "spoke")) + $root.google.cloud.networkconnectivity.v1.Spoke.encode(message.spoke, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); return writer; }; /** - * Encodes the specified LinkedRouterApplianceInstances message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances.verify|verify} messages. + * Encodes the specified CreateSpokeRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.CreateSpokeRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + * @memberof google.cloud.networkconnectivity.v1.CreateSpokeRequest * @static - * @param {google.cloud.networkconnectivity.v1.ILinkedRouterApplianceInstances} message LinkedRouterApplianceInstances message or plain object to encode + * @param {google.cloud.networkconnectivity.v1.ICreateSpokeRequest} message CreateSpokeRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LinkedRouterApplianceInstances.encodeDelimited = function encodeDelimited(message, writer) { + CreateSpokeRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a LinkedRouterApplianceInstances message from the specified reader or buffer. + * Decodes a CreateSpokeRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + * @memberof google.cloud.networkconnectivity.v1.CreateSpokeRequest * @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.LinkedRouterApplianceInstances} LinkedRouterApplianceInstances + * @returns {google.cloud.networkconnectivity.v1.CreateSpokeRequest} CreateSpokeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LinkedRouterApplianceInstances.decode = function decode(reader, length) { + CreateSpokeRequest.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.LinkedRouterApplianceInstances(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkconnectivity.v1.CreateSpokeRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.instances && message.instances.length)) - message.instances = []; - message.instances.push($root.google.cloud.networkconnectivity.v1.RouterApplianceInstance.decode(reader, reader.uint32())); + message.parent = reader.string(); break; } case 2: { - message.siteToSiteDataTransfer = reader.bool(); + message.spokeId = reader.string(); break; } case 3: { - message.vpcNetwork = reader.string(); + message.spoke = $root.google.cloud.networkconnectivity.v1.Spoke.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); break; } default: @@ -5819,158 +7594,154 @@ }; /** - * Decodes a LinkedRouterApplianceInstances message from the specified reader or buffer, length delimited. + * Decodes a CreateSpokeRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + * @memberof google.cloud.networkconnectivity.v1.CreateSpokeRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances} LinkedRouterApplianceInstances + * @returns {google.cloud.networkconnectivity.v1.CreateSpokeRequest} CreateSpokeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - LinkedRouterApplianceInstances.decodeDelimited = function decodeDelimited(reader) { + CreateSpokeRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a LinkedRouterApplianceInstances message. + * Verifies a CreateSpokeRequest message. * @function verify - * @memberof google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + * @memberof google.cloud.networkconnectivity.v1.CreateSpokeRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - LinkedRouterApplianceInstances.verify = function verify(message) { + CreateSpokeRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.instances != null && message.hasOwnProperty("instances")) { - if (!Array.isArray(message.instances)) - return "instances: array expected"; - for (var i = 0; i < message.instances.length; ++i) { - var error = $root.google.cloud.networkconnectivity.v1.RouterApplianceInstance.verify(message.instances[i]); - if (error) - return "instances." + error; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.spokeId != null && message.hasOwnProperty("spokeId")) + if (!$util.isString(message.spokeId)) + return "spokeId: string expected"; + if (message.spoke != null && message.hasOwnProperty("spoke")) { + var error = $root.google.cloud.networkconnectivity.v1.Spoke.verify(message.spoke); + if (error) + return "spoke." + error; } - if (message.siteToSiteDataTransfer != null && message.hasOwnProperty("siteToSiteDataTransfer")) - if (typeof message.siteToSiteDataTransfer !== "boolean") - return "siteToSiteDataTransfer: boolean expected"; - if (message.vpcNetwork != null && message.hasOwnProperty("vpcNetwork")) - if (!$util.isString(message.vpcNetwork)) - return "vpcNetwork: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; return null; }; /** - * Creates a LinkedRouterApplianceInstances message from a plain object. Also converts values to their respective internal types. + * Creates a CreateSpokeRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + * @memberof google.cloud.networkconnectivity.v1.CreateSpokeRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances} LinkedRouterApplianceInstances + * @returns {google.cloud.networkconnectivity.v1.CreateSpokeRequest} CreateSpokeRequest */ - LinkedRouterApplianceInstances.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances) + CreateSpokeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.CreateSpokeRequest) return object; - var message = new $root.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances(); - if (object.instances) { - if (!Array.isArray(object.instances)) - throw TypeError(".google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances.instances: array expected"); - message.instances = []; - for (var i = 0; i < object.instances.length; ++i) { - if (typeof object.instances[i] !== "object") - throw TypeError(".google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances.instances: object expected"); - message.instances[i] = $root.google.cloud.networkconnectivity.v1.RouterApplianceInstance.fromObject(object.instances[i]); - } + var message = new $root.google.cloud.networkconnectivity.v1.CreateSpokeRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.spokeId != null) + message.spokeId = String(object.spokeId); + if (object.spoke != null) { + if (typeof object.spoke !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.CreateSpokeRequest.spoke: object expected"); + message.spoke = $root.google.cloud.networkconnectivity.v1.Spoke.fromObject(object.spoke); } - if (object.siteToSiteDataTransfer != null) - message.siteToSiteDataTransfer = Boolean(object.siteToSiteDataTransfer); - if (object.vpcNetwork != null) - message.vpcNetwork = String(object.vpcNetwork); + if (object.requestId != null) + message.requestId = String(object.requestId); return message; }; /** - * Creates a plain object from a LinkedRouterApplianceInstances message. Also converts values to other types if specified. + * Creates a plain object from a CreateSpokeRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + * @memberof google.cloud.networkconnectivity.v1.CreateSpokeRequest * @static - * @param {google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances} message LinkedRouterApplianceInstances + * @param {google.cloud.networkconnectivity.v1.CreateSpokeRequest} message CreateSpokeRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - LinkedRouterApplianceInstances.toObject = function toObject(message, options) { + CreateSpokeRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.instances = []; if (options.defaults) { - object.siteToSiteDataTransfer = false; - object.vpcNetwork = ""; - } - if (message.instances && message.instances.length) { - object.instances = []; - for (var j = 0; j < message.instances.length; ++j) - object.instances[j] = $root.google.cloud.networkconnectivity.v1.RouterApplianceInstance.toObject(message.instances[j], options); + object.parent = ""; + object.spokeId = ""; + object.spoke = null; + object.requestId = ""; } - if (message.siteToSiteDataTransfer != null && message.hasOwnProperty("siteToSiteDataTransfer")) - object.siteToSiteDataTransfer = message.siteToSiteDataTransfer; - if (message.vpcNetwork != null && message.hasOwnProperty("vpcNetwork")) - object.vpcNetwork = message.vpcNetwork; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.spokeId != null && message.hasOwnProperty("spokeId")) + object.spokeId = message.spokeId; + if (message.spoke != null && message.hasOwnProperty("spoke")) + object.spoke = $root.google.cloud.networkconnectivity.v1.Spoke.toObject(message.spoke, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; return object; }; /** - * Converts this LinkedRouterApplianceInstances to JSON. + * Converts this CreateSpokeRequest to JSON. * @function toJSON - * @memberof google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + * @memberof google.cloud.networkconnectivity.v1.CreateSpokeRequest * @instance * @returns {Object.} JSON object */ - LinkedRouterApplianceInstances.prototype.toJSON = function toJSON() { + CreateSpokeRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for LinkedRouterApplianceInstances + * Gets the default type url for CreateSpokeRequest * @function getTypeUrl - * @memberof google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + * @memberof google.cloud.networkconnectivity.v1.CreateSpokeRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - LinkedRouterApplianceInstances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateSpokeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances"; + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.CreateSpokeRequest"; }; - return LinkedRouterApplianceInstances; + return CreateSpokeRequest; })(); - v1.RouterApplianceInstance = (function() { + v1.UpdateSpokeRequest = (function() { /** - * Properties of a RouterApplianceInstance. + * Properties of an UpdateSpokeRequest. * @memberof google.cloud.networkconnectivity.v1 - * @interface IRouterApplianceInstance - * @property {string|null} [virtualMachine] RouterApplianceInstance virtualMachine - * @property {string|null} [ipAddress] RouterApplianceInstance ipAddress + * @interface IUpdateSpokeRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSpokeRequest updateMask + * @property {google.cloud.networkconnectivity.v1.ISpoke|null} [spoke] UpdateSpokeRequest spoke + * @property {string|null} [requestId] UpdateSpokeRequest requestId */ /** - * Constructs a new RouterApplianceInstance. + * Constructs a new UpdateSpokeRequest. * @memberof google.cloud.networkconnectivity.v1 - * @classdesc Represents a RouterApplianceInstance. - * @implements IRouterApplianceInstance + * @classdesc Represents an UpdateSpokeRequest. + * @implements IUpdateSpokeRequest * @constructor - * @param {google.cloud.networkconnectivity.v1.IRouterApplianceInstance=} [properties] Properties to set + * @param {google.cloud.networkconnectivity.v1.IUpdateSpokeRequest=} [properties] Properties to set */ - function RouterApplianceInstance(properties) { + function UpdateSpokeRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5978,89 +7749,103 @@ } /** - * RouterApplianceInstance virtualMachine. - * @member {string} virtualMachine - * @memberof google.cloud.networkconnectivity.v1.RouterApplianceInstance + * UpdateSpokeRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.networkconnectivity.v1.UpdateSpokeRequest * @instance */ - RouterApplianceInstance.prototype.virtualMachine = ""; + UpdateSpokeRequest.prototype.updateMask = null; /** - * RouterApplianceInstance ipAddress. - * @member {string} ipAddress - * @memberof google.cloud.networkconnectivity.v1.RouterApplianceInstance + * UpdateSpokeRequest spoke. + * @member {google.cloud.networkconnectivity.v1.ISpoke|null|undefined} spoke + * @memberof google.cloud.networkconnectivity.v1.UpdateSpokeRequest * @instance */ - RouterApplianceInstance.prototype.ipAddress = ""; + UpdateSpokeRequest.prototype.spoke = null; /** - * Creates a new RouterApplianceInstance instance using the specified properties. + * UpdateSpokeRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networkconnectivity.v1.UpdateSpokeRequest + * @instance + */ + UpdateSpokeRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateSpokeRequest instance using the specified properties. * @function create - * @memberof google.cloud.networkconnectivity.v1.RouterApplianceInstance + * @memberof google.cloud.networkconnectivity.v1.UpdateSpokeRequest * @static - * @param {google.cloud.networkconnectivity.v1.IRouterApplianceInstance=} [properties] Properties to set - * @returns {google.cloud.networkconnectivity.v1.RouterApplianceInstance} RouterApplianceInstance instance + * @param {google.cloud.networkconnectivity.v1.IUpdateSpokeRequest=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.UpdateSpokeRequest} UpdateSpokeRequest instance */ - RouterApplianceInstance.create = function create(properties) { - return new RouterApplianceInstance(properties); + UpdateSpokeRequest.create = function create(properties) { + return new UpdateSpokeRequest(properties); }; /** - * Encodes the specified RouterApplianceInstance message. Does not implicitly {@link google.cloud.networkconnectivity.v1.RouterApplianceInstance.verify|verify} messages. + * Encodes the specified UpdateSpokeRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.UpdateSpokeRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.networkconnectivity.v1.RouterApplianceInstance + * @memberof google.cloud.networkconnectivity.v1.UpdateSpokeRequest * @static - * @param {google.cloud.networkconnectivity.v1.IRouterApplianceInstance} message RouterApplianceInstance message or plain object to encode + * @param {google.cloud.networkconnectivity.v1.IUpdateSpokeRequest} message UpdateSpokeRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RouterApplianceInstance.encode = function encode(message, writer) { + UpdateSpokeRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.virtualMachine != null && Object.hasOwnProperty.call(message, "virtualMachine")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.virtualMachine); - if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.ipAddress); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.spoke != null && Object.hasOwnProperty.call(message, "spoke")) + $root.google.cloud.networkconnectivity.v1.Spoke.encode(message.spoke, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); return writer; }; /** - * Encodes the specified RouterApplianceInstance message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.RouterApplianceInstance.verify|verify} messages. + * Encodes the specified UpdateSpokeRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.UpdateSpokeRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.networkconnectivity.v1.RouterApplianceInstance + * @memberof google.cloud.networkconnectivity.v1.UpdateSpokeRequest * @static - * @param {google.cloud.networkconnectivity.v1.IRouterApplianceInstance} message RouterApplianceInstance message or plain object to encode + * @param {google.cloud.networkconnectivity.v1.IUpdateSpokeRequest} message UpdateSpokeRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RouterApplianceInstance.encodeDelimited = function encodeDelimited(message, writer) { + UpdateSpokeRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RouterApplianceInstance message from the specified reader or buffer. + * Decodes an UpdateSpokeRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.networkconnectivity.v1.RouterApplianceInstance + * @memberof google.cloud.networkconnectivity.v1.UpdateSpokeRequest * @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.RouterApplianceInstance} RouterApplianceInstance + * @returns {google.cloud.networkconnectivity.v1.UpdateSpokeRequest} UpdateSpokeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RouterApplianceInstance.decode = function decode(reader, length) { + UpdateSpokeRequest.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.RouterApplianceInstance(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkconnectivity.v1.UpdateSpokeRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.virtualMachine = reader.string(); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.spoke = $root.google.cloud.networkconnectivity.v1.Spoke.decode(reader, reader.uint32()); break; } case 3: { - message.ipAddress = reader.string(); + message.requestId = reader.string(); break; } default: @@ -6072,132 +7857,6361 @@ }; /** - * Decodes a RouterApplianceInstance message from the specified reader or buffer, length delimited. + * Decodes an UpdateSpokeRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.networkconnectivity.v1.RouterApplianceInstance + * @memberof google.cloud.networkconnectivity.v1.UpdateSpokeRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networkconnectivity.v1.RouterApplianceInstance} RouterApplianceInstance + * @returns {google.cloud.networkconnectivity.v1.UpdateSpokeRequest} UpdateSpokeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RouterApplianceInstance.decodeDelimited = function decodeDelimited(reader) { + UpdateSpokeRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RouterApplianceInstance message. + * Verifies an UpdateSpokeRequest message. * @function verify - * @memberof google.cloud.networkconnectivity.v1.RouterApplianceInstance + * @memberof google.cloud.networkconnectivity.v1.UpdateSpokeRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RouterApplianceInstance.verify = function verify(message) { + UpdateSpokeRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.virtualMachine != null && message.hasOwnProperty("virtualMachine")) - if (!$util.isString(message.virtualMachine)) - return "virtualMachine: string expected"; - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) - if (!$util.isString(message.ipAddress)) - return "ipAddress: string expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.spoke != null && message.hasOwnProperty("spoke")) { + var error = $root.google.cloud.networkconnectivity.v1.Spoke.verify(message.spoke); + if (error) + return "spoke." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; return null; }; - /** - * Creates a RouterApplianceInstance message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.networkconnectivity.v1.RouterApplianceInstance - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.networkconnectivity.v1.RouterApplianceInstance} RouterApplianceInstance - */ - RouterApplianceInstance.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networkconnectivity.v1.RouterApplianceInstance) + /** + * Creates an UpdateSpokeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.UpdateSpokeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.UpdateSpokeRequest} UpdateSpokeRequest + */ + UpdateSpokeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.UpdateSpokeRequest) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.UpdateSpokeRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.UpdateSpokeRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.spoke != null) { + if (typeof object.spoke !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.UpdateSpokeRequest.spoke: object expected"); + message.spoke = $root.google.cloud.networkconnectivity.v1.Spoke.fromObject(object.spoke); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateSpokeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.UpdateSpokeRequest + * @static + * @param {google.cloud.networkconnectivity.v1.UpdateSpokeRequest} message UpdateSpokeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSpokeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.spoke = null; + object.requestId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.spoke != null && message.hasOwnProperty("spoke")) + object.spoke = $root.google.cloud.networkconnectivity.v1.Spoke.toObject(message.spoke, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateSpokeRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.UpdateSpokeRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSpokeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSpokeRequest + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.UpdateSpokeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSpokeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.UpdateSpokeRequest"; + }; + + return UpdateSpokeRequest; + })(); + + v1.DeleteSpokeRequest = (function() { + + /** + * Properties of a DeleteSpokeRequest. + * @memberof google.cloud.networkconnectivity.v1 + * @interface IDeleteSpokeRequest + * @property {string|null} [name] DeleteSpokeRequest name + * @property {string|null} [requestId] DeleteSpokeRequest requestId + */ + + /** + * Constructs a new DeleteSpokeRequest. + * @memberof google.cloud.networkconnectivity.v1 + * @classdesc Represents a DeleteSpokeRequest. + * @implements IDeleteSpokeRequest + * @constructor + * @param {google.cloud.networkconnectivity.v1.IDeleteSpokeRequest=} [properties] Properties to set + */ + function DeleteSpokeRequest(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]]; + } + + /** + * DeleteSpokeRequest name. + * @member {string} name + * @memberof google.cloud.networkconnectivity.v1.DeleteSpokeRequest + * @instance + */ + DeleteSpokeRequest.prototype.name = ""; + + /** + * DeleteSpokeRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networkconnectivity.v1.DeleteSpokeRequest + * @instance + */ + DeleteSpokeRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteSpokeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.DeleteSpokeRequest + * @static + * @param {google.cloud.networkconnectivity.v1.IDeleteSpokeRequest=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.DeleteSpokeRequest} DeleteSpokeRequest instance + */ + DeleteSpokeRequest.create = function create(properties) { + return new DeleteSpokeRequest(properties); + }; + + /** + * Encodes the specified DeleteSpokeRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.DeleteSpokeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkconnectivity.v1.DeleteSpokeRequest + * @static + * @param {google.cloud.networkconnectivity.v1.IDeleteSpokeRequest} message DeleteSpokeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSpokeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified DeleteSpokeRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.DeleteSpokeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkconnectivity.v1.DeleteSpokeRequest + * @static + * @param {google.cloud.networkconnectivity.v1.IDeleteSpokeRequest} message DeleteSpokeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSpokeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSpokeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkconnectivity.v1.DeleteSpokeRequest + * @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.DeleteSpokeRequest} DeleteSpokeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSpokeRequest.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.DeleteSpokeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteSpokeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.DeleteSpokeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.DeleteSpokeRequest} DeleteSpokeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSpokeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSpokeRequest message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.DeleteSpokeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSpokeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a DeleteSpokeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.DeleteSpokeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.DeleteSpokeRequest} DeleteSpokeRequest + */ + DeleteSpokeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.DeleteSpokeRequest) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.DeleteSpokeRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a DeleteSpokeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.DeleteSpokeRequest + * @static + * @param {google.cloud.networkconnectivity.v1.DeleteSpokeRequest} message DeleteSpokeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSpokeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this DeleteSpokeRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.DeleteSpokeRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSpokeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSpokeRequest + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.DeleteSpokeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSpokeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.DeleteSpokeRequest"; + }; + + return DeleteSpokeRequest; + })(); + + v1.AcceptHubSpokeRequest = (function() { + + /** + * Properties of an AcceptHubSpokeRequest. + * @memberof google.cloud.networkconnectivity.v1 + * @interface IAcceptHubSpokeRequest + * @property {string|null} [name] AcceptHubSpokeRequest name + * @property {string|null} [spokeUri] AcceptHubSpokeRequest spokeUri + * @property {string|null} [requestId] AcceptHubSpokeRequest requestId + */ + + /** + * Constructs a new AcceptHubSpokeRequest. + * @memberof google.cloud.networkconnectivity.v1 + * @classdesc Represents an AcceptHubSpokeRequest. + * @implements IAcceptHubSpokeRequest + * @constructor + * @param {google.cloud.networkconnectivity.v1.IAcceptHubSpokeRequest=} [properties] Properties to set + */ + function AcceptHubSpokeRequest(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]]; + } + + /** + * AcceptHubSpokeRequest name. + * @member {string} name + * @memberof google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest + * @instance + */ + AcceptHubSpokeRequest.prototype.name = ""; + + /** + * AcceptHubSpokeRequest spokeUri. + * @member {string} spokeUri + * @memberof google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest + * @instance + */ + AcceptHubSpokeRequest.prototype.spokeUri = ""; + + /** + * AcceptHubSpokeRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest + * @instance + */ + AcceptHubSpokeRequest.prototype.requestId = ""; + + /** + * Creates a new AcceptHubSpokeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest + * @static + * @param {google.cloud.networkconnectivity.v1.IAcceptHubSpokeRequest=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest} AcceptHubSpokeRequest instance + */ + AcceptHubSpokeRequest.create = function create(properties) { + return new AcceptHubSpokeRequest(properties); + }; + + /** + * Encodes the specified AcceptHubSpokeRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest + * @static + * @param {google.cloud.networkconnectivity.v1.IAcceptHubSpokeRequest} message AcceptHubSpokeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcceptHubSpokeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.spokeUri != null && Object.hasOwnProperty.call(message, "spokeUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.spokeUri); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified AcceptHubSpokeRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest + * @static + * @param {google.cloud.networkconnectivity.v1.IAcceptHubSpokeRequest} message AcceptHubSpokeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcceptHubSpokeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AcceptHubSpokeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest + * @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.AcceptHubSpokeRequest} AcceptHubSpokeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcceptHubSpokeRequest.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.AcceptHubSpokeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.spokeUri = reader.string(); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AcceptHubSpokeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest} AcceptHubSpokeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcceptHubSpokeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AcceptHubSpokeRequest message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AcceptHubSpokeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.spokeUri != null && message.hasOwnProperty("spokeUri")) + if (!$util.isString(message.spokeUri)) + return "spokeUri: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an AcceptHubSpokeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest} AcceptHubSpokeRequest + */ + AcceptHubSpokeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.spokeUri != null) + message.spokeUri = String(object.spokeUri); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an AcceptHubSpokeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest + * @static + * @param {google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest} message AcceptHubSpokeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AcceptHubSpokeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.spokeUri = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.spokeUri != null && message.hasOwnProperty("spokeUri")) + object.spokeUri = message.spokeUri; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this AcceptHubSpokeRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest + * @instance + * @returns {Object.} JSON object + */ + AcceptHubSpokeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AcceptHubSpokeRequest + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AcceptHubSpokeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest"; + }; + + return AcceptHubSpokeRequest; + })(); + + v1.AcceptHubSpokeResponse = (function() { + + /** + * Properties of an AcceptHubSpokeResponse. + * @memberof google.cloud.networkconnectivity.v1 + * @interface IAcceptHubSpokeResponse + * @property {google.cloud.networkconnectivity.v1.ISpoke|null} [spoke] AcceptHubSpokeResponse spoke + */ + + /** + * Constructs a new AcceptHubSpokeResponse. + * @memberof google.cloud.networkconnectivity.v1 + * @classdesc Represents an AcceptHubSpokeResponse. + * @implements IAcceptHubSpokeResponse + * @constructor + * @param {google.cloud.networkconnectivity.v1.IAcceptHubSpokeResponse=} [properties] Properties to set + */ + function AcceptHubSpokeResponse(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]]; + } + + /** + * AcceptHubSpokeResponse spoke. + * @member {google.cloud.networkconnectivity.v1.ISpoke|null|undefined} spoke + * @memberof google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse + * @instance + */ + AcceptHubSpokeResponse.prototype.spoke = null; + + /** + * Creates a new AcceptHubSpokeResponse instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse + * @static + * @param {google.cloud.networkconnectivity.v1.IAcceptHubSpokeResponse=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse} AcceptHubSpokeResponse instance + */ + AcceptHubSpokeResponse.create = function create(properties) { + return new AcceptHubSpokeResponse(properties); + }; + + /** + * Encodes the specified AcceptHubSpokeResponse message. Does not implicitly {@link google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse + * @static + * @param {google.cloud.networkconnectivity.v1.IAcceptHubSpokeResponse} message AcceptHubSpokeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcceptHubSpokeResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.spoke != null && Object.hasOwnProperty.call(message, "spoke")) + $root.google.cloud.networkconnectivity.v1.Spoke.encode(message.spoke, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AcceptHubSpokeResponse message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse + * @static + * @param {google.cloud.networkconnectivity.v1.IAcceptHubSpokeResponse} message AcceptHubSpokeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AcceptHubSpokeResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AcceptHubSpokeResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse + * @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.AcceptHubSpokeResponse} AcceptHubSpokeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcceptHubSpokeResponse.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.AcceptHubSpokeResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.spoke = $root.google.cloud.networkconnectivity.v1.Spoke.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AcceptHubSpokeResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse} AcceptHubSpokeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AcceptHubSpokeResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AcceptHubSpokeResponse message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AcceptHubSpokeResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.spoke != null && message.hasOwnProperty("spoke")) { + var error = $root.google.cloud.networkconnectivity.v1.Spoke.verify(message.spoke); + if (error) + return "spoke." + error; + } + return null; + }; + + /** + * Creates an AcceptHubSpokeResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse} AcceptHubSpokeResponse + */ + AcceptHubSpokeResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse(); + if (object.spoke != null) { + if (typeof object.spoke !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse.spoke: object expected"); + message.spoke = $root.google.cloud.networkconnectivity.v1.Spoke.fromObject(object.spoke); + } + return message; + }; + + /** + * Creates a plain object from an AcceptHubSpokeResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse + * @static + * @param {google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse} message AcceptHubSpokeResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AcceptHubSpokeResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.spoke = null; + if (message.spoke != null && message.hasOwnProperty("spoke")) + object.spoke = $root.google.cloud.networkconnectivity.v1.Spoke.toObject(message.spoke, options); + return object; + }; + + /** + * Converts this AcceptHubSpokeResponse to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse + * @instance + * @returns {Object.} JSON object + */ + AcceptHubSpokeResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AcceptHubSpokeResponse + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AcceptHubSpokeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse"; + }; + + return AcceptHubSpokeResponse; + })(); + + v1.RejectHubSpokeRequest = (function() { + + /** + * Properties of a RejectHubSpokeRequest. + * @memberof google.cloud.networkconnectivity.v1 + * @interface IRejectHubSpokeRequest + * @property {string|null} [name] RejectHubSpokeRequest name + * @property {string|null} [spokeUri] RejectHubSpokeRequest spokeUri + * @property {string|null} [requestId] RejectHubSpokeRequest requestId + * @property {string|null} [details] RejectHubSpokeRequest details + */ + + /** + * Constructs a new RejectHubSpokeRequest. + * @memberof google.cloud.networkconnectivity.v1 + * @classdesc Represents a RejectHubSpokeRequest. + * @implements IRejectHubSpokeRequest + * @constructor + * @param {google.cloud.networkconnectivity.v1.IRejectHubSpokeRequest=} [properties] Properties to set + */ + function RejectHubSpokeRequest(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]]; + } + + /** + * RejectHubSpokeRequest name. + * @member {string} name + * @memberof google.cloud.networkconnectivity.v1.RejectHubSpokeRequest + * @instance + */ + RejectHubSpokeRequest.prototype.name = ""; + + /** + * RejectHubSpokeRequest spokeUri. + * @member {string} spokeUri + * @memberof google.cloud.networkconnectivity.v1.RejectHubSpokeRequest + * @instance + */ + RejectHubSpokeRequest.prototype.spokeUri = ""; + + /** + * RejectHubSpokeRequest requestId. + * @member {string} requestId + * @memberof google.cloud.networkconnectivity.v1.RejectHubSpokeRequest + * @instance + */ + RejectHubSpokeRequest.prototype.requestId = ""; + + /** + * RejectHubSpokeRequest details. + * @member {string} details + * @memberof google.cloud.networkconnectivity.v1.RejectHubSpokeRequest + * @instance + */ + RejectHubSpokeRequest.prototype.details = ""; + + /** + * Creates a new RejectHubSpokeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.RejectHubSpokeRequest + * @static + * @param {google.cloud.networkconnectivity.v1.IRejectHubSpokeRequest=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.RejectHubSpokeRequest} RejectHubSpokeRequest instance + */ + RejectHubSpokeRequest.create = function create(properties) { + return new RejectHubSpokeRequest(properties); + }; + + /** + * Encodes the specified RejectHubSpokeRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.RejectHubSpokeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkconnectivity.v1.RejectHubSpokeRequest + * @static + * @param {google.cloud.networkconnectivity.v1.IRejectHubSpokeRequest} message RejectHubSpokeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RejectHubSpokeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.spokeUri != null && Object.hasOwnProperty.call(message, "spokeUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.spokeUri); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.details != null && Object.hasOwnProperty.call(message, "details")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.details); + return writer; + }; + + /** + * Encodes the specified RejectHubSpokeRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.RejectHubSpokeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkconnectivity.v1.RejectHubSpokeRequest + * @static + * @param {google.cloud.networkconnectivity.v1.IRejectHubSpokeRequest} message RejectHubSpokeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RejectHubSpokeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RejectHubSpokeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkconnectivity.v1.RejectHubSpokeRequest + * @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.RejectHubSpokeRequest} RejectHubSpokeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RejectHubSpokeRequest.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.RejectHubSpokeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.spokeUri = reader.string(); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.details = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RejectHubSpokeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.RejectHubSpokeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.RejectHubSpokeRequest} RejectHubSpokeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RejectHubSpokeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RejectHubSpokeRequest message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.RejectHubSpokeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RejectHubSpokeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.spokeUri != null && message.hasOwnProperty("spokeUri")) + if (!$util.isString(message.spokeUri)) + return "spokeUri: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.details != null && message.hasOwnProperty("details")) + if (!$util.isString(message.details)) + return "details: string expected"; + return null; + }; + + /** + * Creates a RejectHubSpokeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.RejectHubSpokeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.RejectHubSpokeRequest} RejectHubSpokeRequest + */ + RejectHubSpokeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.RejectHubSpokeRequest) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.RejectHubSpokeRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.spokeUri != null) + message.spokeUri = String(object.spokeUri); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.details != null) + message.details = String(object.details); + return message; + }; + + /** + * Creates a plain object from a RejectHubSpokeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.RejectHubSpokeRequest + * @static + * @param {google.cloud.networkconnectivity.v1.RejectHubSpokeRequest} message RejectHubSpokeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RejectHubSpokeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.spokeUri = ""; + object.requestId = ""; + object.details = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.spokeUri != null && message.hasOwnProperty("spokeUri")) + object.spokeUri = message.spokeUri; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.details != null && message.hasOwnProperty("details")) + object.details = message.details; + return object; + }; + + /** + * Converts this RejectHubSpokeRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.RejectHubSpokeRequest + * @instance + * @returns {Object.} JSON object + */ + RejectHubSpokeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RejectHubSpokeRequest + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.RejectHubSpokeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RejectHubSpokeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.RejectHubSpokeRequest"; + }; + + return RejectHubSpokeRequest; + })(); + + v1.RejectHubSpokeResponse = (function() { + + /** + * Properties of a RejectHubSpokeResponse. + * @memberof google.cloud.networkconnectivity.v1 + * @interface IRejectHubSpokeResponse + * @property {google.cloud.networkconnectivity.v1.ISpoke|null} [spoke] RejectHubSpokeResponse spoke + */ + + /** + * Constructs a new RejectHubSpokeResponse. + * @memberof google.cloud.networkconnectivity.v1 + * @classdesc Represents a RejectHubSpokeResponse. + * @implements IRejectHubSpokeResponse + * @constructor + * @param {google.cloud.networkconnectivity.v1.IRejectHubSpokeResponse=} [properties] Properties to set + */ + function RejectHubSpokeResponse(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]]; + } + + /** + * RejectHubSpokeResponse spoke. + * @member {google.cloud.networkconnectivity.v1.ISpoke|null|undefined} spoke + * @memberof google.cloud.networkconnectivity.v1.RejectHubSpokeResponse + * @instance + */ + RejectHubSpokeResponse.prototype.spoke = null; + + /** + * Creates a new RejectHubSpokeResponse instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.RejectHubSpokeResponse + * @static + * @param {google.cloud.networkconnectivity.v1.IRejectHubSpokeResponse=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.RejectHubSpokeResponse} RejectHubSpokeResponse instance + */ + RejectHubSpokeResponse.create = function create(properties) { + return new RejectHubSpokeResponse(properties); + }; + + /** + * Encodes the specified RejectHubSpokeResponse message. Does not implicitly {@link google.cloud.networkconnectivity.v1.RejectHubSpokeResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkconnectivity.v1.RejectHubSpokeResponse + * @static + * @param {google.cloud.networkconnectivity.v1.IRejectHubSpokeResponse} message RejectHubSpokeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RejectHubSpokeResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.spoke != null && Object.hasOwnProperty.call(message, "spoke")) + $root.google.cloud.networkconnectivity.v1.Spoke.encode(message.spoke, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RejectHubSpokeResponse message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.RejectHubSpokeResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkconnectivity.v1.RejectHubSpokeResponse + * @static + * @param {google.cloud.networkconnectivity.v1.IRejectHubSpokeResponse} message RejectHubSpokeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RejectHubSpokeResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RejectHubSpokeResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkconnectivity.v1.RejectHubSpokeResponse + * @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.RejectHubSpokeResponse} RejectHubSpokeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RejectHubSpokeResponse.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.RejectHubSpokeResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.spoke = $root.google.cloud.networkconnectivity.v1.Spoke.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RejectHubSpokeResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.RejectHubSpokeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.RejectHubSpokeResponse} RejectHubSpokeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RejectHubSpokeResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RejectHubSpokeResponse message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.RejectHubSpokeResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RejectHubSpokeResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.spoke != null && message.hasOwnProperty("spoke")) { + var error = $root.google.cloud.networkconnectivity.v1.Spoke.verify(message.spoke); + if (error) + return "spoke." + error; + } + return null; + }; + + /** + * Creates a RejectHubSpokeResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.RejectHubSpokeResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.RejectHubSpokeResponse} RejectHubSpokeResponse + */ + RejectHubSpokeResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.RejectHubSpokeResponse) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.RejectHubSpokeResponse(); + if (object.spoke != null) { + if (typeof object.spoke !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.RejectHubSpokeResponse.spoke: object expected"); + message.spoke = $root.google.cloud.networkconnectivity.v1.Spoke.fromObject(object.spoke); + } + return message; + }; + + /** + * Creates a plain object from a RejectHubSpokeResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.RejectHubSpokeResponse + * @static + * @param {google.cloud.networkconnectivity.v1.RejectHubSpokeResponse} message RejectHubSpokeResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RejectHubSpokeResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.spoke = null; + if (message.spoke != null && message.hasOwnProperty("spoke")) + object.spoke = $root.google.cloud.networkconnectivity.v1.Spoke.toObject(message.spoke, options); + return object; + }; + + /** + * Converts this RejectHubSpokeResponse to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.RejectHubSpokeResponse + * @instance + * @returns {Object.} JSON object + */ + RejectHubSpokeResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RejectHubSpokeResponse + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.RejectHubSpokeResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RejectHubSpokeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.RejectHubSpokeResponse"; + }; + + return RejectHubSpokeResponse; + })(); + + v1.GetRouteTableRequest = (function() { + + /** + * Properties of a GetRouteTableRequest. + * @memberof google.cloud.networkconnectivity.v1 + * @interface IGetRouteTableRequest + * @property {string|null} [name] GetRouteTableRequest name + */ + + /** + * Constructs a new GetRouteTableRequest. + * @memberof google.cloud.networkconnectivity.v1 + * @classdesc Represents a GetRouteTableRequest. + * @implements IGetRouteTableRequest + * @constructor + * @param {google.cloud.networkconnectivity.v1.IGetRouteTableRequest=} [properties] Properties to set + */ + function GetRouteTableRequest(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]]; + } + + /** + * GetRouteTableRequest name. + * @member {string} name + * @memberof google.cloud.networkconnectivity.v1.GetRouteTableRequest + * @instance + */ + GetRouteTableRequest.prototype.name = ""; + + /** + * Creates a new GetRouteTableRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.GetRouteTableRequest + * @static + * @param {google.cloud.networkconnectivity.v1.IGetRouteTableRequest=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.GetRouteTableRequest} GetRouteTableRequest instance + */ + GetRouteTableRequest.create = function create(properties) { + return new GetRouteTableRequest(properties); + }; + + /** + * Encodes the specified GetRouteTableRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.GetRouteTableRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkconnectivity.v1.GetRouteTableRequest + * @static + * @param {google.cloud.networkconnectivity.v1.IGetRouteTableRequest} message GetRouteTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRouteTableRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetRouteTableRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.GetRouteTableRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkconnectivity.v1.GetRouteTableRequest + * @static + * @param {google.cloud.networkconnectivity.v1.IGetRouteTableRequest} message GetRouteTableRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRouteTableRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRouteTableRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkconnectivity.v1.GetRouteTableRequest + * @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.GetRouteTableRequest} GetRouteTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRouteTableRequest.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.GetRouteTableRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetRouteTableRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.GetRouteTableRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.GetRouteTableRequest} GetRouteTableRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRouteTableRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRouteTableRequest message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.GetRouteTableRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRouteTableRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetRouteTableRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.GetRouteTableRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.GetRouteTableRequest} GetRouteTableRequest + */ + GetRouteTableRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.GetRouteTableRequest) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.GetRouteTableRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetRouteTableRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.GetRouteTableRequest + * @static + * @param {google.cloud.networkconnectivity.v1.GetRouteTableRequest} message GetRouteTableRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRouteTableRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetRouteTableRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.GetRouteTableRequest + * @instance + * @returns {Object.} JSON object + */ + GetRouteTableRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetRouteTableRequest + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.GetRouteTableRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetRouteTableRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.GetRouteTableRequest"; + }; + + return GetRouteTableRequest; + })(); + + v1.GetRouteRequest = (function() { + + /** + * Properties of a GetRouteRequest. + * @memberof google.cloud.networkconnectivity.v1 + * @interface IGetRouteRequest + * @property {string|null} [name] GetRouteRequest name + */ + + /** + * Constructs a new GetRouteRequest. + * @memberof google.cloud.networkconnectivity.v1 + * @classdesc Represents a GetRouteRequest. + * @implements IGetRouteRequest + * @constructor + * @param {google.cloud.networkconnectivity.v1.IGetRouteRequest=} [properties] Properties to set + */ + function GetRouteRequest(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]]; + } + + /** + * GetRouteRequest name. + * @member {string} name + * @memberof google.cloud.networkconnectivity.v1.GetRouteRequest + * @instance + */ + GetRouteRequest.prototype.name = ""; + + /** + * Creates a new GetRouteRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.GetRouteRequest + * @static + * @param {google.cloud.networkconnectivity.v1.IGetRouteRequest=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.GetRouteRequest} GetRouteRequest instance + */ + GetRouteRequest.create = function create(properties) { + return new GetRouteRequest(properties); + }; + + /** + * Encodes the specified GetRouteRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.GetRouteRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkconnectivity.v1.GetRouteRequest + * @static + * @param {google.cloud.networkconnectivity.v1.IGetRouteRequest} message GetRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRouteRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetRouteRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.GetRouteRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkconnectivity.v1.GetRouteRequest + * @static + * @param {google.cloud.networkconnectivity.v1.IGetRouteRequest} message GetRouteRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetRouteRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetRouteRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkconnectivity.v1.GetRouteRequest + * @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.GetRouteRequest} GetRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRouteRequest.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.GetRouteRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetRouteRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.GetRouteRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.GetRouteRequest} GetRouteRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetRouteRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetRouteRequest message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.GetRouteRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetRouteRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetRouteRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.GetRouteRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.GetRouteRequest} GetRouteRequest + */ + GetRouteRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.GetRouteRequest) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.GetRouteRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetRouteRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.GetRouteRequest + * @static + * @param {google.cloud.networkconnectivity.v1.GetRouteRequest} message GetRouteRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetRouteRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetRouteRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.GetRouteRequest + * @instance + * @returns {Object.} JSON object + */ + GetRouteRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetRouteRequest + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.GetRouteRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetRouteRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.GetRouteRequest"; + }; + + return GetRouteRequest; + })(); + + v1.ListRoutesRequest = (function() { + + /** + * Properties of a ListRoutesRequest. + * @memberof google.cloud.networkconnectivity.v1 + * @interface IListRoutesRequest + * @property {string|null} [parent] ListRoutesRequest parent + * @property {number|null} [pageSize] ListRoutesRequest pageSize + * @property {string|null} [pageToken] ListRoutesRequest pageToken + * @property {string|null} [filter] ListRoutesRequest filter + * @property {string|null} [orderBy] ListRoutesRequest orderBy + */ + + /** + * Constructs a new ListRoutesRequest. + * @memberof google.cloud.networkconnectivity.v1 + * @classdesc Represents a ListRoutesRequest. + * @implements IListRoutesRequest + * @constructor + * @param {google.cloud.networkconnectivity.v1.IListRoutesRequest=} [properties] Properties to set + */ + function ListRoutesRequest(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]]; + } + + /** + * ListRoutesRequest parent. + * @member {string} parent + * @memberof google.cloud.networkconnectivity.v1.ListRoutesRequest + * @instance + */ + ListRoutesRequest.prototype.parent = ""; + + /** + * ListRoutesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networkconnectivity.v1.ListRoutesRequest + * @instance + */ + ListRoutesRequest.prototype.pageSize = 0; + + /** + * ListRoutesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networkconnectivity.v1.ListRoutesRequest + * @instance + */ + ListRoutesRequest.prototype.pageToken = ""; + + /** + * ListRoutesRequest filter. + * @member {string} filter + * @memberof google.cloud.networkconnectivity.v1.ListRoutesRequest + * @instance + */ + ListRoutesRequest.prototype.filter = ""; + + /** + * ListRoutesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.networkconnectivity.v1.ListRoutesRequest + * @instance + */ + ListRoutesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListRoutesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.ListRoutesRequest + * @static + * @param {google.cloud.networkconnectivity.v1.IListRoutesRequest=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.ListRoutesRequest} ListRoutesRequest instance + */ + ListRoutesRequest.create = function create(properties) { + return new ListRoutesRequest(properties); + }; + + /** + * Encodes the specified ListRoutesRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListRoutesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkconnectivity.v1.ListRoutesRequest + * @static + * @param {google.cloud.networkconnectivity.v1.IListRoutesRequest} message ListRoutesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRoutesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListRoutesRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListRoutesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkconnectivity.v1.ListRoutesRequest + * @static + * @param {google.cloud.networkconnectivity.v1.IListRoutesRequest} message ListRoutesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRoutesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRoutesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkconnectivity.v1.ListRoutesRequest + * @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.ListRoutesRequest} ListRoutesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRoutesRequest.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.ListRoutesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRoutesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.ListRoutesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.ListRoutesRequest} ListRoutesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRoutesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRoutesRequest message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.ListRoutesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRoutesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListRoutesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.ListRoutesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.ListRoutesRequest} ListRoutesRequest + */ + ListRoutesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.ListRoutesRequest) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.ListRoutesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListRoutesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.ListRoutesRequest + * @static + * @param {google.cloud.networkconnectivity.v1.ListRoutesRequest} message ListRoutesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRoutesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListRoutesRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.ListRoutesRequest + * @instance + * @returns {Object.} JSON object + */ + ListRoutesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRoutesRequest + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.ListRoutesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRoutesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.ListRoutesRequest"; + }; + + return ListRoutesRequest; + })(); + + v1.ListRoutesResponse = (function() { + + /** + * Properties of a ListRoutesResponse. + * @memberof google.cloud.networkconnectivity.v1 + * @interface IListRoutesResponse + * @property {Array.|null} [routes] ListRoutesResponse routes + * @property {string|null} [nextPageToken] ListRoutesResponse nextPageToken + * @property {Array.|null} [unreachable] ListRoutesResponse unreachable + */ + + /** + * Constructs a new ListRoutesResponse. + * @memberof google.cloud.networkconnectivity.v1 + * @classdesc Represents a ListRoutesResponse. + * @implements IListRoutesResponse + * @constructor + * @param {google.cloud.networkconnectivity.v1.IListRoutesResponse=} [properties] Properties to set + */ + function ListRoutesResponse(properties) { + this.routes = []; + this.unreachable = []; + 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]]; + } + + /** + * ListRoutesResponse routes. + * @member {Array.} routes + * @memberof google.cloud.networkconnectivity.v1.ListRoutesResponse + * @instance + */ + ListRoutesResponse.prototype.routes = $util.emptyArray; + + /** + * ListRoutesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networkconnectivity.v1.ListRoutesResponse + * @instance + */ + ListRoutesResponse.prototype.nextPageToken = ""; + + /** + * ListRoutesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.networkconnectivity.v1.ListRoutesResponse + * @instance + */ + ListRoutesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListRoutesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.ListRoutesResponse + * @static + * @param {google.cloud.networkconnectivity.v1.IListRoutesResponse=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.ListRoutesResponse} ListRoutesResponse instance + */ + ListRoutesResponse.create = function create(properties) { + return new ListRoutesResponse(properties); + }; + + /** + * Encodes the specified ListRoutesResponse message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListRoutesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkconnectivity.v1.ListRoutesResponse + * @static + * @param {google.cloud.networkconnectivity.v1.IListRoutesResponse} message ListRoutesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRoutesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.routes != null && message.routes.length) + for (var i = 0; i < message.routes.length; ++i) + $root.google.cloud.networkconnectivity.v1.Route.encode(message.routes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListRoutesResponse message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListRoutesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkconnectivity.v1.ListRoutesResponse + * @static + * @param {google.cloud.networkconnectivity.v1.IListRoutesResponse} message ListRoutesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRoutesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRoutesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkconnectivity.v1.ListRoutesResponse + * @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.ListRoutesResponse} ListRoutesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRoutesResponse.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.ListRoutesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.routes && message.routes.length)) + message.routes = []; + message.routes.push($root.google.cloud.networkconnectivity.v1.Route.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRoutesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.ListRoutesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.ListRoutesResponse} ListRoutesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRoutesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRoutesResponse message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.ListRoutesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRoutesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.routes != null && message.hasOwnProperty("routes")) { + if (!Array.isArray(message.routes)) + return "routes: array expected"; + for (var i = 0; i < message.routes.length; ++i) { + var error = $root.google.cloud.networkconnectivity.v1.Route.verify(message.routes[i]); + if (error) + return "routes." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListRoutesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.ListRoutesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.ListRoutesResponse} ListRoutesResponse + */ + ListRoutesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.ListRoutesResponse) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.ListRoutesResponse(); + if (object.routes) { + if (!Array.isArray(object.routes)) + throw TypeError(".google.cloud.networkconnectivity.v1.ListRoutesResponse.routes: array expected"); + message.routes = []; + for (var i = 0; i < object.routes.length; ++i) { + if (typeof object.routes[i] !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.ListRoutesResponse.routes: object expected"); + message.routes[i] = $root.google.cloud.networkconnectivity.v1.Route.fromObject(object.routes[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.networkconnectivity.v1.ListRoutesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListRoutesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.ListRoutesResponse + * @static + * @param {google.cloud.networkconnectivity.v1.ListRoutesResponse} message ListRoutesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRoutesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.routes = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.routes && message.routes.length) { + object.routes = []; + for (var j = 0; j < message.routes.length; ++j) + object.routes[j] = $root.google.cloud.networkconnectivity.v1.Route.toObject(message.routes[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListRoutesResponse to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.ListRoutesResponse + * @instance + * @returns {Object.} JSON object + */ + ListRoutesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRoutesResponse + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.ListRoutesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRoutesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.ListRoutesResponse"; + }; + + return ListRoutesResponse; + })(); + + v1.ListRouteTablesRequest = (function() { + + /** + * Properties of a ListRouteTablesRequest. + * @memberof google.cloud.networkconnectivity.v1 + * @interface IListRouteTablesRequest + * @property {string|null} [parent] ListRouteTablesRequest parent + * @property {number|null} [pageSize] ListRouteTablesRequest pageSize + * @property {string|null} [pageToken] ListRouteTablesRequest pageToken + * @property {string|null} [filter] ListRouteTablesRequest filter + * @property {string|null} [orderBy] ListRouteTablesRequest orderBy + */ + + /** + * Constructs a new ListRouteTablesRequest. + * @memberof google.cloud.networkconnectivity.v1 + * @classdesc Represents a ListRouteTablesRequest. + * @implements IListRouteTablesRequest + * @constructor + * @param {google.cloud.networkconnectivity.v1.IListRouteTablesRequest=} [properties] Properties to set + */ + function ListRouteTablesRequest(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]]; + } + + /** + * ListRouteTablesRequest parent. + * @member {string} parent + * @memberof google.cloud.networkconnectivity.v1.ListRouteTablesRequest + * @instance + */ + ListRouteTablesRequest.prototype.parent = ""; + + /** + * ListRouteTablesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networkconnectivity.v1.ListRouteTablesRequest + * @instance + */ + ListRouteTablesRequest.prototype.pageSize = 0; + + /** + * ListRouteTablesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networkconnectivity.v1.ListRouteTablesRequest + * @instance + */ + ListRouteTablesRequest.prototype.pageToken = ""; + + /** + * ListRouteTablesRequest filter. + * @member {string} filter + * @memberof google.cloud.networkconnectivity.v1.ListRouteTablesRequest + * @instance + */ + ListRouteTablesRequest.prototype.filter = ""; + + /** + * ListRouteTablesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.networkconnectivity.v1.ListRouteTablesRequest + * @instance + */ + ListRouteTablesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListRouteTablesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.ListRouteTablesRequest + * @static + * @param {google.cloud.networkconnectivity.v1.IListRouteTablesRequest=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.ListRouteTablesRequest} ListRouteTablesRequest instance + */ + ListRouteTablesRequest.create = function create(properties) { + return new ListRouteTablesRequest(properties); + }; + + /** + * Encodes the specified ListRouteTablesRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListRouteTablesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkconnectivity.v1.ListRouteTablesRequest + * @static + * @param {google.cloud.networkconnectivity.v1.IListRouteTablesRequest} message ListRouteTablesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRouteTablesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListRouteTablesRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListRouteTablesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkconnectivity.v1.ListRouteTablesRequest + * @static + * @param {google.cloud.networkconnectivity.v1.IListRouteTablesRequest} message ListRouteTablesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRouteTablesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRouteTablesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkconnectivity.v1.ListRouteTablesRequest + * @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.ListRouteTablesRequest} ListRouteTablesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRouteTablesRequest.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.ListRouteTablesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRouteTablesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.ListRouteTablesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.ListRouteTablesRequest} ListRouteTablesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRouteTablesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRouteTablesRequest message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.ListRouteTablesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRouteTablesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListRouteTablesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.ListRouteTablesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.ListRouteTablesRequest} ListRouteTablesRequest + */ + ListRouteTablesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.ListRouteTablesRequest) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.ListRouteTablesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListRouteTablesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.ListRouteTablesRequest + * @static + * @param {google.cloud.networkconnectivity.v1.ListRouteTablesRequest} message ListRouteTablesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRouteTablesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListRouteTablesRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.ListRouteTablesRequest + * @instance + * @returns {Object.} JSON object + */ + ListRouteTablesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRouteTablesRequest + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.ListRouteTablesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRouteTablesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.ListRouteTablesRequest"; + }; + + return ListRouteTablesRequest; + })(); + + v1.ListRouteTablesResponse = (function() { + + /** + * Properties of a ListRouteTablesResponse. + * @memberof google.cloud.networkconnectivity.v1 + * @interface IListRouteTablesResponse + * @property {Array.|null} [routeTables] ListRouteTablesResponse routeTables + * @property {string|null} [nextPageToken] ListRouteTablesResponse nextPageToken + * @property {Array.|null} [unreachable] ListRouteTablesResponse unreachable + */ + + /** + * Constructs a new ListRouteTablesResponse. + * @memberof google.cloud.networkconnectivity.v1 + * @classdesc Represents a ListRouteTablesResponse. + * @implements IListRouteTablesResponse + * @constructor + * @param {google.cloud.networkconnectivity.v1.IListRouteTablesResponse=} [properties] Properties to set + */ + function ListRouteTablesResponse(properties) { + this.routeTables = []; + this.unreachable = []; + 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]]; + } + + /** + * ListRouteTablesResponse routeTables. + * @member {Array.} routeTables + * @memberof google.cloud.networkconnectivity.v1.ListRouteTablesResponse + * @instance + */ + ListRouteTablesResponse.prototype.routeTables = $util.emptyArray; + + /** + * ListRouteTablesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networkconnectivity.v1.ListRouteTablesResponse + * @instance + */ + ListRouteTablesResponse.prototype.nextPageToken = ""; + + /** + * ListRouteTablesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.networkconnectivity.v1.ListRouteTablesResponse + * @instance + */ + ListRouteTablesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListRouteTablesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.ListRouteTablesResponse + * @static + * @param {google.cloud.networkconnectivity.v1.IListRouteTablesResponse=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.ListRouteTablesResponse} ListRouteTablesResponse instance + */ + ListRouteTablesResponse.create = function create(properties) { + return new ListRouteTablesResponse(properties); + }; + + /** + * Encodes the specified ListRouteTablesResponse message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListRouteTablesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkconnectivity.v1.ListRouteTablesResponse + * @static + * @param {google.cloud.networkconnectivity.v1.IListRouteTablesResponse} message ListRouteTablesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRouteTablesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.routeTables != null && message.routeTables.length) + for (var i = 0; i < message.routeTables.length; ++i) + $root.google.cloud.networkconnectivity.v1.RouteTable.encode(message.routeTables[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListRouteTablesResponse message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListRouteTablesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkconnectivity.v1.ListRouteTablesResponse + * @static + * @param {google.cloud.networkconnectivity.v1.IListRouteTablesResponse} message ListRouteTablesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListRouteTablesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListRouteTablesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkconnectivity.v1.ListRouteTablesResponse + * @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.ListRouteTablesResponse} ListRouteTablesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRouteTablesResponse.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.ListRouteTablesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.routeTables && message.routeTables.length)) + message.routeTables = []; + message.routeTables.push($root.google.cloud.networkconnectivity.v1.RouteTable.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListRouteTablesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.ListRouteTablesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.ListRouteTablesResponse} ListRouteTablesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListRouteTablesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListRouteTablesResponse message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.ListRouteTablesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListRouteTablesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.routeTables != null && message.hasOwnProperty("routeTables")) { + if (!Array.isArray(message.routeTables)) + return "routeTables: array expected"; + for (var i = 0; i < message.routeTables.length; ++i) { + var error = $root.google.cloud.networkconnectivity.v1.RouteTable.verify(message.routeTables[i]); + if (error) + return "routeTables." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListRouteTablesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.ListRouteTablesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.ListRouteTablesResponse} ListRouteTablesResponse + */ + ListRouteTablesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.ListRouteTablesResponse) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.ListRouteTablesResponse(); + if (object.routeTables) { + if (!Array.isArray(object.routeTables)) + throw TypeError(".google.cloud.networkconnectivity.v1.ListRouteTablesResponse.routeTables: array expected"); + message.routeTables = []; + for (var i = 0; i < object.routeTables.length; ++i) { + if (typeof object.routeTables[i] !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.ListRouteTablesResponse.routeTables: object expected"); + message.routeTables[i] = $root.google.cloud.networkconnectivity.v1.RouteTable.fromObject(object.routeTables[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.networkconnectivity.v1.ListRouteTablesResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListRouteTablesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.ListRouteTablesResponse + * @static + * @param {google.cloud.networkconnectivity.v1.ListRouteTablesResponse} message ListRouteTablesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListRouteTablesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.routeTables = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.routeTables && message.routeTables.length) { + object.routeTables = []; + for (var j = 0; j < message.routeTables.length; ++j) + object.routeTables[j] = $root.google.cloud.networkconnectivity.v1.RouteTable.toObject(message.routeTables[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListRouteTablesResponse to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.ListRouteTablesResponse + * @instance + * @returns {Object.} JSON object + */ + ListRouteTablesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListRouteTablesResponse + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.ListRouteTablesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListRouteTablesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.ListRouteTablesResponse"; + }; + + return ListRouteTablesResponse; + })(); + + v1.ListGroupsRequest = (function() { + + /** + * Properties of a ListGroupsRequest. + * @memberof google.cloud.networkconnectivity.v1 + * @interface IListGroupsRequest + * @property {string|null} [parent] ListGroupsRequest parent + * @property {number|null} [pageSize] ListGroupsRequest pageSize + * @property {string|null} [pageToken] ListGroupsRequest pageToken + * @property {string|null} [filter] ListGroupsRequest filter + * @property {string|null} [orderBy] ListGroupsRequest orderBy + */ + + /** + * Constructs a new ListGroupsRequest. + * @memberof google.cloud.networkconnectivity.v1 + * @classdesc Represents a ListGroupsRequest. + * @implements IListGroupsRequest + * @constructor + * @param {google.cloud.networkconnectivity.v1.IListGroupsRequest=} [properties] Properties to set + */ + function ListGroupsRequest(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]]; + } + + /** + * ListGroupsRequest parent. + * @member {string} parent + * @memberof google.cloud.networkconnectivity.v1.ListGroupsRequest + * @instance + */ + ListGroupsRequest.prototype.parent = ""; + + /** + * ListGroupsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.networkconnectivity.v1.ListGroupsRequest + * @instance + */ + ListGroupsRequest.prototype.pageSize = 0; + + /** + * ListGroupsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.networkconnectivity.v1.ListGroupsRequest + * @instance + */ + ListGroupsRequest.prototype.pageToken = ""; + + /** + * ListGroupsRequest filter. + * @member {string} filter + * @memberof google.cloud.networkconnectivity.v1.ListGroupsRequest + * @instance + */ + ListGroupsRequest.prototype.filter = ""; + + /** + * ListGroupsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.networkconnectivity.v1.ListGroupsRequest + * @instance + */ + ListGroupsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListGroupsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.ListGroupsRequest + * @static + * @param {google.cloud.networkconnectivity.v1.IListGroupsRequest=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.ListGroupsRequest} ListGroupsRequest instance + */ + ListGroupsRequest.create = function create(properties) { + return new ListGroupsRequest(properties); + }; + + /** + * Encodes the specified ListGroupsRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListGroupsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkconnectivity.v1.ListGroupsRequest + * @static + * @param {google.cloud.networkconnectivity.v1.IListGroupsRequest} message ListGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGroupsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified ListGroupsRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListGroupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkconnectivity.v1.ListGroupsRequest + * @static + * @param {google.cloud.networkconnectivity.v1.IListGroupsRequest} message ListGroupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGroupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGroupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkconnectivity.v1.ListGroupsRequest + * @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.ListGroupsRequest} ListGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGroupsRequest.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.ListGroupsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.filter = reader.string(); + break; + } + case 5: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGroupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.ListGroupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.ListGroupsRequest} ListGroupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGroupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGroupsRequest message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.ListGroupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGroupsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + return null; + }; + + /** + * Creates a ListGroupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.ListGroupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.ListGroupsRequest} ListGroupsRequest + */ + ListGroupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.ListGroupsRequest) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.ListGroupsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + if (object.orderBy != null) + message.orderBy = String(object.orderBy); + return message; + }; + + /** + * Creates a plain object from a ListGroupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.ListGroupsRequest + * @static + * @param {google.cloud.networkconnectivity.v1.ListGroupsRequest} message ListGroupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGroupsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + return object; + }; + + /** + * Converts this ListGroupsRequest to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.ListGroupsRequest + * @instance + * @returns {Object.} JSON object + */ + ListGroupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListGroupsRequest + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.ListGroupsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGroupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.ListGroupsRequest"; + }; + + return ListGroupsRequest; + })(); + + v1.ListGroupsResponse = (function() { + + /** + * Properties of a ListGroupsResponse. + * @memberof google.cloud.networkconnectivity.v1 + * @interface IListGroupsResponse + * @property {Array.|null} [groups] ListGroupsResponse groups + * @property {string|null} [nextPageToken] ListGroupsResponse nextPageToken + * @property {Array.|null} [unreachable] ListGroupsResponse unreachable + */ + + /** + * Constructs a new ListGroupsResponse. + * @memberof google.cloud.networkconnectivity.v1 + * @classdesc Represents a ListGroupsResponse. + * @implements IListGroupsResponse + * @constructor + * @param {google.cloud.networkconnectivity.v1.IListGroupsResponse=} [properties] Properties to set + */ + function ListGroupsResponse(properties) { + this.groups = []; + this.unreachable = []; + 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]]; + } + + /** + * ListGroupsResponse groups. + * @member {Array.} groups + * @memberof google.cloud.networkconnectivity.v1.ListGroupsResponse + * @instance + */ + ListGroupsResponse.prototype.groups = $util.emptyArray; + + /** + * ListGroupsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.networkconnectivity.v1.ListGroupsResponse + * @instance + */ + ListGroupsResponse.prototype.nextPageToken = ""; + + /** + * ListGroupsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.networkconnectivity.v1.ListGroupsResponse + * @instance + */ + ListGroupsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListGroupsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.ListGroupsResponse + * @static + * @param {google.cloud.networkconnectivity.v1.IListGroupsResponse=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.ListGroupsResponse} ListGroupsResponse instance + */ + ListGroupsResponse.create = function create(properties) { + return new ListGroupsResponse(properties); + }; + + /** + * Encodes the specified ListGroupsResponse message. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListGroupsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkconnectivity.v1.ListGroupsResponse + * @static + * @param {google.cloud.networkconnectivity.v1.IListGroupsResponse} message ListGroupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGroupsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.groups != null && message.groups.length) + for (var i = 0; i < message.groups.length; ++i) + $root.google.cloud.networkconnectivity.v1.Group.encode(message.groups[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.unreachable != null && message.unreachable.length) + for (var i = 0; i < message.unreachable.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.unreachable[i]); + return writer; + }; + + /** + * Encodes the specified ListGroupsResponse message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.ListGroupsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkconnectivity.v1.ListGroupsResponse + * @static + * @param {google.cloud.networkconnectivity.v1.IListGroupsResponse} message ListGroupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListGroupsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListGroupsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkconnectivity.v1.ListGroupsResponse + * @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.ListGroupsResponse} ListGroupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGroupsResponse.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.ListGroupsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.groups && message.groups.length)) + message.groups = []; + message.groups.push($root.google.cloud.networkconnectivity.v1.Group.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + case 3: { + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListGroupsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.ListGroupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.ListGroupsResponse} ListGroupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListGroupsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListGroupsResponse message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.ListGroupsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListGroupsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.groups != null && message.hasOwnProperty("groups")) { + if (!Array.isArray(message.groups)) + return "groups: array expected"; + for (var i = 0; i < message.groups.length; ++i) { + var error = $root.google.cloud.networkconnectivity.v1.Group.verify(message.groups[i]); + if (error) + return "groups." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + if (message.unreachable != null && message.hasOwnProperty("unreachable")) { + if (!Array.isArray(message.unreachable)) + return "unreachable: array expected"; + for (var i = 0; i < message.unreachable.length; ++i) + if (!$util.isString(message.unreachable[i])) + return "unreachable: string[] expected"; + } + return null; + }; + + /** + * Creates a ListGroupsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.ListGroupsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.ListGroupsResponse} ListGroupsResponse + */ + ListGroupsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.ListGroupsResponse) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.ListGroupsResponse(); + if (object.groups) { + if (!Array.isArray(object.groups)) + throw TypeError(".google.cloud.networkconnectivity.v1.ListGroupsResponse.groups: array expected"); + message.groups = []; + for (var i = 0; i < object.groups.length; ++i) { + if (typeof object.groups[i] !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.ListGroupsResponse.groups: object expected"); + message.groups[i] = $root.google.cloud.networkconnectivity.v1.Group.fromObject(object.groups[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.networkconnectivity.v1.ListGroupsResponse.unreachable: array expected"); + message.unreachable = []; + for (var i = 0; i < object.unreachable.length; ++i) + message.unreachable[i] = String(object.unreachable[i]); + } + return message; + }; + + /** + * Creates a plain object from a ListGroupsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.ListGroupsResponse + * @static + * @param {google.cloud.networkconnectivity.v1.ListGroupsResponse} message ListGroupsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListGroupsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.groups = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.groups && message.groups.length) { + object.groups = []; + for (var j = 0; j < message.groups.length; ++j) + object.groups[j] = $root.google.cloud.networkconnectivity.v1.Group.toObject(message.groups[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + if (message.unreachable && message.unreachable.length) { + object.unreachable = []; + for (var j = 0; j < message.unreachable.length; ++j) + object.unreachable[j] = message.unreachable[j]; + } + return object; + }; + + /** + * Converts this ListGroupsResponse to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.ListGroupsResponse + * @instance + * @returns {Object.} JSON object + */ + ListGroupsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListGroupsResponse + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.ListGroupsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListGroupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.ListGroupsResponse"; + }; + + return ListGroupsResponse; + })(); + + v1.LinkedVpnTunnels = (function() { + + /** + * Properties of a LinkedVpnTunnels. + * @memberof google.cloud.networkconnectivity.v1 + * @interface ILinkedVpnTunnels + * @property {Array.|null} [uris] LinkedVpnTunnels uris + * @property {boolean|null} [siteToSiteDataTransfer] LinkedVpnTunnels siteToSiteDataTransfer + * @property {string|null} [vpcNetwork] LinkedVpnTunnels vpcNetwork + */ + + /** + * Constructs a new LinkedVpnTunnels. + * @memberof google.cloud.networkconnectivity.v1 + * @classdesc Represents a LinkedVpnTunnels. + * @implements ILinkedVpnTunnels + * @constructor + * @param {google.cloud.networkconnectivity.v1.ILinkedVpnTunnels=} [properties] Properties to set + */ + function LinkedVpnTunnels(properties) { + this.uris = []; + 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]]; + } + + /** + * LinkedVpnTunnels uris. + * @member {Array.} uris + * @memberof google.cloud.networkconnectivity.v1.LinkedVpnTunnels + * @instance + */ + LinkedVpnTunnels.prototype.uris = $util.emptyArray; + + /** + * LinkedVpnTunnels siteToSiteDataTransfer. + * @member {boolean} siteToSiteDataTransfer + * @memberof google.cloud.networkconnectivity.v1.LinkedVpnTunnels + * @instance + */ + LinkedVpnTunnels.prototype.siteToSiteDataTransfer = false; + + /** + * LinkedVpnTunnels vpcNetwork. + * @member {string} vpcNetwork + * @memberof google.cloud.networkconnectivity.v1.LinkedVpnTunnels + * @instance + */ + LinkedVpnTunnels.prototype.vpcNetwork = ""; + + /** + * Creates a new LinkedVpnTunnels instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.LinkedVpnTunnels + * @static + * @param {google.cloud.networkconnectivity.v1.ILinkedVpnTunnels=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.LinkedVpnTunnels} LinkedVpnTunnels instance + */ + LinkedVpnTunnels.create = function create(properties) { + return new LinkedVpnTunnels(properties); + }; + + /** + * Encodes the specified LinkedVpnTunnels message. Does not implicitly {@link google.cloud.networkconnectivity.v1.LinkedVpnTunnels.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkconnectivity.v1.LinkedVpnTunnels + * @static + * @param {google.cloud.networkconnectivity.v1.ILinkedVpnTunnels} message LinkedVpnTunnels message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LinkedVpnTunnels.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uris != null && message.uris.length) + for (var i = 0; i < message.uris.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uris[i]); + if (message.siteToSiteDataTransfer != null && Object.hasOwnProperty.call(message, "siteToSiteDataTransfer")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.siteToSiteDataTransfer); + if (message.vpcNetwork != null && Object.hasOwnProperty.call(message, "vpcNetwork")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.vpcNetwork); + return writer; + }; + + /** + * Encodes the specified LinkedVpnTunnels message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.LinkedVpnTunnels.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkconnectivity.v1.LinkedVpnTunnels + * @static + * @param {google.cloud.networkconnectivity.v1.ILinkedVpnTunnels} message LinkedVpnTunnels message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LinkedVpnTunnels.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LinkedVpnTunnels message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkconnectivity.v1.LinkedVpnTunnels + * @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.LinkedVpnTunnels} LinkedVpnTunnels + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LinkedVpnTunnels.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.LinkedVpnTunnels(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.uris && message.uris.length)) + message.uris = []; + message.uris.push(reader.string()); + break; + } + case 2: { + message.siteToSiteDataTransfer = reader.bool(); + break; + } + case 3: { + message.vpcNetwork = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LinkedVpnTunnels message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.LinkedVpnTunnels + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.LinkedVpnTunnels} LinkedVpnTunnels + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LinkedVpnTunnels.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LinkedVpnTunnels message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.LinkedVpnTunnels + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LinkedVpnTunnels.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uris != null && message.hasOwnProperty("uris")) { + if (!Array.isArray(message.uris)) + return "uris: array expected"; + for (var i = 0; i < message.uris.length; ++i) + if (!$util.isString(message.uris[i])) + return "uris: string[] expected"; + } + if (message.siteToSiteDataTransfer != null && message.hasOwnProperty("siteToSiteDataTransfer")) + if (typeof message.siteToSiteDataTransfer !== "boolean") + return "siteToSiteDataTransfer: boolean expected"; + if (message.vpcNetwork != null && message.hasOwnProperty("vpcNetwork")) + if (!$util.isString(message.vpcNetwork)) + return "vpcNetwork: string expected"; + return null; + }; + + /** + * Creates a LinkedVpnTunnels message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.LinkedVpnTunnels + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.LinkedVpnTunnels} LinkedVpnTunnels + */ + LinkedVpnTunnels.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.LinkedVpnTunnels) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.LinkedVpnTunnels(); + if (object.uris) { + if (!Array.isArray(object.uris)) + throw TypeError(".google.cloud.networkconnectivity.v1.LinkedVpnTunnels.uris: array expected"); + message.uris = []; + for (var i = 0; i < object.uris.length; ++i) + message.uris[i] = String(object.uris[i]); + } + if (object.siteToSiteDataTransfer != null) + message.siteToSiteDataTransfer = Boolean(object.siteToSiteDataTransfer); + if (object.vpcNetwork != null) + message.vpcNetwork = String(object.vpcNetwork); + return message; + }; + + /** + * Creates a plain object from a LinkedVpnTunnels message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.LinkedVpnTunnels + * @static + * @param {google.cloud.networkconnectivity.v1.LinkedVpnTunnels} message LinkedVpnTunnels + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LinkedVpnTunnels.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uris = []; + if (options.defaults) { + object.siteToSiteDataTransfer = false; + object.vpcNetwork = ""; + } + if (message.uris && message.uris.length) { + object.uris = []; + for (var j = 0; j < message.uris.length; ++j) + object.uris[j] = message.uris[j]; + } + if (message.siteToSiteDataTransfer != null && message.hasOwnProperty("siteToSiteDataTransfer")) + object.siteToSiteDataTransfer = message.siteToSiteDataTransfer; + if (message.vpcNetwork != null && message.hasOwnProperty("vpcNetwork")) + object.vpcNetwork = message.vpcNetwork; + return object; + }; + + /** + * Converts this LinkedVpnTunnels to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.LinkedVpnTunnels + * @instance + * @returns {Object.} JSON object + */ + LinkedVpnTunnels.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LinkedVpnTunnels + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.LinkedVpnTunnels + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LinkedVpnTunnels.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.LinkedVpnTunnels"; + }; + + return LinkedVpnTunnels; + })(); + + v1.LinkedInterconnectAttachments = (function() { + + /** + * Properties of a LinkedInterconnectAttachments. + * @memberof google.cloud.networkconnectivity.v1 + * @interface ILinkedInterconnectAttachments + * @property {Array.|null} [uris] LinkedInterconnectAttachments uris + * @property {boolean|null} [siteToSiteDataTransfer] LinkedInterconnectAttachments siteToSiteDataTransfer + * @property {string|null} [vpcNetwork] LinkedInterconnectAttachments vpcNetwork + */ + + /** + * Constructs a new LinkedInterconnectAttachments. + * @memberof google.cloud.networkconnectivity.v1 + * @classdesc Represents a LinkedInterconnectAttachments. + * @implements ILinkedInterconnectAttachments + * @constructor + * @param {google.cloud.networkconnectivity.v1.ILinkedInterconnectAttachments=} [properties] Properties to set + */ + function LinkedInterconnectAttachments(properties) { + this.uris = []; + 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]]; + } + + /** + * LinkedInterconnectAttachments uris. + * @member {Array.} uris + * @memberof google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + * @instance + */ + LinkedInterconnectAttachments.prototype.uris = $util.emptyArray; + + /** + * LinkedInterconnectAttachments siteToSiteDataTransfer. + * @member {boolean} siteToSiteDataTransfer + * @memberof google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + * @instance + */ + LinkedInterconnectAttachments.prototype.siteToSiteDataTransfer = false; + + /** + * LinkedInterconnectAttachments vpcNetwork. + * @member {string} vpcNetwork + * @memberof google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + * @instance + */ + LinkedInterconnectAttachments.prototype.vpcNetwork = ""; + + /** + * Creates a new LinkedInterconnectAttachments instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + * @static + * @param {google.cloud.networkconnectivity.v1.ILinkedInterconnectAttachments=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments} LinkedInterconnectAttachments instance + */ + LinkedInterconnectAttachments.create = function create(properties) { + return new LinkedInterconnectAttachments(properties); + }; + + /** + * Encodes the specified LinkedInterconnectAttachments message. Does not implicitly {@link google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + * @static + * @param {google.cloud.networkconnectivity.v1.ILinkedInterconnectAttachments} message LinkedInterconnectAttachments message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LinkedInterconnectAttachments.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uris != null && message.uris.length) + for (var i = 0; i < message.uris.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uris[i]); + if (message.siteToSiteDataTransfer != null && Object.hasOwnProperty.call(message, "siteToSiteDataTransfer")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.siteToSiteDataTransfer); + if (message.vpcNetwork != null && Object.hasOwnProperty.call(message, "vpcNetwork")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.vpcNetwork); + return writer; + }; + + /** + * Encodes the specified LinkedInterconnectAttachments message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + * @static + * @param {google.cloud.networkconnectivity.v1.ILinkedInterconnectAttachments} message LinkedInterconnectAttachments message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LinkedInterconnectAttachments.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LinkedInterconnectAttachments message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + * @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.LinkedInterconnectAttachments} LinkedInterconnectAttachments + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LinkedInterconnectAttachments.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.LinkedInterconnectAttachments(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.uris && message.uris.length)) + message.uris = []; + message.uris.push(reader.string()); + break; + } + case 2: { + message.siteToSiteDataTransfer = reader.bool(); + break; + } + case 3: { + message.vpcNetwork = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LinkedInterconnectAttachments message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments} LinkedInterconnectAttachments + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LinkedInterconnectAttachments.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LinkedInterconnectAttachments message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LinkedInterconnectAttachments.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uris != null && message.hasOwnProperty("uris")) { + if (!Array.isArray(message.uris)) + return "uris: array expected"; + for (var i = 0; i < message.uris.length; ++i) + if (!$util.isString(message.uris[i])) + return "uris: string[] expected"; + } + if (message.siteToSiteDataTransfer != null && message.hasOwnProperty("siteToSiteDataTransfer")) + if (typeof message.siteToSiteDataTransfer !== "boolean") + return "siteToSiteDataTransfer: boolean expected"; + if (message.vpcNetwork != null && message.hasOwnProperty("vpcNetwork")) + if (!$util.isString(message.vpcNetwork)) + return "vpcNetwork: string expected"; + return null; + }; + + /** + * Creates a LinkedInterconnectAttachments message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments} LinkedInterconnectAttachments + */ + LinkedInterconnectAttachments.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments(); + if (object.uris) { + if (!Array.isArray(object.uris)) + throw TypeError(".google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments.uris: array expected"); + message.uris = []; + for (var i = 0; i < object.uris.length; ++i) + message.uris[i] = String(object.uris[i]); + } + if (object.siteToSiteDataTransfer != null) + message.siteToSiteDataTransfer = Boolean(object.siteToSiteDataTransfer); + if (object.vpcNetwork != null) + message.vpcNetwork = String(object.vpcNetwork); + return message; + }; + + /** + * Creates a plain object from a LinkedInterconnectAttachments message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + * @static + * @param {google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments} message LinkedInterconnectAttachments + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LinkedInterconnectAttachments.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uris = []; + if (options.defaults) { + object.siteToSiteDataTransfer = false; + object.vpcNetwork = ""; + } + if (message.uris && message.uris.length) { + object.uris = []; + for (var j = 0; j < message.uris.length; ++j) + object.uris[j] = message.uris[j]; + } + if (message.siteToSiteDataTransfer != null && message.hasOwnProperty("siteToSiteDataTransfer")) + object.siteToSiteDataTransfer = message.siteToSiteDataTransfer; + if (message.vpcNetwork != null && message.hasOwnProperty("vpcNetwork")) + object.vpcNetwork = message.vpcNetwork; + return object; + }; + + /** + * Converts this LinkedInterconnectAttachments to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + * @instance + * @returns {Object.} JSON object + */ + LinkedInterconnectAttachments.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LinkedInterconnectAttachments + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LinkedInterconnectAttachments.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments"; + }; + + return LinkedInterconnectAttachments; + })(); + + v1.LinkedRouterApplianceInstances = (function() { + + /** + * Properties of a LinkedRouterApplianceInstances. + * @memberof google.cloud.networkconnectivity.v1 + * @interface ILinkedRouterApplianceInstances + * @property {Array.|null} [instances] LinkedRouterApplianceInstances instances + * @property {boolean|null} [siteToSiteDataTransfer] LinkedRouterApplianceInstances siteToSiteDataTransfer + * @property {string|null} [vpcNetwork] LinkedRouterApplianceInstances vpcNetwork + */ + + /** + * Constructs a new LinkedRouterApplianceInstances. + * @memberof google.cloud.networkconnectivity.v1 + * @classdesc Represents a LinkedRouterApplianceInstances. + * @implements ILinkedRouterApplianceInstances + * @constructor + * @param {google.cloud.networkconnectivity.v1.ILinkedRouterApplianceInstances=} [properties] Properties to set + */ + function LinkedRouterApplianceInstances(properties) { + this.instances = []; + 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]]; + } + + /** + * LinkedRouterApplianceInstances instances. + * @member {Array.} instances + * @memberof google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + * @instance + */ + LinkedRouterApplianceInstances.prototype.instances = $util.emptyArray; + + /** + * LinkedRouterApplianceInstances siteToSiteDataTransfer. + * @member {boolean} siteToSiteDataTransfer + * @memberof google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + * @instance + */ + LinkedRouterApplianceInstances.prototype.siteToSiteDataTransfer = false; + + /** + * LinkedRouterApplianceInstances vpcNetwork. + * @member {string} vpcNetwork + * @memberof google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + * @instance + */ + LinkedRouterApplianceInstances.prototype.vpcNetwork = ""; + + /** + * Creates a new LinkedRouterApplianceInstances instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + * @static + * @param {google.cloud.networkconnectivity.v1.ILinkedRouterApplianceInstances=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances} LinkedRouterApplianceInstances instance + */ + LinkedRouterApplianceInstances.create = function create(properties) { + return new LinkedRouterApplianceInstances(properties); + }; + + /** + * Encodes the specified LinkedRouterApplianceInstances message. Does not implicitly {@link google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + * @static + * @param {google.cloud.networkconnectivity.v1.ILinkedRouterApplianceInstances} message LinkedRouterApplianceInstances message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LinkedRouterApplianceInstances.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.cloud.networkconnectivity.v1.RouterApplianceInstance.encode(message.instances[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.siteToSiteDataTransfer != null && Object.hasOwnProperty.call(message, "siteToSiteDataTransfer")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.siteToSiteDataTransfer); + if (message.vpcNetwork != null && Object.hasOwnProperty.call(message, "vpcNetwork")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.vpcNetwork); + return writer; + }; + + /** + * Encodes the specified LinkedRouterApplianceInstances message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + * @static + * @param {google.cloud.networkconnectivity.v1.ILinkedRouterApplianceInstances} message LinkedRouterApplianceInstances message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LinkedRouterApplianceInstances.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LinkedRouterApplianceInstances message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + * @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.LinkedRouterApplianceInstances} LinkedRouterApplianceInstances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LinkedRouterApplianceInstances.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.LinkedRouterApplianceInstances(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.networkconnectivity.v1.RouterApplianceInstance.decode(reader, reader.uint32())); + break; + } + case 2: { + message.siteToSiteDataTransfer = reader.bool(); + break; + } + case 3: { + message.vpcNetwork = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LinkedRouterApplianceInstances message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances} LinkedRouterApplianceInstances + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LinkedRouterApplianceInstances.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LinkedRouterApplianceInstances message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LinkedRouterApplianceInstances.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.cloud.networkconnectivity.v1.RouterApplianceInstance.verify(message.instances[i]); + if (error) + return "instances." + error; + } + } + if (message.siteToSiteDataTransfer != null && message.hasOwnProperty("siteToSiteDataTransfer")) + if (typeof message.siteToSiteDataTransfer !== "boolean") + return "siteToSiteDataTransfer: boolean expected"; + if (message.vpcNetwork != null && message.hasOwnProperty("vpcNetwork")) + if (!$util.isString(message.vpcNetwork)) + return "vpcNetwork: string expected"; + return null; + }; + + /** + * Creates a LinkedRouterApplianceInstances message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances} LinkedRouterApplianceInstances + */ + LinkedRouterApplianceInstances.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances.instances: object expected"); + message.instances[i] = $root.google.cloud.networkconnectivity.v1.RouterApplianceInstance.fromObject(object.instances[i]); + } + } + if (object.siteToSiteDataTransfer != null) + message.siteToSiteDataTransfer = Boolean(object.siteToSiteDataTransfer); + if (object.vpcNetwork != null) + message.vpcNetwork = String(object.vpcNetwork); + return message; + }; + + /** + * Creates a plain object from a LinkedRouterApplianceInstances message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + * @static + * @param {google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances} message LinkedRouterApplianceInstances + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LinkedRouterApplianceInstances.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.instances = []; + if (options.defaults) { + object.siteToSiteDataTransfer = false; + object.vpcNetwork = ""; + } + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.networkconnectivity.v1.RouterApplianceInstance.toObject(message.instances[j], options); + } + if (message.siteToSiteDataTransfer != null && message.hasOwnProperty("siteToSiteDataTransfer")) + object.siteToSiteDataTransfer = message.siteToSiteDataTransfer; + if (message.vpcNetwork != null && message.hasOwnProperty("vpcNetwork")) + object.vpcNetwork = message.vpcNetwork; + return object; + }; + + /** + * Converts this LinkedRouterApplianceInstances to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + * @instance + * @returns {Object.} JSON object + */ + LinkedRouterApplianceInstances.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LinkedRouterApplianceInstances + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LinkedRouterApplianceInstances.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances"; + }; + + return LinkedRouterApplianceInstances; + })(); + + v1.LinkedVpcNetwork = (function() { + + /** + * Properties of a LinkedVpcNetwork. + * @memberof google.cloud.networkconnectivity.v1 + * @interface ILinkedVpcNetwork + * @property {string|null} [uri] LinkedVpcNetwork uri + * @property {Array.|null} [excludeExportRanges] LinkedVpcNetwork excludeExportRanges + */ + + /** + * Constructs a new LinkedVpcNetwork. + * @memberof google.cloud.networkconnectivity.v1 + * @classdesc Represents a LinkedVpcNetwork. + * @implements ILinkedVpcNetwork + * @constructor + * @param {google.cloud.networkconnectivity.v1.ILinkedVpcNetwork=} [properties] Properties to set + */ + function LinkedVpcNetwork(properties) { + this.excludeExportRanges = []; + 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]]; + } + + /** + * LinkedVpcNetwork uri. + * @member {string} uri + * @memberof google.cloud.networkconnectivity.v1.LinkedVpcNetwork + * @instance + */ + LinkedVpcNetwork.prototype.uri = ""; + + /** + * LinkedVpcNetwork excludeExportRanges. + * @member {Array.} excludeExportRanges + * @memberof google.cloud.networkconnectivity.v1.LinkedVpcNetwork + * @instance + */ + LinkedVpcNetwork.prototype.excludeExportRanges = $util.emptyArray; + + /** + * Creates a new LinkedVpcNetwork instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.LinkedVpcNetwork + * @static + * @param {google.cloud.networkconnectivity.v1.ILinkedVpcNetwork=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.LinkedVpcNetwork} LinkedVpcNetwork instance + */ + LinkedVpcNetwork.create = function create(properties) { + return new LinkedVpcNetwork(properties); + }; + + /** + * Encodes the specified LinkedVpcNetwork message. Does not implicitly {@link google.cloud.networkconnectivity.v1.LinkedVpcNetwork.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkconnectivity.v1.LinkedVpcNetwork + * @static + * @param {google.cloud.networkconnectivity.v1.ILinkedVpcNetwork} message LinkedVpcNetwork message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LinkedVpcNetwork.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.excludeExportRanges != null && message.excludeExportRanges.length) + for (var i = 0; i < message.excludeExportRanges.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.excludeExportRanges[i]); + return writer; + }; + + /** + * Encodes the specified LinkedVpcNetwork message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.LinkedVpcNetwork.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkconnectivity.v1.LinkedVpcNetwork + * @static + * @param {google.cloud.networkconnectivity.v1.ILinkedVpcNetwork} message LinkedVpcNetwork message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LinkedVpcNetwork.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LinkedVpcNetwork message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkconnectivity.v1.LinkedVpcNetwork + * @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.LinkedVpcNetwork} LinkedVpcNetwork + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LinkedVpcNetwork.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.LinkedVpcNetwork(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + case 2: { + if (!(message.excludeExportRanges && message.excludeExportRanges.length)) + message.excludeExportRanges = []; + message.excludeExportRanges.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LinkedVpcNetwork message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.LinkedVpcNetwork + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.LinkedVpcNetwork} LinkedVpcNetwork + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LinkedVpcNetwork.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LinkedVpcNetwork message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.LinkedVpcNetwork + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LinkedVpcNetwork.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.excludeExportRanges != null && message.hasOwnProperty("excludeExportRanges")) { + if (!Array.isArray(message.excludeExportRanges)) + return "excludeExportRanges: array expected"; + for (var i = 0; i < message.excludeExportRanges.length; ++i) + if (!$util.isString(message.excludeExportRanges[i])) + return "excludeExportRanges: string[] expected"; + } + return null; + }; + + /** + * Creates a LinkedVpcNetwork message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.LinkedVpcNetwork + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.LinkedVpcNetwork} LinkedVpcNetwork + */ + LinkedVpcNetwork.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.LinkedVpcNetwork) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.LinkedVpcNetwork(); + if (object.uri != null) + message.uri = String(object.uri); + if (object.excludeExportRanges) { + if (!Array.isArray(object.excludeExportRanges)) + throw TypeError(".google.cloud.networkconnectivity.v1.LinkedVpcNetwork.excludeExportRanges: array expected"); + message.excludeExportRanges = []; + for (var i = 0; i < object.excludeExportRanges.length; ++i) + message.excludeExportRanges[i] = String(object.excludeExportRanges[i]); + } + return message; + }; + + /** + * Creates a plain object from a LinkedVpcNetwork message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.LinkedVpcNetwork + * @static + * @param {google.cloud.networkconnectivity.v1.LinkedVpcNetwork} message LinkedVpcNetwork + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LinkedVpcNetwork.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.excludeExportRanges = []; + if (options.defaults) + object.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.excludeExportRanges && message.excludeExportRanges.length) { + object.excludeExportRanges = []; + for (var j = 0; j < message.excludeExportRanges.length; ++j) + object.excludeExportRanges[j] = message.excludeExportRanges[j]; + } + return object; + }; + + /** + * Converts this LinkedVpcNetwork to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.LinkedVpcNetwork + * @instance + * @returns {Object.} JSON object + */ + LinkedVpcNetwork.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for LinkedVpcNetwork + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.LinkedVpcNetwork + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LinkedVpcNetwork.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.LinkedVpcNetwork"; + }; + + return LinkedVpcNetwork; + })(); + + v1.RouterApplianceInstance = (function() { + + /** + * Properties of a RouterApplianceInstance. + * @memberof google.cloud.networkconnectivity.v1 + * @interface IRouterApplianceInstance + * @property {string|null} [virtualMachine] RouterApplianceInstance virtualMachine + * @property {string|null} [ipAddress] RouterApplianceInstance ipAddress + */ + + /** + * Constructs a new RouterApplianceInstance. + * @memberof google.cloud.networkconnectivity.v1 + * @classdesc Represents a RouterApplianceInstance. + * @implements IRouterApplianceInstance + * @constructor + * @param {google.cloud.networkconnectivity.v1.IRouterApplianceInstance=} [properties] Properties to set + */ + function RouterApplianceInstance(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]]; + } + + /** + * RouterApplianceInstance virtualMachine. + * @member {string} virtualMachine + * @memberof google.cloud.networkconnectivity.v1.RouterApplianceInstance + * @instance + */ + RouterApplianceInstance.prototype.virtualMachine = ""; + + /** + * RouterApplianceInstance ipAddress. + * @member {string} ipAddress + * @memberof google.cloud.networkconnectivity.v1.RouterApplianceInstance + * @instance + */ + RouterApplianceInstance.prototype.ipAddress = ""; + + /** + * Creates a new RouterApplianceInstance instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.RouterApplianceInstance + * @static + * @param {google.cloud.networkconnectivity.v1.IRouterApplianceInstance=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.RouterApplianceInstance} RouterApplianceInstance instance + */ + RouterApplianceInstance.create = function create(properties) { + return new RouterApplianceInstance(properties); + }; + + /** + * Encodes the specified RouterApplianceInstance message. Does not implicitly {@link google.cloud.networkconnectivity.v1.RouterApplianceInstance.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkconnectivity.v1.RouterApplianceInstance + * @static + * @param {google.cloud.networkconnectivity.v1.IRouterApplianceInstance} message RouterApplianceInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouterApplianceInstance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.virtualMachine != null && Object.hasOwnProperty.call(message, "virtualMachine")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.virtualMachine); + if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.ipAddress); + return writer; + }; + + /** + * Encodes the specified RouterApplianceInstance message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.RouterApplianceInstance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkconnectivity.v1.RouterApplianceInstance + * @static + * @param {google.cloud.networkconnectivity.v1.IRouterApplianceInstance} message RouterApplianceInstance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RouterApplianceInstance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RouterApplianceInstance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkconnectivity.v1.RouterApplianceInstance + * @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.RouterApplianceInstance} RouterApplianceInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouterApplianceInstance.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.RouterApplianceInstance(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.virtualMachine = reader.string(); + break; + } + case 3: { + message.ipAddress = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RouterApplianceInstance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.RouterApplianceInstance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.RouterApplianceInstance} RouterApplianceInstance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RouterApplianceInstance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RouterApplianceInstance message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.RouterApplianceInstance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RouterApplianceInstance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.virtualMachine != null && message.hasOwnProperty("virtualMachine")) + if (!$util.isString(message.virtualMachine)) + return "virtualMachine: string expected"; + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + if (!$util.isString(message.ipAddress)) + return "ipAddress: string expected"; + return null; + }; + + /** + * Creates a RouterApplianceInstance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.RouterApplianceInstance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.RouterApplianceInstance} RouterApplianceInstance + */ + RouterApplianceInstance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.RouterApplianceInstance) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.RouterApplianceInstance(); + if (object.virtualMachine != null) + message.virtualMachine = String(object.virtualMachine); + if (object.ipAddress != null) + message.ipAddress = String(object.ipAddress); + return message; + }; + + /** + * Creates a plain object from a RouterApplianceInstance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.RouterApplianceInstance + * @static + * @param {google.cloud.networkconnectivity.v1.RouterApplianceInstance} message RouterApplianceInstance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RouterApplianceInstance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.virtualMachine = ""; + object.ipAddress = ""; + } + if (message.virtualMachine != null && message.hasOwnProperty("virtualMachine")) + object.virtualMachine = message.virtualMachine; + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) + object.ipAddress = message.ipAddress; + return object; + }; + + /** + * Converts this RouterApplianceInstance to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.RouterApplianceInstance + * @instance + * @returns {Object.} JSON object + */ + RouterApplianceInstance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RouterApplianceInstance + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.RouterApplianceInstance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RouterApplianceInstance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.RouterApplianceInstance"; + }; + + 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: + if (typeof object.locationFeatures[i] === "number") { + message.locationFeatures[i] = object.locationFeatures[i]; + break; + } + 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]] === undefined ? message.locationFeatures[j] : $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); + }; + + /** + * Gets the default type url for LocationMetadata + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.LocationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + LocationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.LocationMetadata"; + }; + + return LocationMetadata; + })(); + + v1.NextHopVpcNetwork = (function() { + + /** + * Properties of a NextHopVpcNetwork. + * @memberof google.cloud.networkconnectivity.v1 + * @interface INextHopVpcNetwork + * @property {string|null} [uri] NextHopVpcNetwork uri + */ + + /** + * Constructs a new NextHopVpcNetwork. + * @memberof google.cloud.networkconnectivity.v1 + * @classdesc Represents a NextHopVpcNetwork. + * @implements INextHopVpcNetwork + * @constructor + * @param {google.cloud.networkconnectivity.v1.INextHopVpcNetwork=} [properties] Properties to set + */ + function NextHopVpcNetwork(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]]; + } + + /** + * NextHopVpcNetwork uri. + * @member {string} uri + * @memberof google.cloud.networkconnectivity.v1.NextHopVpcNetwork + * @instance + */ + NextHopVpcNetwork.prototype.uri = ""; + + /** + * Creates a new NextHopVpcNetwork instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.NextHopVpcNetwork + * @static + * @param {google.cloud.networkconnectivity.v1.INextHopVpcNetwork=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.NextHopVpcNetwork} NextHopVpcNetwork instance + */ + NextHopVpcNetwork.create = function create(properties) { + return new NextHopVpcNetwork(properties); + }; + + /** + * Encodes the specified NextHopVpcNetwork message. Does not implicitly {@link google.cloud.networkconnectivity.v1.NextHopVpcNetwork.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkconnectivity.v1.NextHopVpcNetwork + * @static + * @param {google.cloud.networkconnectivity.v1.INextHopVpcNetwork} message NextHopVpcNetwork message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NextHopVpcNetwork.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + return writer; + }; + + /** + * Encodes the specified NextHopVpcNetwork message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.NextHopVpcNetwork.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkconnectivity.v1.NextHopVpcNetwork + * @static + * @param {google.cloud.networkconnectivity.v1.INextHopVpcNetwork} message NextHopVpcNetwork message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NextHopVpcNetwork.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NextHopVpcNetwork message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkconnectivity.v1.NextHopVpcNetwork + * @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.NextHopVpcNetwork} NextHopVpcNetwork + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NextHopVpcNetwork.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.NextHopVpcNetwork(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.uri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NextHopVpcNetwork message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.NextHopVpcNetwork + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.NextHopVpcNetwork} NextHopVpcNetwork + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NextHopVpcNetwork.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NextHopVpcNetwork message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.NextHopVpcNetwork + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NextHopVpcNetwork.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + return null; + }; + + /** + * Creates a NextHopVpcNetwork message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.NextHopVpcNetwork + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.NextHopVpcNetwork} NextHopVpcNetwork + */ + NextHopVpcNetwork.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.NextHopVpcNetwork) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.NextHopVpcNetwork(); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a NextHopVpcNetwork message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.NextHopVpcNetwork + * @static + * @param {google.cloud.networkconnectivity.v1.NextHopVpcNetwork} message NextHopVpcNetwork + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NextHopVpcNetwork.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this NextHopVpcNetwork to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.NextHopVpcNetwork + * @instance + * @returns {Object.} JSON object + */ + NextHopVpcNetwork.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NextHopVpcNetwork + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.NextHopVpcNetwork + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NextHopVpcNetwork.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.NextHopVpcNetwork"; + }; + + return NextHopVpcNetwork; + })(); + + v1.SpokeSummary = (function() { + + /** + * Properties of a SpokeSummary. + * @memberof google.cloud.networkconnectivity.v1 + * @interface ISpokeSummary + * @property {Array.|null} [spokeTypeCounts] SpokeSummary spokeTypeCounts + * @property {Array.|null} [spokeStateCounts] SpokeSummary spokeStateCounts + * @property {Array.|null} [spokeStateReasonCounts] SpokeSummary spokeStateReasonCounts + */ + + /** + * Constructs a new SpokeSummary. + * @memberof google.cloud.networkconnectivity.v1 + * @classdesc Represents a SpokeSummary. + * @implements ISpokeSummary + * @constructor + * @param {google.cloud.networkconnectivity.v1.ISpokeSummary=} [properties] Properties to set + */ + function SpokeSummary(properties) { + this.spokeTypeCounts = []; + this.spokeStateCounts = []; + this.spokeStateReasonCounts = []; + 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]]; + } + + /** + * SpokeSummary spokeTypeCounts. + * @member {Array.} spokeTypeCounts + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary + * @instance + */ + SpokeSummary.prototype.spokeTypeCounts = $util.emptyArray; + + /** + * SpokeSummary spokeStateCounts. + * @member {Array.} spokeStateCounts + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary + * @instance + */ + SpokeSummary.prototype.spokeStateCounts = $util.emptyArray; + + /** + * SpokeSummary spokeStateReasonCounts. + * @member {Array.} spokeStateReasonCounts + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary + * @instance + */ + SpokeSummary.prototype.spokeStateReasonCounts = $util.emptyArray; + + /** + * Creates a new SpokeSummary instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary + * @static + * @param {google.cloud.networkconnectivity.v1.ISpokeSummary=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.SpokeSummary} SpokeSummary instance + */ + SpokeSummary.create = function create(properties) { + return new SpokeSummary(properties); + }; + + /** + * Encodes the specified SpokeSummary message. Does not implicitly {@link google.cloud.networkconnectivity.v1.SpokeSummary.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary + * @static + * @param {google.cloud.networkconnectivity.v1.ISpokeSummary} message SpokeSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpokeSummary.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.spokeTypeCounts != null && message.spokeTypeCounts.length) + for (var i = 0; i < message.spokeTypeCounts.length; ++i) + $root.google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount.encode(message.spokeTypeCounts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.spokeStateCounts != null && message.spokeStateCounts.length) + for (var i = 0; i < message.spokeStateCounts.length; ++i) + $root.google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount.encode(message.spokeStateCounts[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.spokeStateReasonCounts != null && message.spokeStateReasonCounts.length) + for (var i = 0; i < message.spokeStateReasonCounts.length; ++i) + $root.google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount.encode(message.spokeStateReasonCounts[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SpokeSummary message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.SpokeSummary.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary + * @static + * @param {google.cloud.networkconnectivity.v1.ISpokeSummary} message SpokeSummary message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpokeSummary.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpokeSummary message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary + * @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.SpokeSummary} SpokeSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpokeSummary.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.SpokeSummary(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.spokeTypeCounts && message.spokeTypeCounts.length)) + message.spokeTypeCounts = []; + message.spokeTypeCounts.push($root.google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.spokeStateCounts && message.spokeStateCounts.length)) + message.spokeStateCounts = []; + message.spokeStateCounts.push($root.google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount.decode(reader, reader.uint32())); + break; + } + case 3: { + if (!(message.spokeStateReasonCounts && message.spokeStateReasonCounts.length)) + message.spokeStateReasonCounts = []; + message.spokeStateReasonCounts.push($root.google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpokeSummary message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.SpokeSummary} SpokeSummary + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpokeSummary.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpokeSummary message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpokeSummary.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.spokeTypeCounts != null && message.hasOwnProperty("spokeTypeCounts")) { + if (!Array.isArray(message.spokeTypeCounts)) + return "spokeTypeCounts: array expected"; + for (var i = 0; i < message.spokeTypeCounts.length; ++i) { + var error = $root.google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount.verify(message.spokeTypeCounts[i]); + if (error) + return "spokeTypeCounts." + error; + } + } + if (message.spokeStateCounts != null && message.hasOwnProperty("spokeStateCounts")) { + if (!Array.isArray(message.spokeStateCounts)) + return "spokeStateCounts: array expected"; + for (var i = 0; i < message.spokeStateCounts.length; ++i) { + var error = $root.google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount.verify(message.spokeStateCounts[i]); + if (error) + return "spokeStateCounts." + error; + } + } + if (message.spokeStateReasonCounts != null && message.hasOwnProperty("spokeStateReasonCounts")) { + if (!Array.isArray(message.spokeStateReasonCounts)) + return "spokeStateReasonCounts: array expected"; + for (var i = 0; i < message.spokeStateReasonCounts.length; ++i) { + var error = $root.google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount.verify(message.spokeStateReasonCounts[i]); + if (error) + return "spokeStateReasonCounts." + error; + } + } + return null; + }; + + /** + * Creates a SpokeSummary message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.SpokeSummary} SpokeSummary + */ + SpokeSummary.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.SpokeSummary) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.SpokeSummary(); + if (object.spokeTypeCounts) { + if (!Array.isArray(object.spokeTypeCounts)) + throw TypeError(".google.cloud.networkconnectivity.v1.SpokeSummary.spokeTypeCounts: array expected"); + message.spokeTypeCounts = []; + for (var i = 0; i < object.spokeTypeCounts.length; ++i) { + if (typeof object.spokeTypeCounts[i] !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.SpokeSummary.spokeTypeCounts: object expected"); + message.spokeTypeCounts[i] = $root.google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount.fromObject(object.spokeTypeCounts[i]); + } + } + if (object.spokeStateCounts) { + if (!Array.isArray(object.spokeStateCounts)) + throw TypeError(".google.cloud.networkconnectivity.v1.SpokeSummary.spokeStateCounts: array expected"); + message.spokeStateCounts = []; + for (var i = 0; i < object.spokeStateCounts.length; ++i) { + if (typeof object.spokeStateCounts[i] !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.SpokeSummary.spokeStateCounts: object expected"); + message.spokeStateCounts[i] = $root.google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount.fromObject(object.spokeStateCounts[i]); + } + } + if (object.spokeStateReasonCounts) { + if (!Array.isArray(object.spokeStateReasonCounts)) + throw TypeError(".google.cloud.networkconnectivity.v1.SpokeSummary.spokeStateReasonCounts: array expected"); + message.spokeStateReasonCounts = []; + for (var i = 0; i < object.spokeStateReasonCounts.length; ++i) { + if (typeof object.spokeStateReasonCounts[i] !== "object") + throw TypeError(".google.cloud.networkconnectivity.v1.SpokeSummary.spokeStateReasonCounts: object expected"); + message.spokeStateReasonCounts[i] = $root.google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount.fromObject(object.spokeStateReasonCounts[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SpokeSummary message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary + * @static + * @param {google.cloud.networkconnectivity.v1.SpokeSummary} message SpokeSummary + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpokeSummary.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.spokeTypeCounts = []; + object.spokeStateCounts = []; + object.spokeStateReasonCounts = []; + } + if (message.spokeTypeCounts && message.spokeTypeCounts.length) { + object.spokeTypeCounts = []; + for (var j = 0; j < message.spokeTypeCounts.length; ++j) + object.spokeTypeCounts[j] = $root.google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount.toObject(message.spokeTypeCounts[j], options); + } + if (message.spokeStateCounts && message.spokeStateCounts.length) { + object.spokeStateCounts = []; + for (var j = 0; j < message.spokeStateCounts.length; ++j) + object.spokeStateCounts[j] = $root.google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount.toObject(message.spokeStateCounts[j], options); + } + if (message.spokeStateReasonCounts && message.spokeStateReasonCounts.length) { + object.spokeStateReasonCounts = []; + for (var j = 0; j < message.spokeStateReasonCounts.length; ++j) + object.spokeStateReasonCounts[j] = $root.google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount.toObject(message.spokeStateReasonCounts[j], options); + } + return object; + }; + + /** + * Converts this SpokeSummary to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary + * @instance + * @returns {Object.} JSON object + */ + SpokeSummary.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpokeSummary + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpokeSummary.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.SpokeSummary"; + }; + + SpokeSummary.SpokeTypeCount = (function() { + + /** + * Properties of a SpokeTypeCount. + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary + * @interface ISpokeTypeCount + * @property {google.cloud.networkconnectivity.v1.SpokeType|null} [spokeType] SpokeTypeCount spokeType + * @property {number|Long|null} [count] SpokeTypeCount count + */ + + /** + * Constructs a new SpokeTypeCount. + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary + * @classdesc Represents a SpokeTypeCount. + * @implements ISpokeTypeCount + * @constructor + * @param {google.cloud.networkconnectivity.v1.SpokeSummary.ISpokeTypeCount=} [properties] Properties to set + */ + function SpokeTypeCount(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]]; + } + + /** + * SpokeTypeCount spokeType. + * @member {google.cloud.networkconnectivity.v1.SpokeType} spokeType + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount + * @instance + */ + SpokeTypeCount.prototype.spokeType = 0; + + /** + * SpokeTypeCount count. + * @member {number|Long} count + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount + * @instance + */ + SpokeTypeCount.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new SpokeTypeCount instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount + * @static + * @param {google.cloud.networkconnectivity.v1.SpokeSummary.ISpokeTypeCount=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount} SpokeTypeCount instance + */ + SpokeTypeCount.create = function create(properties) { + return new SpokeTypeCount(properties); + }; + + /** + * Encodes the specified SpokeTypeCount message. Does not implicitly {@link google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount + * @static + * @param {google.cloud.networkconnectivity.v1.SpokeSummary.ISpokeTypeCount} message SpokeTypeCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpokeTypeCount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.spokeType != null && Object.hasOwnProperty.call(message, "spokeType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.spokeType); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); + return writer; + }; + + /** + * Encodes the specified SpokeTypeCount message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount + * @static + * @param {google.cloud.networkconnectivity.v1.SpokeSummary.ISpokeTypeCount} message SpokeTypeCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpokeTypeCount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpokeTypeCount message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount + * @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.SpokeSummary.SpokeTypeCount} SpokeTypeCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpokeTypeCount.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.SpokeSummary.SpokeTypeCount(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.spokeType = reader.int32(); + break; + } + case 2: { + message.count = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpokeTypeCount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount} SpokeTypeCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpokeTypeCount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpokeTypeCount message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpokeTypeCount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.spokeType != null && message.hasOwnProperty("spokeType")) + switch (message.spokeType) { + default: + return "spokeType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + return null; + }; + + /** + * Creates a SpokeTypeCount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount} SpokeTypeCount + */ + SpokeTypeCount.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount(); + switch (object.spokeType) { + default: + if (typeof object.spokeType === "number") { + message.spokeType = object.spokeType; + break; + } + break; + case "SPOKE_TYPE_UNSPECIFIED": + case 0: + message.spokeType = 0; + break; + case "VPN_TUNNEL": + case 1: + message.spokeType = 1; + break; + case "INTERCONNECT_ATTACHMENT": + case 2: + message.spokeType = 2; + break; + case "ROUTER_APPLIANCE": + case 3: + message.spokeType = 3; + break; + case "VPC_NETWORK": + case 4: + message.spokeType = 4; + break; + } + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a SpokeTypeCount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount + * @static + * @param {google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount} message SpokeTypeCount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpokeTypeCount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.spokeType = options.enums === String ? "SPOKE_TYPE_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + } + if (message.spokeType != null && message.hasOwnProperty("spokeType")) + object.spokeType = options.enums === String ? $root.google.cloud.networkconnectivity.v1.SpokeType[message.spokeType] === undefined ? message.spokeType : $root.google.cloud.networkconnectivity.v1.SpokeType[message.spokeType] : message.spokeType; + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + return object; + }; + + /** + * Converts this SpokeTypeCount to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount + * @instance + * @returns {Object.} JSON object + */ + SpokeTypeCount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpokeTypeCount + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpokeTypeCount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeTypeCount"; + }; + + return SpokeTypeCount; + })(); + + SpokeSummary.SpokeStateCount = (function() { + + /** + * Properties of a SpokeStateCount. + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary + * @interface ISpokeStateCount + * @property {google.cloud.networkconnectivity.v1.State|null} [state] SpokeStateCount state + * @property {number|Long|null} [count] SpokeStateCount count + */ + + /** + * Constructs a new SpokeStateCount. + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary + * @classdesc Represents a SpokeStateCount. + * @implements ISpokeStateCount + * @constructor + * @param {google.cloud.networkconnectivity.v1.SpokeSummary.ISpokeStateCount=} [properties] Properties to set + */ + function SpokeStateCount(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]]; + } + + /** + * SpokeStateCount state. + * @member {google.cloud.networkconnectivity.v1.State} state + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount + * @instance + */ + SpokeStateCount.prototype.state = 0; + + /** + * SpokeStateCount count. + * @member {number|Long} count + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount + * @instance + */ + SpokeStateCount.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new SpokeStateCount instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount + * @static + * @param {google.cloud.networkconnectivity.v1.SpokeSummary.ISpokeStateCount=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount} SpokeStateCount instance + */ + SpokeStateCount.create = function create(properties) { + return new SpokeStateCount(properties); + }; + + /** + * Encodes the specified SpokeStateCount message. Does not implicitly {@link google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount + * @static + * @param {google.cloud.networkconnectivity.v1.SpokeSummary.ISpokeStateCount} message SpokeStateCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpokeStateCount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); + return writer; + }; + + /** + * Encodes the specified SpokeStateCount message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount + * @static + * @param {google.cloud.networkconnectivity.v1.SpokeSummary.ISpokeStateCount} message SpokeStateCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpokeStateCount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpokeStateCount message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount + * @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.SpokeSummary.SpokeStateCount} SpokeStateCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpokeStateCount.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.SpokeSummary.SpokeStateCount(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.state = reader.int32(); + break; + } + case 2: { + message.count = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpokeStateCount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount} SpokeStateCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpokeStateCount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpokeStateCount message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpokeStateCount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 8: + case 9: + case 6: + case 7: + case 10: + break; + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + return null; + }; + + /** + * Creates a SpokeStateCount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount} SpokeStateCount + */ + SpokeStateCount.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount(); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + case "ACCEPTING": + case 8: + message.state = 8; + break; + case "REJECTING": + case 9: + message.state = 9; + break; + case "UPDATING": + case 6: + message.state = 6; + break; + case "INACTIVE": + case 7: + message.state = 7; + break; + case "OBSOLETE": + case 10: + message.state = 10; + break; + } + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a SpokeStateCount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount + * @static + * @param {google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount} message SpokeStateCount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpokeStateCount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.networkconnectivity.v1.State[message.state] === undefined ? message.state : $root.google.cloud.networkconnectivity.v1.State[message.state] : message.state; + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; + return object; + }; + + /** + * Converts this SpokeStateCount to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount + * @instance + * @returns {Object.} JSON object + */ + SpokeStateCount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SpokeStateCount + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpokeStateCount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateCount"; + }; + + return SpokeStateCount; + })(); + + SpokeSummary.SpokeStateReasonCount = (function() { + + /** + * Properties of a SpokeStateReasonCount. + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary + * @interface ISpokeStateReasonCount + * @property {google.cloud.networkconnectivity.v1.Spoke.StateReason.Code|null} [stateReasonCode] SpokeStateReasonCount stateReasonCode + * @property {number|Long|null} [count] SpokeStateReasonCount count + */ + + /** + * Constructs a new SpokeStateReasonCount. + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary + * @classdesc Represents a SpokeStateReasonCount. + * @implements ISpokeStateReasonCount + * @constructor + * @param {google.cloud.networkconnectivity.v1.SpokeSummary.ISpokeStateReasonCount=} [properties] Properties to set + */ + function SpokeStateReasonCount(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]]; + } + + /** + * SpokeStateReasonCount stateReasonCode. + * @member {google.cloud.networkconnectivity.v1.Spoke.StateReason.Code} stateReasonCode + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount + * @instance + */ + SpokeStateReasonCount.prototype.stateReasonCode = 0; + + /** + * SpokeStateReasonCount count. + * @member {number|Long} count + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount + * @instance + */ + SpokeStateReasonCount.prototype.count = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new SpokeStateReasonCount instance using the specified properties. + * @function create + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount + * @static + * @param {google.cloud.networkconnectivity.v1.SpokeSummary.ISpokeStateReasonCount=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount} SpokeStateReasonCount instance + */ + SpokeStateReasonCount.create = function create(properties) { + return new SpokeStateReasonCount(properties); + }; + + /** + * Encodes the specified SpokeStateReasonCount message. Does not implicitly {@link google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount.verify|verify} messages. + * @function encode + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount + * @static + * @param {google.cloud.networkconnectivity.v1.SpokeSummary.ISpokeStateReasonCount} message SpokeStateReasonCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpokeStateReasonCount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stateReasonCode != null && Object.hasOwnProperty.call(message, "stateReasonCode")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.stateReasonCode); + if (message.count != null && Object.hasOwnProperty.call(message, "count")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.count); + return writer; + }; + + /** + * Encodes the specified SpokeStateReasonCount message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount + * @static + * @param {google.cloud.networkconnectivity.v1.SpokeSummary.ISpokeStateReasonCount} message SpokeStateReasonCount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpokeStateReasonCount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpokeStateReasonCount message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount + * @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.SpokeSummary.SpokeStateReasonCount} SpokeStateReasonCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpokeStateReasonCount.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.SpokeSummary.SpokeStateReasonCount(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.stateReasonCode = reader.int32(); + break; + } + case 2: { + message.count = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpokeStateReasonCount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount} SpokeStateReasonCount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpokeStateReasonCount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpokeStateReasonCount message. + * @function verify + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpokeStateReasonCount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stateReasonCode != null && message.hasOwnProperty("stateReasonCode")) + switch (message.stateReasonCode) { + default: + return "stateReasonCode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.count != null && message.hasOwnProperty("count")) + if (!$util.isInteger(message.count) && !(message.count && $util.isInteger(message.count.low) && $util.isInteger(message.count.high))) + return "count: integer|Long expected"; + return null; + }; + + /** + * Creates a SpokeStateReasonCount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount} SpokeStateReasonCount + */ + SpokeStateReasonCount.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount) + return object; + var message = new $root.google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount(); + switch (object.stateReasonCode) { + default: + if (typeof object.stateReasonCode === "number") { + message.stateReasonCode = object.stateReasonCode; + break; + } + break; + case "CODE_UNSPECIFIED": + case 0: + message.stateReasonCode = 0; + break; + case "PENDING_REVIEW": + case 1: + message.stateReasonCode = 1; + break; + case "REJECTED": + case 2: + message.stateReasonCode = 2; + break; + case "PAUSED": + case 3: + message.stateReasonCode = 3; + break; + case "FAILED": + case 4: + message.stateReasonCode = 4; + break; + } + if (object.count != null) + if ($util.Long) + (message.count = $util.Long.fromValue(object.count)).unsigned = false; + else if (typeof object.count === "string") + message.count = parseInt(object.count, 10); + else if (typeof object.count === "number") + message.count = object.count; + else if (typeof object.count === "object") + message.count = new $util.LongBits(object.count.low >>> 0, object.count.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a SpokeStateReasonCount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount + * @static + * @param {google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount} message SpokeStateReasonCount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpokeStateReasonCount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.stateReasonCode = options.enums === String ? "CODE_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.count = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.count = options.longs === String ? "0" : 0; + } + if (message.stateReasonCode != null && message.hasOwnProperty("stateReasonCode")) + object.stateReasonCode = options.enums === String ? $root.google.cloud.networkconnectivity.v1.Spoke.StateReason.Code[message.stateReasonCode] === undefined ? message.stateReasonCode : $root.google.cloud.networkconnectivity.v1.Spoke.StateReason.Code[message.stateReasonCode] : message.stateReasonCode; + if (message.count != null && message.hasOwnProperty("count")) + if (typeof message.count === "number") + object.count = options.longs === String ? String(message.count) : message.count; + else + object.count = options.longs === String ? $util.Long.prototype.toString.call(message.count) : options.longs === Number ? new $util.LongBits(message.count.low >>> 0, message.count.high >>> 0).toNumber() : message.count; return object; - var message = new $root.google.cloud.networkconnectivity.v1.RouterApplianceInstance(); - if (object.virtualMachine != null) - message.virtualMachine = String(object.virtualMachine); - if (object.ipAddress != null) - message.ipAddress = String(object.ipAddress); - return message; - }; + }; - /** - * Creates a plain object from a RouterApplianceInstance message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.networkconnectivity.v1.RouterApplianceInstance - * @static - * @param {google.cloud.networkconnectivity.v1.RouterApplianceInstance} message RouterApplianceInstance - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RouterApplianceInstance.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.virtualMachine = ""; - object.ipAddress = ""; - } - if (message.virtualMachine != null && message.hasOwnProperty("virtualMachine")) - object.virtualMachine = message.virtualMachine; - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) - object.ipAddress = message.ipAddress; - return object; - }; + /** + * Converts this SpokeStateReasonCount to JSON. + * @function toJSON + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount + * @instance + * @returns {Object.} JSON object + */ + SpokeStateReasonCount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this RouterApplianceInstance to JSON. - * @function toJSON - * @memberof google.cloud.networkconnectivity.v1.RouterApplianceInstance - * @instance - * @returns {Object.} JSON object - */ - RouterApplianceInstance.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Gets the default type url for SpokeStateReasonCount + * @function getTypeUrl + * @memberof google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SpokeStateReasonCount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.SpokeSummary.SpokeStateReasonCount"; + }; - /** - * Gets the default type url for RouterApplianceInstance - * @function getTypeUrl - * @memberof google.cloud.networkconnectivity.v1.RouterApplianceInstance - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RouterApplianceInstance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.RouterApplianceInstance"; - }; + return SpokeStateReasonCount; + })(); - return RouterApplianceInstance; + return SpokeSummary; })(); - v1.LocationMetadata = (function() { + v1.GetGroupRequest = (function() { /** - * Properties of a LocationMetadata. + * Properties of a GetGroupRequest. * @memberof google.cloud.networkconnectivity.v1 - * @interface ILocationMetadata - * @property {Array.|null} [locationFeatures] LocationMetadata locationFeatures + * @interface IGetGroupRequest + * @property {string|null} [name] GetGroupRequest name */ /** - * Constructs a new LocationMetadata. + * Constructs a new GetGroupRequest. * @memberof google.cloud.networkconnectivity.v1 - * @classdesc Represents a LocationMetadata. - * @implements ILocationMetadata + * @classdesc Represents a GetGroupRequest. + * @implements IGetGroupRequest * @constructor - * @param {google.cloud.networkconnectivity.v1.ILocationMetadata=} [properties] Properties to set + * @param {google.cloud.networkconnectivity.v1.IGetGroupRequest=} [properties] Properties to set */ - function LocationMetadata(properties) { - this.locationFeatures = []; + function GetGroupRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6205,86 +14219,75 @@ } /** - * LocationMetadata locationFeatures. - * @member {Array.} locationFeatures - * @memberof google.cloud.networkconnectivity.v1.LocationMetadata + * GetGroupRequest name. + * @member {string} name + * @memberof google.cloud.networkconnectivity.v1.GetGroupRequest * @instance */ - LocationMetadata.prototype.locationFeatures = $util.emptyArray; + GetGroupRequest.prototype.name = ""; /** - * Creates a new LocationMetadata instance using the specified properties. + * Creates a new GetGroupRequest instance using the specified properties. * @function create - * @memberof google.cloud.networkconnectivity.v1.LocationMetadata + * @memberof google.cloud.networkconnectivity.v1.GetGroupRequest * @static - * @param {google.cloud.networkconnectivity.v1.ILocationMetadata=} [properties] Properties to set - * @returns {google.cloud.networkconnectivity.v1.LocationMetadata} LocationMetadata instance + * @param {google.cloud.networkconnectivity.v1.IGetGroupRequest=} [properties] Properties to set + * @returns {google.cloud.networkconnectivity.v1.GetGroupRequest} GetGroupRequest instance */ - LocationMetadata.create = function create(properties) { - return new LocationMetadata(properties); + GetGroupRequest.create = function create(properties) { + return new GetGroupRequest(properties); }; /** - * Encodes the specified LocationMetadata message. Does not implicitly {@link google.cloud.networkconnectivity.v1.LocationMetadata.verify|verify} messages. + * Encodes the specified GetGroupRequest message. Does not implicitly {@link google.cloud.networkconnectivity.v1.GetGroupRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.networkconnectivity.v1.LocationMetadata + * @memberof google.cloud.networkconnectivity.v1.GetGroupRequest * @static - * @param {google.cloud.networkconnectivity.v1.ILocationMetadata} message LocationMetadata message or plain object to encode + * @param {google.cloud.networkconnectivity.v1.IGetGroupRequest} message GetGroupRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LocationMetadata.encode = function encode(message, writer) { + GetGroupRequest.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(); - } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified LocationMetadata message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.LocationMetadata.verify|verify} messages. + * Encodes the specified GetGroupRequest message, length delimited. Does not implicitly {@link google.cloud.networkconnectivity.v1.GetGroupRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.networkconnectivity.v1.LocationMetadata + * @memberof google.cloud.networkconnectivity.v1.GetGroupRequest * @static - * @param {google.cloud.networkconnectivity.v1.ILocationMetadata} message LocationMetadata message or plain object to encode + * @param {google.cloud.networkconnectivity.v1.IGetGroupRequest} message GetGroupRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - LocationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + GetGroupRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a LocationMetadata message from the specified reader or buffer. + * Decodes a GetGroupRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.networkconnectivity.v1.LocationMetadata + * @memberof google.cloud.networkconnectivity.v1.GetGroupRequest * @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 + * @returns {google.cloud.networkconnectivity.v1.GetGroupRequest} GetGroupRequest * @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) { + GetGroupRequest.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(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.networkconnectivity.v1.GetGroupRequest(); 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()); + message.name = reader.string(); break; } default: @@ -6296,138 +14299,102 @@ }; /** - * Decodes a LocationMetadata message from the specified reader or buffer, length delimited. + * Decodes a GetGroupRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.networkconnectivity.v1.LocationMetadata + * @memberof google.cloud.networkconnectivity.v1.GetGroupRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.networkconnectivity.v1.LocationMetadata} LocationMetadata + * @returns {google.cloud.networkconnectivity.v1.GetGroupRequest} GetGroupRequest * @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) { + GetGroupRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a LocationMetadata message. + * Verifies a GetGroupRequest message. * @function verify - * @memberof google.cloud.networkconnectivity.v1.LocationMetadata + * @memberof google.cloud.networkconnectivity.v1.GetGroupRequest * @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) { + GetGroupRequest.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; - } - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a LocationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a GetGroupRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.networkconnectivity.v1.LocationMetadata + * @memberof google.cloud.networkconnectivity.v1.GetGroupRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.networkconnectivity.v1.LocationMetadata} LocationMetadata + * @returns {google.cloud.networkconnectivity.v1.GetGroupRequest} GetGroupRequest */ - LocationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.networkconnectivity.v1.LocationMetadata) + GetGroupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.networkconnectivity.v1.GetGroupRequest) 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: - if (typeof object.locationFeatures[i] === "number") { - message.locationFeatures[i] = object.locationFeatures[i]; - break; - } - 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; - } - } + var message = new $root.google.cloud.networkconnectivity.v1.GetGroupRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a LocationMetadata message. Also converts values to other types if specified. + * Creates a plain object from a GetGroupRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.networkconnectivity.v1.LocationMetadata + * @memberof google.cloud.networkconnectivity.v1.GetGroupRequest * @static - * @param {google.cloud.networkconnectivity.v1.LocationMetadata} message LocationMetadata + * @param {google.cloud.networkconnectivity.v1.GetGroupRequest} message GetGroupRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - LocationMetadata.toObject = function toObject(message, options) { + GetGroupRequest.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]] === undefined ? message.locationFeatures[j] : $root.google.cloud.networkconnectivity.v1.LocationFeature[message.locationFeatures[j]] : message.locationFeatures[j]; - } + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this LocationMetadata to JSON. + * Converts this GetGroupRequest to JSON. * @function toJSON - * @memberof google.cloud.networkconnectivity.v1.LocationMetadata + * @memberof google.cloud.networkconnectivity.v1.GetGroupRequest * @instance * @returns {Object.} JSON object */ - LocationMetadata.prototype.toJSON = function toJSON() { + GetGroupRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for LocationMetadata + * Gets the default type url for GetGroupRequest * @function getTypeUrl - * @memberof google.cloud.networkconnectivity.v1.LocationMetadata + * @memberof google.cloud.networkconnectivity.v1.GetGroupRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - LocationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetGroupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.LocationMetadata"; + return typeUrlPrefix + "/google.cloud.networkconnectivity.v1.GetGroupRequest"; }; - return LocationMetadata; + return GetGroupRequest; })(); v1.PolicyBasedRoutingService = (function() { diff --git a/packages/google-cloud-networkconnectivity/protos/protos.json b/packages/google-cloud-networkconnectivity/protos/protos.json index 5191edcf1e6..c6c25c25b17 100644 --- a/packages/google-cloud-networkconnectivity/protos/protos.json +++ b/packages/google-cloud-networkconnectivity/protos/protos.json @@ -196,6 +196,24 @@ } ] }, + "ListHubSpokes": { + "requestType": "ListHubSpokesRequest", + "responseType": "ListHubSpokesResponse", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/global/hubs/*}:listSpokes", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/global/hubs/*}:listSpokes" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, "ListSpokes": { "requestType": "ListSpokesRequest", "responseType": "ListSpokesResponse", @@ -288,6 +306,62 @@ } ] }, + "RejectHubSpoke": { + "requestType": "RejectHubSpokeRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/global/hubs/*}:rejectSpoke", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,spoke_uri", + "(google.longrunning.operation_info).response_type": "RejectHubSpokeResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/global/hubs/*}:rejectSpoke", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,spoke_uri" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "RejectHubSpokeResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "AcceptHubSpoke": { + "requestType": "AcceptHubSpokeRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/global/hubs/*}:acceptSpoke", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,spoke_uri", + "(google.longrunning.operation_info).response_type": "AcceptHubSpokeResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/global/hubs/*}:acceptSpoke", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,spoke_uri" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "AcceptHubSpokeResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, "DeleteSpoke": { "requestType": "DeleteSpokeRequest", "responseType": "google.longrunning.Operation", @@ -313,6 +387,114 @@ } } ] + }, + "GetRouteTable": { + "requestType": "GetRouteTableRequest", + "responseType": "RouteTable", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/global/hubs/*/routeTables/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/global/hubs/*/routeTables/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetRoute": { + "requestType": "GetRouteRequest", + "responseType": "Route", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/global/hubs/*/routeTables/*/routes/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/global/hubs/*/routeTables/*/routes/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListRoutes": { + "requestType": "ListRoutesRequest", + "responseType": "ListRoutesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/global/hubs/*/routeTables/*}/routes", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/global/hubs/*/routeTables/*}/routes" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListRouteTables": { + "requestType": "ListRouteTablesRequest", + "responseType": "ListRouteTablesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/global/hubs/*}/routeTables", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/global/hubs/*}/routeTables" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetGroup": { + "requestType": "GetGroupRequest", + "responseType": "Group", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/global/hubs/*/groups/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/global/hubs/*/groups/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListGroups": { + "requestType": "ListGroupsRequest", + "responseType": "ListGroupsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/global/hubs/*}/groups", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/global/hubs/*}/groups" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] } } }, @@ -323,13 +505,33 @@ "SITE_TO_SITE_SPOKES": 2 } }, + "RouteType": { + "values": { + "ROUTE_TYPE_UNSPECIFIED": 0, + "VPC_PRIMARY_SUBNET": 1, + "VPC_SECONDARY_SUBNET": 2 + } + }, "State": { "values": { "STATE_UNSPECIFIED": 0, "CREATING": 1, "ACTIVE": 2, "DELETING": 3, - "UPDATING": 6 + "ACCEPTING": 8, + "REJECTING": 9, + "UPDATING": 6, + "INACTIVE": 7, + "OBSOLETE": 10 + } + }, + "SpokeType": { + "values": { + "SPOKE_TYPE_UNSPECIFIED": 0, + "VPN_TUNNEL": 1, + "INTERCONNECT_ATTACHMENT": 2, + "ROUTER_APPLIANCE": 3, + "VPC_NETWORK": 4 } }, "Hub": { @@ -386,6 +588,21 @@ "rule": "repeated", "type": "RoutingVPC", "id": 10 + }, + "routeTables": { + "rule": "repeated", + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "spokeSummary": { + "type": "SpokeSummary", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, @@ -451,6 +668,14 @@ "(google.api.resource_reference).type": "networkconnectivity.googleapis.com/Hub" } }, + "group": { + "type": "string", + "id": 23, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "networkconnectivity.googleapis.com/Group" + } + }, "linkedVpnTunnels": { "type": "LinkedVpnTunnels", "id": 17 @@ -463,6 +688,13 @@ "type": "LinkedRouterApplianceInstances", "id": 19 }, + "linkedVpcNetwork": { + "type": "LinkedVpcNetwork", + "id": 20, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, "uniqueId": { "type": "string", "id": 11, @@ -476,78 +708,317 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "reasons": { + "rule": "repeated", + "type": "StateReason", + "id": 21, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "spokeType": { + "type": "SpokeType", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "StateReason": { + "fields": { + "code": { + "type": "Code", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "userDetails": { + "type": "string", + "id": 3 + } + }, + "nested": { + "Code": { + "values": { + "CODE_UNSPECIFIED": 0, + "PENDING_REVIEW": 1, + "REJECTED": 2, + "PAUSED": 3, + "FAILED": 4 + } + } + } } } }, - "ListHubsRequest": { + "RouteTable": { + "options": { + "(google.api.resource).type": "networkconnectivity.googleapis.com/RouteTable", + "(google.api.resource).pattern": "projects/{project}/locations/global/hubs/{hub}/routeTables/{route_table}" + }, "fields": { - "parent": { + "name": { "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "locations.googleapis.com/Location" + "(google.api.field_behavior)": "IMMUTABLE" } }, - "pageSize": { - "type": "int32", - "id": 2 + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, - "pageToken": { - "type": "string", - "id": 3 + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, - "filter": { + "labels": { + "keyType": "string", "type": "string", "id": 4 }, - "orderBy": { + "description": { "type": "string", "id": 5 - } - } - }, - "ListHubsResponse": { - "fields": { - "hubs": { - "rule": "repeated", - "type": "Hub", - "id": 1 }, - "nextPageToken": { + "uid": { "type": "string", - "id": 2 + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "GetHubRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, + "state": { + "type": "State", + "id": 7, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "networkconnectivity.googleapis.com/Hub" + "(google.api.field_behavior)": "OUTPUT_ONLY" } } } }, - "CreateHubRequest": { + "Route": { + "options": { + "(google.api.resource).type": "networkconnectivity.googleapis.com/HubRoute", + "(google.api.resource).pattern": "projects/{project}/locations/global/hubs/{hub}/routeTables/{route_table}/routes/{route}" + }, "fields": { - "parent": { + "name": { "type": "string", - "id": 1, + "id": 3, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "locations.googleapis.com/Location" + "(google.api.field_behavior)": "IMMUTABLE" } }, - "hubId": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "ipCidrRange": { + "type": "string", + "id": 1 + }, + "type": { + "type": "RouteType", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nextHopVpcNetwork": { + "type": "NextHopVpcNetwork", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 6 + }, + "description": { + "type": "string", + "id": 7 + }, + "uid": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "spoke": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "IMMUTABLE", + "(google.api.resource_reference).type": "networkconnectivity.googleapis.com/Spoke" + } + }, + "location": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Group": { + "options": { + "(google.api.resource).type": "networkconnectivity.googleapis.com/Group", + "(google.api.resource).pattern": "projects/{project}/locations/global/hubs/{hub}/groups/{group}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "description": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "uid": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ListHubsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListHubsResponse": { + "fields": { + "hubs": { + "rule": "repeated", + "type": "Hub", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetHubRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networkconnectivity.googleapis.com/Hub" + } + } + } + }, + "CreateHubRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "hubId": { "type": "string", "id": 2, "options": { @@ -614,6 +1085,70 @@ } } }, + "ListHubSpokesRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networkconnectivity.googleapis.com/Hub" + } + }, + "spokeLocations": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 5 + }, + "orderBy": { + "type": "string", + "id": 6 + }, + "view": { + "type": "SpokeView", + "id": 7 + } + }, + "nested": { + "SpokeView": { + "values": { + "SPOKE_VIEW_UNSPECIFIED": 0, + "BASIC": 1, + "DETAILED": 2 + } + } + } + }, + "ListHubSpokesResponse": { + "fields": { + "spokes": { + "rule": "repeated", + "type": "Spoke", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, "ListSpokesRequest": { "fields": { "parent": { @@ -749,27 +1284,266 @@ } } }, - "LinkedVpnTunnels": { + "AcceptHubSpokeRequest": { "fields": { - "uris": { - "rule": "repeated", + "name": { "type": "string", "id": 1, "options": { - "(google.api.resource_reference).type": "compute.googleapis.com/VpnTunnel" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networkconnectivity.googleapis.com/Hub" } }, - "siteToSiteDataTransfer": { - "type": "bool", - "id": 2 - }, - "vpcNetwork": { + "spokeUri": { "type": "string", - "id": 3, + "id": 2, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "compute.googleapis.com/Network" - } + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networkconnectivity.googleapis.com/Spoke" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AcceptHubSpokeResponse": { + "fields": { + "spoke": { + "type": "Spoke", + "id": 1 + } + } + }, + "RejectHubSpokeRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networkconnectivity.googleapis.com/Hub" + } + }, + "spokeUri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networkconnectivity.googleapis.com/Spoke" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "details": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RejectHubSpokeResponse": { + "fields": { + "spoke": { + "type": "Spoke", + "id": 1 + } + } + }, + "GetRouteTableRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networkconnectivity.googleapis.com/RouteTable" + } + } + } + }, + "GetRouteRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networkconnectivity.googleapis.com/HubRoute" + } + } + } + }, + "ListRoutesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networkconnectivity.googleapis.com/RouteTable" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListRoutesResponse": { + "fields": { + "routes": { + "rule": "repeated", + "type": "Route", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "ListRouteTablesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networkconnectivity.googleapis.com/Hub" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListRouteTablesResponse": { + "fields": { + "routeTables": { + "rule": "repeated", + "type": "RouteTable", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "ListGroupsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networkconnectivity.googleapis.com/Hub" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListGroupsResponse": { + "fields": { + "groups": { + "rule": "repeated", + "type": "Group", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "LinkedVpnTunnels": { + "fields": { + "uris": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "compute.googleapis.com/VpnTunnel" + } + }, + "siteToSiteDataTransfer": { + "type": "bool", + "id": 2 + }, + "vpcNetwork": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "compute.googleapis.com/Network" + } } } }, @@ -818,6 +1592,26 @@ } } }, + "LinkedVpcNetwork": { + "fields": { + "uri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "compute.googleapis.com/Network" + } + }, + "excludeExportRanges": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, "RouterApplianceInstance": { "fields": { "virtualMachine": { @@ -842,6 +1636,113 @@ } } }, + "NextHopVpcNetwork": { + "fields": { + "uri": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "compute.googleapis.com/Network" + } + } + } + }, + "SpokeSummary": { + "fields": { + "spokeTypeCounts": { + "rule": "repeated", + "type": "SpokeTypeCount", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "spokeStateCounts": { + "rule": "repeated", + "type": "SpokeStateCount", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "spokeStateReasonCounts": { + "rule": "repeated", + "type": "SpokeStateReasonCount", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "SpokeTypeCount": { + "fields": { + "spokeType": { + "type": "SpokeType", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "count": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "SpokeStateCount": { + "fields": { + "state": { + "type": "State", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "count": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "SpokeStateReasonCount": { + "fields": { + "stateReasonCode": { + "type": "Spoke.StateReason.Code", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "count": { + "type": "int64", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "GetGroupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "networkconnectivity.googleapis.com/Group" + } + } + } + }, "PolicyBasedRoutingService": { "options": { "(google.api.default_host)": "networkconnectivity.googleapis.com", diff --git a/packages/google-cloud-networkconnectivity/samples/README.md b/packages/google-cloud-networkconnectivity/samples/README.md index 7215dc3d24e..c9795a049ab 100644 --- a/packages/google-cloud-networkconnectivity/samples/README.md +++ b/packages/google-cloud-networkconnectivity/samples/README.md @@ -12,14 +12,23 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) + * [Hub_service.accept_hub_spoke](#hub_service.accept_hub_spoke) * [Hub_service.create_hub](#hub_service.create_hub) * [Hub_service.create_spoke](#hub_service.create_spoke) * [Hub_service.delete_hub](#hub_service.delete_hub) * [Hub_service.delete_spoke](#hub_service.delete_spoke) + * [Hub_service.get_group](#hub_service.get_group) * [Hub_service.get_hub](#hub_service.get_hub) + * [Hub_service.get_route](#hub_service.get_route) + * [Hub_service.get_route_table](#hub_service.get_route_table) * [Hub_service.get_spoke](#hub_service.get_spoke) + * [Hub_service.list_groups](#hub_service.list_groups) + * [Hub_service.list_hub_spokes](#hub_service.list_hub_spokes) * [Hub_service.list_hubs](#hub_service.list_hubs) + * [Hub_service.list_route_tables](#hub_service.list_route_tables) + * [Hub_service.list_routes](#hub_service.list_routes) * [Hub_service.list_spokes](#hub_service.list_spokes) + * [Hub_service.reject_hub_spoke](#hub_service.reject_hub_spoke) * [Hub_service.update_hub](#hub_service.update_hub) * [Hub_service.update_spoke](#hub_service.update_spoke) * [Policy_based_routing_service.create_policy_based_route](#policy_based_routing_service.create_policy_based_route) @@ -53,6 +62,23 @@ Before running the samples, make sure you've followed the steps outlined in +### Hub_service.accept_hub_spoke + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.accept_hub_spoke.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-networkconnectivity/samples/generated/v1/hub_service.accept_hub_spoke.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.accept_hub_spoke.js` + + +----- + + + + ### Hub_service.create_hub View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.create_hub.js). @@ -121,6 +147,23 @@ __Usage:__ +### Hub_service.get_group + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.get_group.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-networkconnectivity/samples/generated/v1/hub_service.get_group.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.get_group.js` + + +----- + + + + ### Hub_service.get_hub View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.get_hub.js). @@ -138,6 +181,40 @@ __Usage:__ +### Hub_service.get_route + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.get_route.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-networkconnectivity/samples/generated/v1/hub_service.get_route.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.get_route.js` + + +----- + + + + +### Hub_service.get_route_table + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.get_route_table.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-networkconnectivity/samples/generated/v1/hub_service.get_route_table.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.get_route_table.js` + + +----- + + + + ### Hub_service.get_spoke View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.get_spoke.js). @@ -155,6 +232,40 @@ __Usage:__ +### Hub_service.list_groups + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_groups.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-networkconnectivity/samples/generated/v1/hub_service.list_groups.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_groups.js` + + +----- + + + + +### Hub_service.list_hub_spokes + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_hub_spokes.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-networkconnectivity/samples/generated/v1/hub_service.list_hub_spokes.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_hub_spokes.js` + + +----- + + + + ### Hub_service.list_hubs View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_hubs.js). @@ -172,6 +283,40 @@ __Usage:__ +### Hub_service.list_route_tables + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_route_tables.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-networkconnectivity/samples/generated/v1/hub_service.list_route_tables.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_route_tables.js` + + +----- + + + + +### Hub_service.list_routes + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_routes.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-networkconnectivity/samples/generated/v1/hub_service.list_routes.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_routes.js` + + +----- + + + + ### Hub_service.list_spokes View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_spokes.js). @@ -189,6 +334,23 @@ __Usage:__ +### Hub_service.reject_hub_spoke + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.reject_hub_spoke.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-networkconnectivity/samples/generated/v1/hub_service.reject_hub_spoke.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.reject_hub_spoke.js` + + +----- + + + + ### Hub_service.update_hub View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.update_hub.js). diff --git a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.accept_hub_spoke.js b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.accept_hub_spoke.js new file mode 100644 index 00000000000..7ab4dbecc04 --- /dev/null +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.accept_hub_spoke.js @@ -0,0 +1,82 @@ +// Copyright 2023 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(name, spokeUri) { + // [START networkconnectivity_v1_generated_HubService_AcceptHubSpoke_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 name of the hub into which to accept the spoke. + */ + // const name = 'abc123' + /** + * Required. The URI of the spoke to accept into the hub. + */ + // const spokeUri = 'abc123' + /** + * Optional. A request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server knows to ignore the request + * if it has already been completed. The server guarantees that a request + * doesn't result in creation of duplicate commitments for at least 60 + * minutes. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check to see whether the original operation + * was received. If it was, the server ignores the second request. This + * behavior prevents clients from mistakenly creating duplicate commitments. + * The request ID must be a valid UUID, with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Networkconnectivity library + const {HubServiceClient} = require('@google-cloud/network-connectivity').v1; + + // Instantiates a client + const networkconnectivityClient = new HubServiceClient(); + + async function callAcceptHubSpoke() { + // Construct request + const request = { + name, + spokeUri, + }; + + // Run request + const [operation] = await networkconnectivityClient.acceptHubSpoke(request); + const [response] = await operation.promise(); + console.log(response); + } + + callAcceptHubSpoke(); + // [END networkconnectivity_v1_generated_HubService_AcceptHubSpoke_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.create_hub.js b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.create_hub.js index 5386f809b62..d158d2e2255 100644 --- a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.create_hub.js +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.create_hub.js @@ -41,11 +41,11 @@ function main(parent, hubId, hub) { */ // const hub = {} /** - * Optional. A unique request ID (optional). If you specify this ID, you can - * use it in cases when you need to retry your request. When you need to - * retry, this ID lets the server know that it can ignore the request if it - * has already been completed. The server guarantees that for at least 60 - * minutes after the first request. + * Optional. A request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server knows to ignore the request + * if it has already been completed. The server guarantees that a request + * doesn't result in creation of duplicate commitments for at least 60 + * minutes. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request * ID, the server can check to see whether the original operation diff --git a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.create_spoke.js b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.create_spoke.js index 8838c551a7d..eaeb4e532b2 100644 --- a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.create_spoke.js +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.create_spoke.js @@ -41,11 +41,11 @@ function main(parent, spokeId, spoke) { */ // const spoke = {} /** - * Optional. A unique request ID (optional). If you specify this ID, you can - * use it in cases when you need to retry your request. When you need to - * retry, this ID lets the server know that it can ignore the request if it - * has already been completed. The server guarantees that for at least 60 - * minutes after the first request. + * Optional. A request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server knows to ignore the request + * if it has already been completed. The server guarantees that a request + * doesn't result in creation of duplicate commitments for at least 60 + * minutes. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request * ID, the server can check to see whether the original operation diff --git a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.delete_hub.js b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.delete_hub.js index 380e2478bb1..1f03d33feab 100644 --- a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.delete_hub.js +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.delete_hub.js @@ -33,11 +33,11 @@ function main(name) { */ // const name = 'abc123' /** - * Optional. A unique request ID (optional). If you specify this ID, you can - * use it in cases when you need to retry your request. When you need to - * retry, this ID lets the server know that it can ignore the request if it - * has already been completed. The server guarantees that for at least 60 - * minutes after the first request. + * Optional. A request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server knows to ignore the request + * if it has already been completed. The server guarantees that a request + * doesn't result in creation of duplicate commitments for at least 60 + * minutes. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request * ID, the server can check to see whether the original operation diff --git a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.delete_spoke.js b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.delete_spoke.js index 290cda0f1c6..e17310431d1 100644 --- a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.delete_spoke.js +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.delete_spoke.js @@ -33,11 +33,11 @@ function main(name) { */ // const name = 'abc123' /** - * Optional. A unique request ID (optional). If you specify this ID, you can - * use it in cases when you need to retry your request. When you need to - * retry, this ID lets the server know that it can ignore the request if it - * has already been completed. The server guarantees that for at least 60 - * minutes after the first request. + * Optional. A request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server knows to ignore the request + * if it has already been completed. The server guarantees that a request + * doesn't result in creation of duplicate commitments for at least 60 + * minutes. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request * ID, the server can check to see whether the original operation diff --git a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.get_group.js b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.get_group.js new file mode 100644 index 00000000000..e4d9e2ef75b --- /dev/null +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.get_group.js @@ -0,0 +1,61 @@ +// Copyright 2023 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(name) { + // [START networkconnectivity_v1_generated_HubService_GetGroup_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 name of the route table resource. + */ + // const name = 'abc123' + + // Imports the Networkconnectivity library + const {HubServiceClient} = require('@google-cloud/network-connectivity').v1; + + // Instantiates a client + const networkconnectivityClient = new HubServiceClient(); + + async function callGetGroup() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await networkconnectivityClient.getGroup(request); + console.log(response); + } + + callGetGroup(); + // [END networkconnectivity_v1_generated_HubService_GetGroup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.get_route.js b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.get_route.js new file mode 100644 index 00000000000..796da8cf416 --- /dev/null +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.get_route.js @@ -0,0 +1,61 @@ +// Copyright 2023 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(name) { + // [START networkconnectivity_v1_generated_HubService_GetRoute_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 name of the route resource. + */ + // const name = 'abc123' + + // Imports the Networkconnectivity library + const {HubServiceClient} = require('@google-cloud/network-connectivity').v1; + + // Instantiates a client + const networkconnectivityClient = new HubServiceClient(); + + async function callGetRoute() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await networkconnectivityClient.getRoute(request); + console.log(response); + } + + callGetRoute(); + // [END networkconnectivity_v1_generated_HubService_GetRoute_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.get_route_table.js b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.get_route_table.js new file mode 100644 index 00000000000..233d6d6c929 --- /dev/null +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.get_route_table.js @@ -0,0 +1,61 @@ +// Copyright 2023 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(name) { + // [START networkconnectivity_v1_generated_HubService_GetRouteTable_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 name of the route table resource. + */ + // const name = 'abc123' + + // Imports the Networkconnectivity library + const {HubServiceClient} = require('@google-cloud/network-connectivity').v1; + + // Instantiates a client + const networkconnectivityClient = new HubServiceClient(); + + async function callGetRouteTable() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await networkconnectivityClient.getRouteTable(request); + console.log(response); + } + + callGetRouteTable(); + // [END networkconnectivity_v1_generated_HubService_GetRouteTable_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_groups.js b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_groups.js new file mode 100644 index 00000000000..e4f8ad23bd4 --- /dev/null +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_groups.js @@ -0,0 +1,79 @@ +// Copyright 2023 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(parent) { + // [START networkconnectivity_v1_generated_HubService_ListGroups_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 parent resource's name. + */ + // const parent = 'abc123' + /** + * The maximum number of results to return per page. + */ + // const pageSize = 1234 + /** + * The page token. + */ + // const pageToken = 'abc123' + /** + * An expression that filters the list of results. + */ + // const filter = 'abc123' + /** + * Sort the results by a certain order. + */ + // const orderBy = 'abc123' + + // Imports the Networkconnectivity library + const {HubServiceClient} = require('@google-cloud/network-connectivity').v1; + + // Instantiates a client + const networkconnectivityClient = new HubServiceClient(); + + async function callListGroups() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await networkconnectivityClient.listGroupsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListGroups(); + // [END networkconnectivity_v1_generated_HubService_ListGroups_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_hub_spokes.js b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_hub_spokes.js new file mode 100644 index 00000000000..e515a286f74 --- /dev/null +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_hub_spokes.js @@ -0,0 +1,96 @@ +// Copyright 2023 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(name) { + // [START networkconnectivity_v1_generated_HubService_ListHubSpokes_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 name of the hub. + */ + // const name = 'abc123' + /** + * A list of locations. + * Specify one of the following: `[global]`, a single region (for + * example, `[us-central1]`), or a combination of + * values (for example, `[global, us-central1, us-west1]`). + * If the spoke_locations field is populated, the list of results + * includes only spokes in the specified location. + * If the spoke_locations field is not populated, the list of results + * includes spokes in all locations. + */ + // const spokeLocations = ['abc','def'] + /** + * The maximum number of results to return per page. + */ + // const pageSize = 1234 + /** + * The page token. + */ + // const pageToken = 'abc123' + /** + * An expression that filters the list of results. + */ + // const filter = 'abc123' + /** + * Sort the results by name or create_time. + */ + // const orderBy = 'abc123' + /** + * The view of the spoke to return. + * The view that you use determines which spoke fields are included in the + * response. + */ + // const view = {} + + // Imports the Networkconnectivity library + const {HubServiceClient} = require('@google-cloud/network-connectivity').v1; + + // Instantiates a client + const networkconnectivityClient = new HubServiceClient(); + + async function callListHubSpokes() { + // Construct request + const request = { + name, + }; + + // Run request + const iterable = await networkconnectivityClient.listHubSpokesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListHubSpokes(); + // [END networkconnectivity_v1_generated_HubService_ListHubSpokes_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_hubs.js b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_hubs.js index 8aeb997799c..7e72c40f7e5 100644 --- a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_hubs.js +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_hubs.js @@ -33,7 +33,7 @@ function main(parent) { */ // const parent = 'abc123' /** - * The maximum number of results per page that should be returned. + * The maximum number of results per page to return. */ // const pageSize = 1234 /** @@ -41,7 +41,7 @@ function main(parent) { */ // const pageToken = 'abc123' /** - * An expression that filters the results listed in the response. + * An expression that filters the list of results. */ // const filter = 'abc123' /** diff --git a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_route_tables.js b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_route_tables.js new file mode 100644 index 00000000000..51906770e83 --- /dev/null +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_route_tables.js @@ -0,0 +1,79 @@ +// Copyright 2023 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(parent) { + // [START networkconnectivity_v1_generated_HubService_ListRouteTables_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 parent resource's name. + */ + // const parent = 'abc123' + /** + * The maximum number of results to return per page. + */ + // const pageSize = 1234 + /** + * The page token. + */ + // const pageToken = 'abc123' + /** + * An expression that filters the list of results. + */ + // const filter = 'abc123' + /** + * Sort the results by a certain order. + */ + // const orderBy = 'abc123' + + // Imports the Networkconnectivity library + const {HubServiceClient} = require('@google-cloud/network-connectivity').v1; + + // Instantiates a client + const networkconnectivityClient = new HubServiceClient(); + + async function callListRouteTables() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await networkconnectivityClient.listRouteTablesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListRouteTables(); + // [END networkconnectivity_v1_generated_HubService_ListRouteTables_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_routes.js b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_routes.js new file mode 100644 index 00000000000..c28474af607 --- /dev/null +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_routes.js @@ -0,0 +1,79 @@ +// Copyright 2023 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(parent) { + // [START networkconnectivity_v1_generated_HubService_ListRoutes_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 parent resource's name. + */ + // const parent = 'abc123' + /** + * The maximum number of results to return per page. + */ + // const pageSize = 1234 + /** + * The page token. + */ + // const pageToken = 'abc123' + /** + * An expression that filters the list of results. + */ + // const filter = 'abc123' + /** + * Sort the results by a certain order. + */ + // const orderBy = 'abc123' + + // Imports the Networkconnectivity library + const {HubServiceClient} = require('@google-cloud/network-connectivity').v1; + + // Instantiates a client + const networkconnectivityClient = new HubServiceClient(); + + async function callListRoutes() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await networkconnectivityClient.listRoutesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListRoutes(); + // [END networkconnectivity_v1_generated_HubService_ListRoutes_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_spokes.js b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_spokes.js index 4f40de8c227..a5d752eb9f4 100644 --- a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_spokes.js +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.list_spokes.js @@ -33,7 +33,7 @@ function main(parent) { */ // const parent = 'abc123' /** - * The maximum number of results per page that should be returned. + * The maximum number of results to return per page. */ // const pageSize = 1234 /** @@ -41,7 +41,7 @@ function main(parent) { */ // const pageToken = 'abc123' /** - * An expression that filters the results listed in the response. + * An expression that filters the list of results. */ // const filter = 'abc123' /** diff --git a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.reject_hub_spoke.js b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.reject_hub_spoke.js new file mode 100644 index 00000000000..1fa55c3b7c3 --- /dev/null +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.reject_hub_spoke.js @@ -0,0 +1,86 @@ +// Copyright 2023 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(name, spokeUri) { + // [START networkconnectivity_v1_generated_HubService_RejectHubSpoke_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 name of the hub from which to reject the spoke. + */ + // const name = 'abc123' + /** + * Required. The URI of the spoke to reject from the hub. + */ + // const spokeUri = 'abc123' + /** + * Optional. A request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server knows to ignore the request + * if it has already been completed. The server guarantees that a request + * doesn't result in creation of duplicate commitments for at least 60 + * minutes. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check to see whether the original operation + * was received. If it was, the server ignores the second request. This + * behavior prevents clients from mistakenly creating duplicate commitments. + * The request ID must be a valid UUID, with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. Additional information provided by the hub administrator. + */ + // const details = 'abc123' + + // Imports the Networkconnectivity library + const {HubServiceClient} = require('@google-cloud/network-connectivity').v1; + + // Instantiates a client + const networkconnectivityClient = new HubServiceClient(); + + async function callRejectHubSpoke() { + // Construct request + const request = { + name, + spokeUri, + }; + + // Run request + const [operation] = await networkconnectivityClient.rejectHubSpoke(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRejectHubSpoke(); + // [END networkconnectivity_v1_generated_HubService_RejectHubSpoke_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.update_hub.js b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.update_hub.js index 9f5b0dbbed6..46f4ddfe683 100644 --- a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.update_hub.js +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.update_hub.js @@ -41,11 +41,11 @@ function main(hub) { */ // const hub = {} /** - * Optional. A unique request ID (optional). If you specify this ID, you can - * use it in cases when you need to retry your request. When you need to - * retry, this ID lets the server know that it can ignore the request if it - * has already been completed. The server guarantees that for at least 60 - * minutes after the first request. + * Optional. A request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server knows to ignore the request + * if it has already been completed. The server guarantees that a request + * doesn't result in creation of duplicate commitments for at least 60 + * minutes. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request * ID, the server can check to see whether the original operation diff --git a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.update_spoke.js b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.update_spoke.js index af05ba517c3..c5aaa86b9c3 100644 --- a/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.update_spoke.js +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1/hub_service.update_spoke.js @@ -41,11 +41,11 @@ function main(spoke) { */ // const spoke = {} /** - * Optional. A unique request ID (optional). If you specify this ID, you can - * use it in cases when you need to retry your request. When you need to - * retry, this ID lets the server know that it can ignore the request if it - * has already been completed. The server guarantees that for at least 60 - * minutes after the first request. + * Optional. A request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server knows to ignore the request + * if it has already been completed. The server guarantees that a request + * doesn't result in creation of duplicate commitments for at least 60 + * minutes. * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request * ID, the server can check to see whether the original operation diff --git a/packages/google-cloud-networkconnectivity/samples/generated/v1/snippet_metadata_google.cloud.networkconnectivity.v1.json b/packages/google-cloud-networkconnectivity/samples/generated/v1/snippet_metadata_google.cloud.networkconnectivity.v1.json index 939d7a6dc70..50aebd095a7 100644 --- a/packages/google-cloud-networkconnectivity/samples/generated/v1/snippet_metadata_google.cloud.networkconnectivity.v1.json +++ b/packages/google-cloud-networkconnectivity/samples/generated/v1/snippet_metadata_google.cloud.networkconnectivity.v1.json @@ -251,6 +251,70 @@ } } }, + { + "regionTag": "networkconnectivity_v1_generated_HubService_ListHubSpokes_async", + "title": "HubService listHubSpokes Sample", + "origin": "API_DEFINITION", + "description": " Lists the Network Connectivity Center spokes associated with a specified hub and location. The list includes both spokes that are attached to the hub and spokes that have been proposed but not yet accepted.", + "canonical": true, + "file": "hub_service.list_hub_spokes.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 88, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListHubSpokes", + "fullName": "google.cloud.networkconnectivity.v1.HubService.ListHubSpokes", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "spoke_locations", + "type": "TYPE_STRING[]" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.networkconnectivity.v1.ListHubSpokesRequest.SpokeView" + } + ], + "resultType": ".google.cloud.networkconnectivity.v1.ListHubSpokesResponse", + "client": { + "shortName": "HubServiceClient", + "fullName": "google.cloud.networkconnectivity.v1.HubServiceClient" + }, + "method": { + "shortName": "ListHubSpokes", + "fullName": "google.cloud.networkconnectivity.v1.HubService.ListHubSpokes", + "service": { + "shortName": "HubService", + "fullName": "google.cloud.networkconnectivity.v1.HubService" + } + } + } + }, { "regionTag": "networkconnectivity_v1_generated_HubService_ListSpokes_async", "title": "HubService listSpokes Sample", @@ -447,6 +511,106 @@ } } }, + { + "regionTag": "networkconnectivity_v1_generated_HubService_RejectHubSpoke_async", + "title": "HubService rejectHubSpoke Sample", + "origin": "API_DEFINITION", + "description": " Rejects a Network Connectivity Center spoke from being attached to a hub. If the spoke was previously in the `ACTIVE` state, it transitions to the `INACTIVE` state and is no longer able to connect to other spokes that are attached to the hub.", + "canonical": true, + "file": "hub_service.reject_hub_spoke.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RejectHubSpoke", + "fullName": "google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "spoke_uri", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "details", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "HubServiceClient", + "fullName": "google.cloud.networkconnectivity.v1.HubServiceClient" + }, + "method": { + "shortName": "RejectHubSpoke", + "fullName": "google.cloud.networkconnectivity.v1.HubService.RejectHubSpoke", + "service": { + "shortName": "HubService", + "fullName": "google.cloud.networkconnectivity.v1.HubService" + } + } + } + }, + { + "regionTag": "networkconnectivity_v1_generated_HubService_AcceptHubSpoke_async", + "title": "HubService acceptHubSpoke Sample", + "origin": "API_DEFINITION", + "description": " Accepts a proposal to attach a Network Connectivity Center spoke to a hub.", + "canonical": true, + "file": "hub_service.accept_hub_spoke.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AcceptHubSpoke", + "fullName": "google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "spoke_uri", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "HubServiceClient", + "fullName": "google.cloud.networkconnectivity.v1.HubServiceClient" + }, + "method": { + "shortName": "AcceptHubSpoke", + "fullName": "google.cloud.networkconnectivity.v1.HubService.AcceptHubSpoke", + "service": { + "shortName": "HubService", + "fullName": "google.cloud.networkconnectivity.v1.HubService" + } + } + } + }, { "regionTag": "networkconnectivity_v1_generated_HubService_DeleteSpoke_async", "title": "HubService deleteSpoke Sample", @@ -491,6 +655,294 @@ } } }, + { + "regionTag": "networkconnectivity_v1_generated_HubService_GetRouteTable_async", + "title": "HubService getRouteTable Sample", + "origin": "API_DEFINITION", + "description": " Gets details about a Network Connectivity Center route table.", + "canonical": true, + "file": "hub_service.get_route_table.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetRouteTable", + "fullName": "google.cloud.networkconnectivity.v1.HubService.GetRouteTable", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networkconnectivity.v1.RouteTable", + "client": { + "shortName": "HubServiceClient", + "fullName": "google.cloud.networkconnectivity.v1.HubServiceClient" + }, + "method": { + "shortName": "GetRouteTable", + "fullName": "google.cloud.networkconnectivity.v1.HubService.GetRouteTable", + "service": { + "shortName": "HubService", + "fullName": "google.cloud.networkconnectivity.v1.HubService" + } + } + } + }, + { + "regionTag": "networkconnectivity_v1_generated_HubService_GetRoute_async", + "title": "HubService getRoute Sample", + "origin": "API_DEFINITION", + "description": " Gets details about the specified route.", + "canonical": true, + "file": "hub_service.get_route.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetRoute", + "fullName": "google.cloud.networkconnectivity.v1.HubService.GetRoute", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networkconnectivity.v1.Route", + "client": { + "shortName": "HubServiceClient", + "fullName": "google.cloud.networkconnectivity.v1.HubServiceClient" + }, + "method": { + "shortName": "GetRoute", + "fullName": "google.cloud.networkconnectivity.v1.HubService.GetRoute", + "service": { + "shortName": "HubService", + "fullName": "google.cloud.networkconnectivity.v1.HubService" + } + } + } + }, + { + "regionTag": "networkconnectivity_v1_generated_HubService_ListRoutes_async", + "title": "HubService listRoutes Sample", + "origin": "API_DEFINITION", + "description": " Lists routes in a given project.", + "canonical": true, + "file": "hub_service.list_routes.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListRoutes", + "fullName": "google.cloud.networkconnectivity.v1.HubService.ListRoutes", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networkconnectivity.v1.ListRoutesResponse", + "client": { + "shortName": "HubServiceClient", + "fullName": "google.cloud.networkconnectivity.v1.HubServiceClient" + }, + "method": { + "shortName": "ListRoutes", + "fullName": "google.cloud.networkconnectivity.v1.HubService.ListRoutes", + "service": { + "shortName": "HubService", + "fullName": "google.cloud.networkconnectivity.v1.HubService" + } + } + } + }, + { + "regionTag": "networkconnectivity_v1_generated_HubService_ListRouteTables_async", + "title": "HubService listRouteTables Sample", + "origin": "API_DEFINITION", + "description": " Lists route tables in a given project.", + "canonical": true, + "file": "hub_service.list_route_tables.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListRouteTables", + "fullName": "google.cloud.networkconnectivity.v1.HubService.ListRouteTables", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networkconnectivity.v1.ListRouteTablesResponse", + "client": { + "shortName": "HubServiceClient", + "fullName": "google.cloud.networkconnectivity.v1.HubServiceClient" + }, + "method": { + "shortName": "ListRouteTables", + "fullName": "google.cloud.networkconnectivity.v1.HubService.ListRouteTables", + "service": { + "shortName": "HubService", + "fullName": "google.cloud.networkconnectivity.v1.HubService" + } + } + } + }, + { + "regionTag": "networkconnectivity_v1_generated_HubService_GetGroup_async", + "title": "HubService getGroup Sample", + "origin": "API_DEFINITION", + "description": " Gets details about a Network Connectivity Center group.", + "canonical": true, + "file": "hub_service.get_group.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 53, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetGroup", + "fullName": "google.cloud.networkconnectivity.v1.HubService.GetGroup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networkconnectivity.v1.Group", + "client": { + "shortName": "HubServiceClient", + "fullName": "google.cloud.networkconnectivity.v1.HubServiceClient" + }, + "method": { + "shortName": "GetGroup", + "fullName": "google.cloud.networkconnectivity.v1.HubService.GetGroup", + "service": { + "shortName": "HubService", + "fullName": "google.cloud.networkconnectivity.v1.HubService" + } + } + } + }, + { + "regionTag": "networkconnectivity_v1_generated_HubService_ListGroups_async", + "title": "HubService listGroups Sample", + "origin": "API_DEFINITION", + "description": " Lists groups in a given hub.", + "canonical": true, + "file": "hub_service.list_groups.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 71, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListGroups", + "fullName": "google.cloud.networkconnectivity.v1.HubService.ListGroups", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.networkconnectivity.v1.ListGroupsResponse", + "client": { + "shortName": "HubServiceClient", + "fullName": "google.cloud.networkconnectivity.v1.HubServiceClient" + }, + "method": { + "shortName": "ListGroups", + "fullName": "google.cloud.networkconnectivity.v1.HubService.ListGroups", + "service": { + "shortName": "HubService", + "fullName": "google.cloud.networkconnectivity.v1.HubService" + } + } + } + }, { "regionTag": "networkconnectivity_v1_generated_PolicyBasedRoutingService_ListPolicyBasedRoutes_async", "title": "HubService listPolicyBasedRoutes Sample", diff --git a/packages/google-cloud-networkconnectivity/src/v1/gapic_metadata.json b/packages/google-cloud-networkconnectivity/src/v1/gapic_metadata.json index f327f4e8b54..342de1fdc38 100644 --- a/packages/google-cloud-networkconnectivity/src/v1/gapic_metadata.json +++ b/packages/google-cloud-networkconnectivity/src/v1/gapic_metadata.json @@ -20,6 +20,21 @@ "getSpoke" ] }, + "GetRouteTable": { + "methods": [ + "getRouteTable" + ] + }, + "GetRoute": { + "methods": [ + "getRoute" + ] + }, + "GetGroup": { + "methods": [ + "getGroup" + ] + }, "CreateHub": { "methods": [ "createHub" @@ -45,6 +60,16 @@ "updateSpoke" ] }, + "RejectHubSpoke": { + "methods": [ + "rejectHubSpoke" + ] + }, + "AcceptHubSpoke": { + "methods": [ + "acceptHubSpoke" + ] + }, "DeleteSpoke": { "methods": [ "deleteSpoke" @@ -57,12 +82,40 @@ "listHubsAsync" ] }, + "ListHubSpokes": { + "methods": [ + "listHubSpokes", + "listHubSpokesStream", + "listHubSpokesAsync" + ] + }, "ListSpokes": { "methods": [ "listSpokes", "listSpokesStream", "listSpokesAsync" ] + }, + "ListRoutes": { + "methods": [ + "listRoutes", + "listRoutesStream", + "listRoutesAsync" + ] + }, + "ListRouteTables": { + "methods": [ + "listRouteTables", + "listRouteTablesStream", + "listRouteTablesAsync" + ] + }, + "ListGroups": { + "methods": [ + "listGroups", + "listGroupsStream", + "listGroupsAsync" + ] } } }, @@ -79,6 +132,21 @@ "getSpoke" ] }, + "GetRouteTable": { + "methods": [ + "getRouteTable" + ] + }, + "GetRoute": { + "methods": [ + "getRoute" + ] + }, + "GetGroup": { + "methods": [ + "getGroup" + ] + }, "CreateHub": { "methods": [ "createHub" @@ -104,6 +172,16 @@ "updateSpoke" ] }, + "RejectHubSpoke": { + "methods": [ + "rejectHubSpoke" + ] + }, + "AcceptHubSpoke": { + "methods": [ + "acceptHubSpoke" + ] + }, "DeleteSpoke": { "methods": [ "deleteSpoke" @@ -116,12 +194,40 @@ "listHubsAsync" ] }, + "ListHubSpokes": { + "methods": [ + "listHubSpokes", + "listHubSpokesStream", + "listHubSpokesAsync" + ] + }, "ListSpokes": { "methods": [ "listSpokes", "listSpokesStream", "listSpokesAsync" ] + }, + "ListRoutes": { + "methods": [ + "listRoutes", + "listRoutesStream", + "listRoutesAsync" + ] + }, + "ListRouteTables": { + "methods": [ + "listRouteTables", + "listRouteTablesStream", + "listRouteTablesAsync" + ] + }, + "ListGroups": { + "methods": [ + "listGroups", + "listGroupsStream", + "listGroupsAsync" + ] } } } diff --git a/packages/google-cloud-networkconnectivity/src/v1/hub_service_client.ts b/packages/google-cloud-networkconnectivity/src/v1/hub_service_client.ts index 26c02a16f5b..9ac31ce5466 100644 --- a/packages/google-cloud-networkconnectivity/src/v1/hub_service_client.ts +++ b/packages/google-cloud-networkconnectivity/src/v1/hub_service_client.ts @@ -194,9 +194,15 @@ export class HubServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + groupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/global/hubs/{hub}/groups/{group}' + ), hubPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/global/hubs/{hub}' ), + hubRoutePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/global/hubs/{hub}/routeTables/{route_table}/routes/{route}' + ), instancePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/zones/{zone}/instances/{instance}' ), @@ -212,6 +218,9 @@ export class HubServiceClient { policyBasedRoutePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/global/PolicyBasedRoutes/{policy_based_route}' ), + routeTablePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/global/hubs/{hub}/routeTables/{route_table}' + ), spokePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/spokes/{spoke}' ), @@ -229,11 +238,31 @@ export class HubServiceClient { 'nextPageToken', 'hubs' ), + listHubSpokes: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'spokes' + ), listSpokes: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'spokes' ), + listRoutes: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'routes' + ), + listRouteTables: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'routeTables' + ), + listGroups: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'groups' + ), }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); @@ -259,6 +288,9 @@ export class HubServiceClient { selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', get: '/v1/{resource=projects/*/locations/global/hubs/*}:getIamPolicy', additional_bindings: [ + { + get: '/v1/{resource=projects/*/locations/global/hubs/*/groups/*}:getIamPolicy', + }, { get: '/v1/{resource=projects/*/locations/*/spokes/*}:getIamPolicy', }, @@ -272,6 +304,10 @@ export class HubServiceClient { post: '/v1/{resource=projects/*/locations/global/hubs/*}:setIamPolicy', body: '*', additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/global/hubs/*/groups/*}:setIamPolicy', + body: '*', + }, { post: '/v1/{resource=projects/*/locations/*/spokes/*}:setIamPolicy', body: '*', @@ -287,6 +323,10 @@ export class HubServiceClient { post: '/v1/{resource=projects/*/locations/global/hubs/*}:testIamPermissions', body: '*', additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/global/hubs/*/groups/*}:testIamPermissions', + body: '*', + }, { post: '/v1/{resource=projects/*/locations/*/spokes/*}:testIamPermissions', body: '*', @@ -349,6 +389,18 @@ export class HubServiceClient { const updateSpokeMetadata = protoFilesRoot.lookup( '.google.cloud.networkconnectivity.v1.OperationMetadata' ) as gax.protobuf.Type; + const rejectHubSpokeResponse = protoFilesRoot.lookup( + '.google.cloud.networkconnectivity.v1.RejectHubSpokeResponse' + ) as gax.protobuf.Type; + const rejectHubSpokeMetadata = protoFilesRoot.lookup( + '.google.cloud.networkconnectivity.v1.OperationMetadata' + ) as gax.protobuf.Type; + const acceptHubSpokeResponse = protoFilesRoot.lookup( + '.google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse' + ) as gax.protobuf.Type; + const acceptHubSpokeMetadata = protoFilesRoot.lookup( + '.google.cloud.networkconnectivity.v1.OperationMetadata' + ) as gax.protobuf.Type; const deleteSpokeResponse = protoFilesRoot.lookup( '.google.protobuf.Empty' ) as gax.protobuf.Type; @@ -382,6 +434,16 @@ export class HubServiceClient { updateSpokeResponse.decode.bind(updateSpokeResponse), updateSpokeMetadata.decode.bind(updateSpokeMetadata) ), + rejectHubSpoke: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + rejectHubSpokeResponse.decode.bind(rejectHubSpokeResponse), + rejectHubSpokeMetadata.decode.bind(rejectHubSpokeMetadata) + ), + acceptHubSpoke: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + acceptHubSpokeResponse.decode.bind(acceptHubSpokeResponse), + acceptHubSpokeMetadata.decode.bind(acceptHubSpokeMetadata) + ), deleteSpoke: new this._gaxModule.LongrunningDescriptor( this.operationsClient, deleteSpokeResponse.decode.bind(deleteSpokeResponse), @@ -444,11 +506,20 @@ export class HubServiceClient { 'createHub', 'updateHub', 'deleteHub', + 'listHubSpokes', 'listSpokes', 'getSpoke', 'createSpoke', 'updateSpoke', + 'rejectHubSpoke', + 'acceptHubSpoke', 'deleteSpoke', + 'getRouteTable', + 'getRoute', + 'listRoutes', + 'listRouteTables', + 'getGroup', + 'listGroups', ]; for (const methodName of hubServiceStubMethods) { const callPromise = this.hubServiceStub.then( @@ -715,6 +786,282 @@ export class HubServiceClient { this.initialize(); return this.innerApiCalls.getSpoke(request, options, callback); } + /** + * Gets details about a Network Connectivity Center route table. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the route table resource. + * @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.networkconnectivity.v1.RouteTable|RouteTable}. + * 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/hub_service.get_route_table.js + * region_tag:networkconnectivity_v1_generated_HubService_GetRouteTable_async + */ + getRouteTable( + request?: protos.google.cloud.networkconnectivity.v1.IGetRouteTableRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.networkconnectivity.v1.IRouteTable, + ( + | protos.google.cloud.networkconnectivity.v1.IGetRouteTableRequest + | undefined + ), + {} | undefined, + ] + >; + getRouteTable( + request: protos.google.cloud.networkconnectivity.v1.IGetRouteTableRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.networkconnectivity.v1.IRouteTable, + | protos.google.cloud.networkconnectivity.v1.IGetRouteTableRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getRouteTable( + request: protos.google.cloud.networkconnectivity.v1.IGetRouteTableRequest, + callback: Callback< + protos.google.cloud.networkconnectivity.v1.IRouteTable, + | protos.google.cloud.networkconnectivity.v1.IGetRouteTableRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getRouteTable( + request?: protos.google.cloud.networkconnectivity.v1.IGetRouteTableRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.networkconnectivity.v1.IRouteTable, + | protos.google.cloud.networkconnectivity.v1.IGetRouteTableRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.networkconnectivity.v1.IRouteTable, + | protos.google.cloud.networkconnectivity.v1.IGetRouteTableRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.networkconnectivity.v1.IRouteTable, + ( + | protos.google.cloud.networkconnectivity.v1.IGetRouteTableRequest + | 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({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getRouteTable(request, options, callback); + } + /** + * Gets details about the specified route. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the route resource. + * @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.networkconnectivity.v1.Route|Route}. + * 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/hub_service.get_route.js + * region_tag:networkconnectivity_v1_generated_HubService_GetRoute_async + */ + getRoute( + request?: protos.google.cloud.networkconnectivity.v1.IGetRouteRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.networkconnectivity.v1.IRoute, + protos.google.cloud.networkconnectivity.v1.IGetRouteRequest | undefined, + {} | undefined, + ] + >; + getRoute( + request: protos.google.cloud.networkconnectivity.v1.IGetRouteRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.networkconnectivity.v1.IRoute, + | protos.google.cloud.networkconnectivity.v1.IGetRouteRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getRoute( + request: protos.google.cloud.networkconnectivity.v1.IGetRouteRequest, + callback: Callback< + protos.google.cloud.networkconnectivity.v1.IRoute, + | protos.google.cloud.networkconnectivity.v1.IGetRouteRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getRoute( + request?: protos.google.cloud.networkconnectivity.v1.IGetRouteRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.networkconnectivity.v1.IRoute, + | protos.google.cloud.networkconnectivity.v1.IGetRouteRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.networkconnectivity.v1.IRoute, + | protos.google.cloud.networkconnectivity.v1.IGetRouteRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.networkconnectivity.v1.IRoute, + protos.google.cloud.networkconnectivity.v1.IGetRouteRequest | 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({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getRoute(request, options, callback); + } + /** + * Gets details about a Network Connectivity Center group. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the route table resource. + * @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.networkconnectivity.v1.Group|Group}. + * 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/hub_service.get_group.js + * region_tag:networkconnectivity_v1_generated_HubService_GetGroup_async + */ + getGroup( + request?: protos.google.cloud.networkconnectivity.v1.IGetGroupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.networkconnectivity.v1.IGroup, + protos.google.cloud.networkconnectivity.v1.IGetGroupRequest | undefined, + {} | undefined, + ] + >; + getGroup( + request: protos.google.cloud.networkconnectivity.v1.IGetGroupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.networkconnectivity.v1.IGroup, + | protos.google.cloud.networkconnectivity.v1.IGetGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getGroup( + request: protos.google.cloud.networkconnectivity.v1.IGetGroupRequest, + callback: Callback< + protos.google.cloud.networkconnectivity.v1.IGroup, + | protos.google.cloud.networkconnectivity.v1.IGetGroupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getGroup( + request?: protos.google.cloud.networkconnectivity.v1.IGetGroupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.networkconnectivity.v1.IGroup, + | protos.google.cloud.networkconnectivity.v1.IGetGroupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.networkconnectivity.v1.IGroup, + | protos.google.cloud.networkconnectivity.v1.IGetGroupRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.networkconnectivity.v1.IGroup, + protos.google.cloud.networkconnectivity.v1.IGetGroupRequest | 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({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getGroup(request, options, callback); + } /** * Creates a new Network Connectivity Center hub in the specified project. @@ -728,11 +1075,11 @@ export class HubServiceClient { * @param {google.cloud.networkconnectivity.v1.Hub} request.hub * Required. The initial values for a new hub. * @param {string} [request.requestId] - * Optional. A unique request ID (optional). If you specify this ID, you can - * use it in cases when you need to retry your request. When you need to - * retry, this ID lets the server know that it can ignore the request if it - * has already been completed. The server guarantees that for at least 60 - * minutes after the first request. + * Optional. A request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server knows to ignore the request + * if it has already been completed. The server guarantees that a request + * doesn't result in creation of duplicate commitments for at least 60 + * minutes. * * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request @@ -886,11 +1233,11 @@ export class HubServiceClient { * @param {google.cloud.networkconnectivity.v1.Hub} request.hub * Required. The state that the hub should be in after the update. * @param {string} [request.requestId] - * Optional. A unique request ID (optional). If you specify this ID, you can - * use it in cases when you need to retry your request. When you need to - * retry, this ID lets the server know that it can ignore the request if it - * has already been completed. The server guarantees that for at least 60 - * minutes after the first request. + * Optional. A request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server knows to ignore the request + * if it has already been completed. The server guarantees that a request + * doesn't result in creation of duplicate commitments for at least 60 + * minutes. * * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request @@ -1037,11 +1384,11 @@ export class HubServiceClient { * @param {string} request.name * Required. The name of the hub to delete. * @param {string} [request.requestId] - * Optional. A unique request ID (optional). If you specify this ID, you can - * use it in cases when you need to retry your request. When you need to - * retry, this ID lets the server know that it can ignore the request if it - * has already been completed. The server guarantees that for at least 60 - * minutes after the first request. + * Optional. A request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server knows to ignore the request + * if it has already been completed. The server guarantees that a request + * doesn't result in creation of duplicate commitments for at least 60 + * minutes. * * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request @@ -1192,11 +1539,11 @@ export class HubServiceClient { * @param {google.cloud.networkconnectivity.v1.Spoke} request.spoke * Required. The initial values for a new spoke. * @param {string} [request.requestId] - * Optional. A unique request ID (optional). If you specify this ID, you can - * use it in cases when you need to retry your request. When you need to - * retry, this ID lets the server know that it can ignore the request if it - * has already been completed. The server guarantees that for at least 60 - * minutes after the first request. + * Optional. A request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server knows to ignore the request + * if it has already been completed. The server guarantees that a request + * doesn't result in creation of duplicate commitments for at least 60 + * minutes. * * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request @@ -1349,11 +1696,11 @@ export class HubServiceClient { * @param {google.cloud.networkconnectivity.v1.Spoke} request.spoke * Required. The state that the spoke should be in after the update. * @param {string} [request.requestId] - * Optional. A unique request ID (optional). If you specify this ID, you can - * use it in cases when you need to retry your request. When you need to - * retry, this ID lets the server know that it can ignore the request if it - * has already been completed. The server guarantees that for at least 60 - * minutes after the first request. + * Optional. A request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server knows to ignore the request + * if it has already been completed. The server guarantees that a request + * doesn't result in creation of duplicate commitments for at least 60 + * minutes. * * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request @@ -1493,18 +1840,23 @@ export class HubServiceClient { >; } /** - * Deletes a Network Connectivity Center spoke. + * Rejects a Network Connectivity Center spoke from being attached to a hub. + * If the spoke was previously in the `ACTIVE` state, it + * transitions to the `INACTIVE` state and is no longer able to + * connect to other spokes that are attached to the hub. * * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. The name of the spoke to delete. + * Required. The name of the hub from which to reject the spoke. + * @param {string} request.spokeUri + * Required. The URI of the spoke to reject from the hub. * @param {string} [request.requestId] - * Optional. A unique request ID (optional). If you specify this ID, you can - * use it in cases when you need to retry your request. When you need to - * retry, this ID lets the server know that it can ignore the request if it - * has already been completed. The server guarantees that for at least 60 - * minutes after the first request. + * Optional. A request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server knows to ignore the request + * if it has already been completed. The server guarantees that a request + * doesn't result in creation of duplicate commitments for at least 60 + * minutes. * * For example, consider a situation where you make an initial request and * the request times out. If you make the request again with the same request @@ -1514,6 +1866,8 @@ export class HubServiceClient { * * The request ID must be a valid UUID, with the exception that zero UUID is * not supported (00000000-0000-0000-0000-000000000000). + * @param {string} [request.details] + * Optional. Additional information provided by the hub administrator. * @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. @@ -1522,52 +1876,52 @@ export class HubServiceClient { * you can `await` for. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. - * @example include:samples/generated/v1/hub_service.delete_spoke.js - * region_tag:networkconnectivity_v1_generated_HubService_DeleteSpoke_async + * @example include:samples/generated/v1/hub_service.reject_hub_spoke.js + * region_tag:networkconnectivity_v1_generated_HubService_RejectHubSpoke_async */ - deleteSpoke( - request?: protos.google.cloud.networkconnectivity.v1.IDeleteSpokeRequest, + rejectHubSpoke( + request?: protos.google.cloud.networkconnectivity.v1.IRejectHubSpokeRequest, options?: CallOptions ): Promise< [ LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.networkconnectivity.v1.IRejectHubSpokeResponse, protos.google.cloud.networkconnectivity.v1.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, {} | undefined, ] >; - deleteSpoke( - request: protos.google.cloud.networkconnectivity.v1.IDeleteSpokeRequest, + rejectHubSpoke( + request: protos.google.cloud.networkconnectivity.v1.IRejectHubSpokeRequest, options: CallOptions, callback: Callback< LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.networkconnectivity.v1.IRejectHubSpokeResponse, protos.google.cloud.networkconnectivity.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - deleteSpoke( - request: protos.google.cloud.networkconnectivity.v1.IDeleteSpokeRequest, + rejectHubSpoke( + request: protos.google.cloud.networkconnectivity.v1.IRejectHubSpokeRequest, callback: Callback< LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.networkconnectivity.v1.IRejectHubSpokeResponse, protos.google.cloud.networkconnectivity.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - deleteSpoke( - request?: protos.google.cloud.networkconnectivity.v1.IDeleteSpokeRequest, + rejectHubSpoke( + request?: protos.google.cloud.networkconnectivity.v1.IRejectHubSpokeRequest, optionsOrCallback?: | CallOptions | Callback< LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.networkconnectivity.v1.IRejectHubSpokeResponse, protos.google.cloud.networkconnectivity.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -1575,7 +1929,7 @@ export class HubServiceClient { >, callback?: Callback< LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.networkconnectivity.v1.IRejectHubSpokeResponse, protos.google.cloud.networkconnectivity.v1.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -1584,7 +1938,7 @@ export class HubServiceClient { ): Promise< [ LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.networkconnectivity.v1.IRejectHubSpokeResponse, protos.google.cloud.networkconnectivity.v1.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, @@ -1607,24 +1961,24 @@ export class HubServiceClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteSpoke(request, options, callback); + return this.innerApiCalls.rejectHubSpoke(request, options, callback); } /** - * Check the status of the long running operation returned by `deleteSpoke()`. + * Check the status of the long running operation returned by `rejectHubSpoke()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. * The decoded operation object has result and metadata field to get information from. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } * for more details and examples. - * @example include:samples/generated/v1/hub_service.delete_spoke.js - * region_tag:networkconnectivity_v1_generated_HubService_DeleteSpoke_async + * @example include:samples/generated/v1/hub_service.reject_hub_spoke.js + * region_tag:networkconnectivity_v1_generated_HubService_RejectHubSpoke_async */ - async checkDeleteSpokeProgress( + async checkRejectHubSpokeProgress( name: string ): Promise< LROperation< - protos.google.protobuf.Empty, + protos.google.cloud.networkconnectivity.v1.RejectHubSpokeResponse, protos.google.cloud.networkconnectivity.v1.OperationMetadata > > { @@ -1635,95 +1989,1234 @@ export class HubServiceClient { const [operation] = await this.operationsClient.getOperation(request); const decodeOperation = new this._gaxModule.Operation( operation, - this.descriptors.longrunning.deleteSpoke, + this.descriptors.longrunning.rejectHubSpoke, this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< - protos.google.protobuf.Empty, + protos.google.cloud.networkconnectivity.v1.RejectHubSpokeResponse, protos.google.cloud.networkconnectivity.v1.OperationMetadata >; } /** - * Lists the Network Connectivity Center hubs associated with a given project. + * Accepts a proposal to attach a Network Connectivity Center spoke + * to a hub. * * @param {Object} request * The request object that will be sent. - * @param {string} request.parent + * @param {string} request.name + * Required. The name of the hub into which to accept the spoke. + * @param {string} request.spokeUri + * Required. The URI of the spoke to accept into the hub. + * @param {string} [request.requestId] + * Optional. A request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server knows to ignore the request + * if it has already been completed. The server guarantees that a request + * doesn't result in creation of duplicate commitments for at least 60 + * minutes. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check to see whether the original operation + * was received. If it was, the server ignores the second request. This + * behavior prevents clients from mistakenly creating duplicate commitments. + * + * The request ID must be a valid UUID, with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/hub_service.accept_hub_spoke.js + * region_tag:networkconnectivity_v1_generated_HubService_AcceptHubSpoke_async + */ + acceptHubSpoke( + request?: protos.google.cloud.networkconnectivity.v1.IAcceptHubSpokeRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.networkconnectivity.v1.IAcceptHubSpokeResponse, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + acceptHubSpoke( + request: protos.google.cloud.networkconnectivity.v1.IAcceptHubSpokeRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.networkconnectivity.v1.IAcceptHubSpokeResponse, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + acceptHubSpoke( + request: protos.google.cloud.networkconnectivity.v1.IAcceptHubSpokeRequest, + callback: Callback< + LROperation< + protos.google.cloud.networkconnectivity.v1.IAcceptHubSpokeResponse, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + acceptHubSpoke( + request?: protos.google.cloud.networkconnectivity.v1.IAcceptHubSpokeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.networkconnectivity.v1.IAcceptHubSpokeResponse, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.networkconnectivity.v1.IAcceptHubSpokeResponse, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.networkconnectivity.v1.IAcceptHubSpokeResponse, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.acceptHubSpoke(request, options, callback); + } + /** + * Check the status of the long running operation returned by `acceptHubSpoke()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/hub_service.accept_hub_spoke.js + * region_tag:networkconnectivity_v1_generated_HubService_AcceptHubSpoke_async + */ + async checkAcceptHubSpokeProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse, + protos.google.cloud.networkconnectivity.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.acceptHubSpoke, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse, + protos.google.cloud.networkconnectivity.v1.OperationMetadata + >; + } + /** + * Deletes a Network Connectivity Center spoke. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the spoke to delete. + * @param {string} [request.requestId] + * Optional. A request ID to identify requests. Specify a unique request ID so + * that if you must retry your request, the server knows to ignore the request + * if it has already been completed. The server guarantees that a request + * doesn't result in creation of duplicate commitments for at least 60 + * minutes. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check to see whether the original operation + * was received. If it was, the server ignores the second request. This + * behavior prevents clients from mistakenly creating duplicate commitments. + * + * The request ID must be a valid UUID, with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @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 + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/hub_service.delete_spoke.js + * region_tag:networkconnectivity_v1_generated_HubService_DeleteSpoke_async + */ + deleteSpoke( + request?: protos.google.cloud.networkconnectivity.v1.IDeleteSpokeRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined, + ] + >; + deleteSpoke( + request: protos.google.cloud.networkconnectivity.v1.IDeleteSpokeRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteSpoke( + request: protos.google.cloud.networkconnectivity.v1.IDeleteSpokeRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteSpoke( + request?: protos.google.cloud.networkconnectivity.v1.IDeleteSpokeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | 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({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteSpoke(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteSpoke()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/hub_service.delete_spoke.js + * region_tag:networkconnectivity_v1_generated_HubService_DeleteSpoke_async + */ + async checkDeleteSpokeProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.networkconnectivity.v1.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteSpoke, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.networkconnectivity.v1.OperationMetadata + >; + } + /** + * Lists the Network Connectivity Center hubs associated with a given project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource's name. + * @param {number} request.pageSize + * The maximum number of results per page to return. + * @param {string} request.pageToken + * The page token. + * @param {string} request.filter + * An expression that filters the list of results. + * @param {string} request.orderBy + * Sort the results by a certain order. + * @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 Array of {@link protos.google.cloud.networkconnectivity.v1.Hub|Hub}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listHubsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listHubs( + request?: protos.google.cloud.networkconnectivity.v1.IListHubsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.networkconnectivity.v1.IHub[], + protos.google.cloud.networkconnectivity.v1.IListHubsRequest | null, + protos.google.cloud.networkconnectivity.v1.IListHubsResponse, + ] + >; + listHubs( + request: protos.google.cloud.networkconnectivity.v1.IListHubsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networkconnectivity.v1.IListHubsRequest, + | protos.google.cloud.networkconnectivity.v1.IListHubsResponse + | null + | undefined, + protos.google.cloud.networkconnectivity.v1.IHub + > + ): void; + listHubs( + request: protos.google.cloud.networkconnectivity.v1.IListHubsRequest, + callback: PaginationCallback< + protos.google.cloud.networkconnectivity.v1.IListHubsRequest, + | protos.google.cloud.networkconnectivity.v1.IListHubsResponse + | null + | undefined, + protos.google.cloud.networkconnectivity.v1.IHub + > + ): void; + listHubs( + request?: protos.google.cloud.networkconnectivity.v1.IListHubsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.networkconnectivity.v1.IListHubsRequest, + | protos.google.cloud.networkconnectivity.v1.IListHubsResponse + | null + | undefined, + protos.google.cloud.networkconnectivity.v1.IHub + >, + callback?: PaginationCallback< + protos.google.cloud.networkconnectivity.v1.IListHubsRequest, + | protos.google.cloud.networkconnectivity.v1.IListHubsResponse + | null + | undefined, + protos.google.cloud.networkconnectivity.v1.IHub + > + ): Promise< + [ + protos.google.cloud.networkconnectivity.v1.IHub[], + protos.google.cloud.networkconnectivity.v1.IListHubsRequest | null, + protos.google.cloud.networkconnectivity.v1.IListHubsResponse, + ] + > | 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({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listHubs(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource's name. + * @param {number} request.pageSize + * The maximum number of results per page to return. + * @param {string} request.pageToken + * The page token. + * @param {string} request.filter + * An expression that filters the list of results. + * @param {string} request.orderBy + * Sort the results by a certain order. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.networkconnectivity.v1.Hub|Hub} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listHubsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listHubsStream( + request?: protos.google.cloud.networkconnectivity.v1.IListHubsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listHubs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listHubs.createStream( + this.innerApiCalls.listHubs as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listHubs`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource's name. + * @param {number} request.pageSize + * The maximum number of results per page to return. + * @param {string} request.pageToken + * The page token. + * @param {string} request.filter + * An expression that filters the list of results. + * @param {string} request.orderBy + * Sort the results by a certain order. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.networkconnectivity.v1.Hub|Hub}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/hub_service.list_hubs.js + * region_tag:networkconnectivity_v1_generated_HubService_ListHubs_async + */ + listHubsAsync( + request?: protos.google.cloud.networkconnectivity.v1.IListHubsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listHubs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listHubs.asyncIterate( + this.innerApiCalls['listHubs'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists the Network Connectivity Center spokes associated with a + * specified hub and location. The list includes both spokes that are attached + * to the hub and spokes that have been proposed but not yet accepted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the hub. + * @param {string[]} request.spokeLocations + * A list of locations. + * Specify one of the following: `[global]`, a single region (for + * example, `[us-central1]`), or a combination of + * values (for example, `[global, us-central1, us-west1]`). + * If the spoke_locations field is populated, the list of results + * includes only spokes in the specified location. + * If the spoke_locations field is not populated, the list of results + * includes spokes in all locations. + * @param {number} request.pageSize + * The maximum number of results to return per page. + * @param {string} request.pageToken + * The page token. + * @param {string} request.filter + * An expression that filters the list of results. + * @param {string} request.orderBy + * Sort the results by name or create_time. + * @param {google.cloud.networkconnectivity.v1.ListHubSpokesRequest.SpokeView} request.view + * The view of the spoke to return. + * The view that you use determines which spoke fields are included in the + * response. + * @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 Array of {@link protos.google.cloud.networkconnectivity.v1.Spoke|Spoke}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listHubSpokesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listHubSpokes( + request?: protos.google.cloud.networkconnectivity.v1.IListHubSpokesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.networkconnectivity.v1.ISpoke[], + protos.google.cloud.networkconnectivity.v1.IListHubSpokesRequest | null, + protos.google.cloud.networkconnectivity.v1.IListHubSpokesResponse, + ] + >; + listHubSpokes( + request: protos.google.cloud.networkconnectivity.v1.IListHubSpokesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networkconnectivity.v1.IListHubSpokesRequest, + | protos.google.cloud.networkconnectivity.v1.IListHubSpokesResponse + | null + | undefined, + protos.google.cloud.networkconnectivity.v1.ISpoke + > + ): void; + listHubSpokes( + request: protos.google.cloud.networkconnectivity.v1.IListHubSpokesRequest, + callback: PaginationCallback< + protos.google.cloud.networkconnectivity.v1.IListHubSpokesRequest, + | protos.google.cloud.networkconnectivity.v1.IListHubSpokesResponse + | null + | undefined, + protos.google.cloud.networkconnectivity.v1.ISpoke + > + ): void; + listHubSpokes( + request?: protos.google.cloud.networkconnectivity.v1.IListHubSpokesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.networkconnectivity.v1.IListHubSpokesRequest, + | protos.google.cloud.networkconnectivity.v1.IListHubSpokesResponse + | null + | undefined, + protos.google.cloud.networkconnectivity.v1.ISpoke + >, + callback?: PaginationCallback< + protos.google.cloud.networkconnectivity.v1.IListHubSpokesRequest, + | protos.google.cloud.networkconnectivity.v1.IListHubSpokesResponse + | null + | undefined, + protos.google.cloud.networkconnectivity.v1.ISpoke + > + ): Promise< + [ + protos.google.cloud.networkconnectivity.v1.ISpoke[], + protos.google.cloud.networkconnectivity.v1.IListHubSpokesRequest | null, + protos.google.cloud.networkconnectivity.v1.IListHubSpokesResponse, + ] + > | 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({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.listHubSpokes(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the hub. + * @param {string[]} request.spokeLocations + * A list of locations. + * Specify one of the following: `[global]`, a single region (for + * example, `[us-central1]`), or a combination of + * values (for example, `[global, us-central1, us-west1]`). + * If the spoke_locations field is populated, the list of results + * includes only spokes in the specified location. + * If the spoke_locations field is not populated, the list of results + * includes spokes in all locations. + * @param {number} request.pageSize + * The maximum number of results to return per page. + * @param {string} request.pageToken + * The page token. + * @param {string} request.filter + * An expression that filters the list of results. + * @param {string} request.orderBy + * Sort the results by name or create_time. + * @param {google.cloud.networkconnectivity.v1.ListHubSpokesRequest.SpokeView} request.view + * The view of the spoke to return. + * The view that you use determines which spoke fields are included in the + * response. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.networkconnectivity.v1.Spoke|Spoke} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listHubSpokesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listHubSpokesStream( + request?: protos.google.cloud.networkconnectivity.v1.IListHubSpokesRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + const defaultCallSettings = this._defaults['listHubSpokes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listHubSpokes.createStream( + this.innerApiCalls.listHubSpokes as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listHubSpokes`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the hub. + * @param {string[]} request.spokeLocations + * A list of locations. + * Specify one of the following: `[global]`, a single region (for + * example, `[us-central1]`), or a combination of + * values (for example, `[global, us-central1, us-west1]`). + * If the spoke_locations field is populated, the list of results + * includes only spokes in the specified location. + * If the spoke_locations field is not populated, the list of results + * includes spokes in all locations. + * @param {number} request.pageSize + * The maximum number of results to return per page. + * @param {string} request.pageToken + * The page token. + * @param {string} request.filter + * An expression that filters the list of results. + * @param {string} request.orderBy + * Sort the results by name or create_time. + * @param {google.cloud.networkconnectivity.v1.ListHubSpokesRequest.SpokeView} request.view + * The view of the spoke to return. + * The view that you use determines which spoke fields are included in the + * response. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.networkconnectivity.v1.Spoke|Spoke}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/hub_service.list_hub_spokes.js + * region_tag:networkconnectivity_v1_generated_HubService_ListHubSpokes_async + */ + listHubSpokesAsync( + request?: protos.google.cloud.networkconnectivity.v1.IListHubSpokesRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + const defaultCallSettings = this._defaults['listHubSpokes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listHubSpokes.asyncIterate( + this.innerApiCalls['listHubSpokes'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists the Network Connectivity Center spokes in a specified project and + * location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource. + * @param {number} request.pageSize + * The maximum number of results to return per page. + * @param {string} request.pageToken + * The page token. + * @param {string} request.filter + * An expression that filters the list of results. + * @param {string} request.orderBy + * Sort the results by a certain order. + * @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 Array of {@link protos.google.cloud.networkconnectivity.v1.Spoke|Spoke}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listSpokesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSpokes( + request?: protos.google.cloud.networkconnectivity.v1.IListSpokesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.networkconnectivity.v1.ISpoke[], + protos.google.cloud.networkconnectivity.v1.IListSpokesRequest | null, + protos.google.cloud.networkconnectivity.v1.IListSpokesResponse, + ] + >; + listSpokes( + request: protos.google.cloud.networkconnectivity.v1.IListSpokesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networkconnectivity.v1.IListSpokesRequest, + | protos.google.cloud.networkconnectivity.v1.IListSpokesResponse + | null + | undefined, + protos.google.cloud.networkconnectivity.v1.ISpoke + > + ): void; + listSpokes( + request: protos.google.cloud.networkconnectivity.v1.IListSpokesRequest, + callback: PaginationCallback< + protos.google.cloud.networkconnectivity.v1.IListSpokesRequest, + | protos.google.cloud.networkconnectivity.v1.IListSpokesResponse + | null + | undefined, + protos.google.cloud.networkconnectivity.v1.ISpoke + > + ): void; + listSpokes( + request?: protos.google.cloud.networkconnectivity.v1.IListSpokesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.networkconnectivity.v1.IListSpokesRequest, + | protos.google.cloud.networkconnectivity.v1.IListSpokesResponse + | null + | undefined, + protos.google.cloud.networkconnectivity.v1.ISpoke + >, + callback?: PaginationCallback< + protos.google.cloud.networkconnectivity.v1.IListSpokesRequest, + | protos.google.cloud.networkconnectivity.v1.IListSpokesResponse + | null + | undefined, + protos.google.cloud.networkconnectivity.v1.ISpoke + > + ): Promise< + [ + protos.google.cloud.networkconnectivity.v1.ISpoke[], + protos.google.cloud.networkconnectivity.v1.IListSpokesRequest | null, + protos.google.cloud.networkconnectivity.v1.IListSpokesResponse, + ] + > | 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({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listSpokes(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource. + * @param {number} request.pageSize + * The maximum number of results to return per page. + * @param {string} request.pageToken + * The page token. + * @param {string} request.filter + * An expression that filters the list of results. + * @param {string} request.orderBy + * Sort the results by a certain order. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.networkconnectivity.v1.Spoke|Spoke} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listSpokesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listSpokesStream( + request?: protos.google.cloud.networkconnectivity.v1.IListSpokesRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSpokes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSpokes.createStream( + this.innerApiCalls.listSpokes as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listSpokes`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource. + * @param {number} request.pageSize + * The maximum number of results to return per page. + * @param {string} request.pageToken + * The page token. + * @param {string} request.filter + * An expression that filters the list of results. + * @param {string} request.orderBy + * Sort the results by a certain order. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.networkconnectivity.v1.Spoke|Spoke}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/hub_service.list_spokes.js + * region_tag:networkconnectivity_v1_generated_HubService_ListSpokes_async + */ + listSpokesAsync( + request?: protos.google.cloud.networkconnectivity.v1.IListSpokesRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSpokes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSpokes.asyncIterate( + this.innerApiCalls['listSpokes'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists routes in a given project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource's name. + * @param {number} request.pageSize + * The maximum number of results to return per page. + * @param {string} request.pageToken + * The page token. + * @param {string} request.filter + * An expression that filters the list of results. + * @param {string} request.orderBy + * Sort the results by a certain order. + * @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 Array of {@link protos.google.cloud.networkconnectivity.v1.Route|Route}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listRoutesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listRoutes( + request?: protos.google.cloud.networkconnectivity.v1.IListRoutesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.networkconnectivity.v1.IRoute[], + protos.google.cloud.networkconnectivity.v1.IListRoutesRequest | null, + protos.google.cloud.networkconnectivity.v1.IListRoutesResponse, + ] + >; + listRoutes( + request: protos.google.cloud.networkconnectivity.v1.IListRoutesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.networkconnectivity.v1.IListRoutesRequest, + | protos.google.cloud.networkconnectivity.v1.IListRoutesResponse + | null + | undefined, + protos.google.cloud.networkconnectivity.v1.IRoute + > + ): void; + listRoutes( + request: protos.google.cloud.networkconnectivity.v1.IListRoutesRequest, + callback: PaginationCallback< + protos.google.cloud.networkconnectivity.v1.IListRoutesRequest, + | protos.google.cloud.networkconnectivity.v1.IListRoutesResponse + | null + | undefined, + protos.google.cloud.networkconnectivity.v1.IRoute + > + ): void; + listRoutes( + request?: protos.google.cloud.networkconnectivity.v1.IListRoutesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.networkconnectivity.v1.IListRoutesRequest, + | protos.google.cloud.networkconnectivity.v1.IListRoutesResponse + | null + | undefined, + protos.google.cloud.networkconnectivity.v1.IRoute + >, + callback?: PaginationCallback< + protos.google.cloud.networkconnectivity.v1.IListRoutesRequest, + | protos.google.cloud.networkconnectivity.v1.IListRoutesResponse + | null + | undefined, + protos.google.cloud.networkconnectivity.v1.IRoute + > + ): Promise< + [ + protos.google.cloud.networkconnectivity.v1.IRoute[], + protos.google.cloud.networkconnectivity.v1.IListRoutesRequest | null, + protos.google.cloud.networkconnectivity.v1.IListRoutesResponse, + ] + > | 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({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listRoutes(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource's name. + * @param {number} request.pageSize + * The maximum number of results to return per page. + * @param {string} request.pageToken + * The page token. + * @param {string} request.filter + * An expression that filters the list of results. + * @param {string} request.orderBy + * Sort the results by a certain order. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing {@link protos.google.cloud.networkconnectivity.v1.Route|Route} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listRoutesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + */ + listRoutesStream( + request?: protos.google.cloud.networkconnectivity.v1.IListRoutesRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listRoutes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRoutes.createStream( + this.innerApiCalls.listRoutes as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listRoutes`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource's name. + * @param {number} request.pageSize + * The maximum number of results to return per page. + * @param {string} request.pageToken + * The page token. + * @param {string} request.filter + * An expression that filters the list of results. + * @param {string} request.orderBy + * Sort the results by a certain order. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link protos.google.cloud.networkconnectivity.v1.Route|Route}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example include:samples/generated/v1/hub_service.list_routes.js + * region_tag:networkconnectivity_v1_generated_HubService_ListRoutes_async + */ + listRoutesAsync( + request?: protos.google.cloud.networkconnectivity.v1.IListRoutesRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listRoutes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listRoutes.asyncIterate( + this.innerApiCalls['listRoutes'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists route tables in a given project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent * Required. The parent resource's name. * @param {number} request.pageSize - * The maximum number of results per page that should be returned. + * The maximum number of results to return per page. * @param {string} request.pageToken * The page token. * @param {string} request.filter - * An expression that filters the results listed in the response. + * An expression that filters the list of results. * @param {string} request.orderBy * Sort the results by a certain order. * @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 Array of {@link protos.google.cloud.networkconnectivity.v1.Hub|Hub}. + * The first element of the array is Array of {@link protos.google.cloud.networkconnectivity.v1.RouteTable|RouteTable}. * The client library will perform auto-pagination by default: it will call the API as many * times as needed and will merge results from all the pages into this array. * Note that it can affect your quota. - * We recommend using `listHubsAsync()` + * We recommend using `listRouteTablesAsync()` * method described below for async iteration which you can stop as needed. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ - listHubs( - request?: protos.google.cloud.networkconnectivity.v1.IListHubsRequest, + listRouteTables( + request?: protos.google.cloud.networkconnectivity.v1.IListRouteTablesRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.networkconnectivity.v1.IHub[], - protos.google.cloud.networkconnectivity.v1.IListHubsRequest | null, - protos.google.cloud.networkconnectivity.v1.IListHubsResponse, + protos.google.cloud.networkconnectivity.v1.IRouteTable[], + protos.google.cloud.networkconnectivity.v1.IListRouteTablesRequest | null, + protos.google.cloud.networkconnectivity.v1.IListRouteTablesResponse, ] >; - listHubs( - request: protos.google.cloud.networkconnectivity.v1.IListHubsRequest, + listRouteTables( + request: protos.google.cloud.networkconnectivity.v1.IListRouteTablesRequest, options: CallOptions, callback: PaginationCallback< - protos.google.cloud.networkconnectivity.v1.IListHubsRequest, - | protos.google.cloud.networkconnectivity.v1.IListHubsResponse + protos.google.cloud.networkconnectivity.v1.IListRouteTablesRequest, + | protos.google.cloud.networkconnectivity.v1.IListRouteTablesResponse | null | undefined, - protos.google.cloud.networkconnectivity.v1.IHub + protos.google.cloud.networkconnectivity.v1.IRouteTable > ): void; - listHubs( - request: protos.google.cloud.networkconnectivity.v1.IListHubsRequest, + listRouteTables( + request: protos.google.cloud.networkconnectivity.v1.IListRouteTablesRequest, callback: PaginationCallback< - protos.google.cloud.networkconnectivity.v1.IListHubsRequest, - | protos.google.cloud.networkconnectivity.v1.IListHubsResponse + protos.google.cloud.networkconnectivity.v1.IListRouteTablesRequest, + | protos.google.cloud.networkconnectivity.v1.IListRouteTablesResponse | null | undefined, - protos.google.cloud.networkconnectivity.v1.IHub + protos.google.cloud.networkconnectivity.v1.IRouteTable > ): void; - listHubs( - request?: protos.google.cloud.networkconnectivity.v1.IListHubsRequest, + listRouteTables( + request?: protos.google.cloud.networkconnectivity.v1.IListRouteTablesRequest, optionsOrCallback?: | CallOptions | PaginationCallback< - protos.google.cloud.networkconnectivity.v1.IListHubsRequest, - | protos.google.cloud.networkconnectivity.v1.IListHubsResponse + protos.google.cloud.networkconnectivity.v1.IListRouteTablesRequest, + | protos.google.cloud.networkconnectivity.v1.IListRouteTablesResponse | null | undefined, - protos.google.cloud.networkconnectivity.v1.IHub + protos.google.cloud.networkconnectivity.v1.IRouteTable >, callback?: PaginationCallback< - protos.google.cloud.networkconnectivity.v1.IListHubsRequest, - | protos.google.cloud.networkconnectivity.v1.IListHubsResponse + protos.google.cloud.networkconnectivity.v1.IListRouteTablesRequest, + | protos.google.cloud.networkconnectivity.v1.IListRouteTablesResponse | null | undefined, - protos.google.cloud.networkconnectivity.v1.IHub + protos.google.cloud.networkconnectivity.v1.IRouteTable > ): Promise< [ - protos.google.cloud.networkconnectivity.v1.IHub[], - protos.google.cloud.networkconnectivity.v1.IListHubsRequest | null, - protos.google.cloud.networkconnectivity.v1.IListHubsResponse, + protos.google.cloud.networkconnectivity.v1.IRouteTable[], + protos.google.cloud.networkconnectivity.v1.IListRouteTablesRequest | null, + protos.google.cloud.networkconnectivity.v1.IListRouteTablesResponse, ] > | void { request = request || {}; @@ -1742,7 +3235,7 @@ export class HubServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listHubs(request, options, callback); + return this.innerApiCalls.listRouteTables(request, options, callback); } /** @@ -1752,26 +3245,26 @@ export class HubServiceClient { * @param {string} request.parent * Required. The parent resource's name. * @param {number} request.pageSize - * The maximum number of results per page that should be returned. + * The maximum number of results to return per page. * @param {string} request.pageToken * The page token. * @param {string} request.filter - * An expression that filters the results listed in the response. + * An expression that filters the list of results. * @param {string} request.orderBy * Sort the results by a certain order. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.networkconnectivity.v1.Hub|Hub} on 'data' event. + * An object stream which emits an object representing {@link protos.google.cloud.networkconnectivity.v1.RouteTable|RouteTable} on 'data' event. * The client library will perform auto-pagination by default: it will call the API as many * times as needed. Note that it can affect your quota. - * We recommend using `listHubsAsync()` + * We recommend using `listRouteTablesAsync()` * method described below for async iteration which you can stop as needed. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ - listHubsStream( - request?: protos.google.cloud.networkconnectivity.v1.IListHubsRequest, + listRouteTablesStream( + request?: protos.google.cloud.networkconnectivity.v1.IListRouteTablesRequest, options?: CallOptions ): Transform { request = request || {}; @@ -1782,18 +3275,18 @@ export class HubServiceClient { this._gaxModule.routingHeader.fromParams({ parent: request.parent ?? '', }); - const defaultCallSettings = this._defaults['listHubs']; + const defaultCallSettings = this._defaults['listRouteTables']; const callSettings = defaultCallSettings.merge(options); this.initialize(); - return this.descriptors.page.listHubs.createStream( - this.innerApiCalls.listHubs as GaxCall, + return this.descriptors.page.listRouteTables.createStream( + this.innerApiCalls.listRouteTables as GaxCall, request, callSettings ); } /** - * Equivalent to `listHubs`, but returns an iterable object. + * Equivalent to `listRouteTables`, but returns an iterable object. * * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request @@ -1801,11 +3294,11 @@ export class HubServiceClient { * @param {string} request.parent * Required. The parent resource's name. * @param {number} request.pageSize - * The maximum number of results per page that should be returned. + * The maximum number of results to return per page. * @param {string} request.pageToken * The page token. * @param {string} request.filter - * An expression that filters the results listed in the response. + * An expression that filters the list of results. * @param {string} request.orderBy * Sort the results by a certain order. * @param {object} [options] @@ -1813,17 +3306,17 @@ export class HubServiceClient { * @returns {Object} * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.networkconnectivity.v1.Hub|Hub}. The API will be called under the hood as needed, once per the page, + * {@link protos.google.cloud.networkconnectivity.v1.RouteTable|RouteTable}. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. - * @example include:samples/generated/v1/hub_service.list_hubs.js - * region_tag:networkconnectivity_v1_generated_HubService_ListHubs_async + * @example include:samples/generated/v1/hub_service.list_route_tables.js + * region_tag:networkconnectivity_v1_generated_HubService_ListRouteTables_async */ - listHubsAsync( - request?: protos.google.cloud.networkconnectivity.v1.IListHubsRequest, + listRouteTablesAsync( + request?: protos.google.cloud.networkconnectivity.v1.IListRouteTablesRequest, options?: CallOptions - ): AsyncIterable { + ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1832,97 +3325,96 @@ export class HubServiceClient { this._gaxModule.routingHeader.fromParams({ parent: request.parent ?? '', }); - const defaultCallSettings = this._defaults['listHubs']; + const defaultCallSettings = this._defaults['listRouteTables']; const callSettings = defaultCallSettings.merge(options); this.initialize(); - return this.descriptors.page.listHubs.asyncIterate( - this.innerApiCalls['listHubs'] as GaxCall, + return this.descriptors.page.listRouteTables.asyncIterate( + this.innerApiCalls['listRouteTables'] as GaxCall, request as {}, callSettings - ) as AsyncIterable; + ) as AsyncIterable; } /** - * Lists the Network Connectivity Center spokes in a specified project and - * location. + * Lists groups in a given hub. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent resource. + * Required. The parent resource's name. * @param {number} request.pageSize - * The maximum number of results per page that should be returned. + * The maximum number of results to return per page. * @param {string} request.pageToken * The page token. * @param {string} request.filter - * An expression that filters the results listed in the response. + * An expression that filters the list of results. * @param {string} request.orderBy * Sort the results by a certain order. * @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 Array of {@link protos.google.cloud.networkconnectivity.v1.Spoke|Spoke}. + * The first element of the array is Array of {@link protos.google.cloud.networkconnectivity.v1.Group|Group}. * The client library will perform auto-pagination by default: it will call the API as many * times as needed and will merge results from all the pages into this array. * Note that it can affect your quota. - * We recommend using `listSpokesAsync()` + * We recommend using `listGroupsAsync()` * method described below for async iteration which you can stop as needed. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ - listSpokes( - request?: protos.google.cloud.networkconnectivity.v1.IListSpokesRequest, + listGroups( + request?: protos.google.cloud.networkconnectivity.v1.IListGroupsRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.networkconnectivity.v1.ISpoke[], - protos.google.cloud.networkconnectivity.v1.IListSpokesRequest | null, - protos.google.cloud.networkconnectivity.v1.IListSpokesResponse, + protos.google.cloud.networkconnectivity.v1.IGroup[], + protos.google.cloud.networkconnectivity.v1.IListGroupsRequest | null, + protos.google.cloud.networkconnectivity.v1.IListGroupsResponse, ] >; - listSpokes( - request: protos.google.cloud.networkconnectivity.v1.IListSpokesRequest, + listGroups( + request: protos.google.cloud.networkconnectivity.v1.IListGroupsRequest, options: CallOptions, callback: PaginationCallback< - protos.google.cloud.networkconnectivity.v1.IListSpokesRequest, - | protos.google.cloud.networkconnectivity.v1.IListSpokesResponse + protos.google.cloud.networkconnectivity.v1.IListGroupsRequest, + | protos.google.cloud.networkconnectivity.v1.IListGroupsResponse | null | undefined, - protos.google.cloud.networkconnectivity.v1.ISpoke + protos.google.cloud.networkconnectivity.v1.IGroup > ): void; - listSpokes( - request: protos.google.cloud.networkconnectivity.v1.IListSpokesRequest, + listGroups( + request: protos.google.cloud.networkconnectivity.v1.IListGroupsRequest, callback: PaginationCallback< - protos.google.cloud.networkconnectivity.v1.IListSpokesRequest, - | protos.google.cloud.networkconnectivity.v1.IListSpokesResponse + protos.google.cloud.networkconnectivity.v1.IListGroupsRequest, + | protos.google.cloud.networkconnectivity.v1.IListGroupsResponse | null | undefined, - protos.google.cloud.networkconnectivity.v1.ISpoke + protos.google.cloud.networkconnectivity.v1.IGroup > ): void; - listSpokes( - request?: protos.google.cloud.networkconnectivity.v1.IListSpokesRequest, + listGroups( + request?: protos.google.cloud.networkconnectivity.v1.IListGroupsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< - protos.google.cloud.networkconnectivity.v1.IListSpokesRequest, - | protos.google.cloud.networkconnectivity.v1.IListSpokesResponse + protos.google.cloud.networkconnectivity.v1.IListGroupsRequest, + | protos.google.cloud.networkconnectivity.v1.IListGroupsResponse | null | undefined, - protos.google.cloud.networkconnectivity.v1.ISpoke + protos.google.cloud.networkconnectivity.v1.IGroup >, callback?: PaginationCallback< - protos.google.cloud.networkconnectivity.v1.IListSpokesRequest, - | protos.google.cloud.networkconnectivity.v1.IListSpokesResponse + protos.google.cloud.networkconnectivity.v1.IListGroupsRequest, + | protos.google.cloud.networkconnectivity.v1.IListGroupsResponse | null | undefined, - protos.google.cloud.networkconnectivity.v1.ISpoke + protos.google.cloud.networkconnectivity.v1.IGroup > ): Promise< [ - protos.google.cloud.networkconnectivity.v1.ISpoke[], - protos.google.cloud.networkconnectivity.v1.IListSpokesRequest | null, - protos.google.cloud.networkconnectivity.v1.IListSpokesResponse, + protos.google.cloud.networkconnectivity.v1.IGroup[], + protos.google.cloud.networkconnectivity.v1.IListGroupsRequest | null, + protos.google.cloud.networkconnectivity.v1.IListGroupsResponse, ] > | void { request = request || {}; @@ -1941,7 +3433,7 @@ export class HubServiceClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listSpokes(request, options, callback); + return this.innerApiCalls.listGroups(request, options, callback); } /** @@ -1949,28 +3441,28 @@ export class HubServiceClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent resource. + * Required. The parent resource's name. * @param {number} request.pageSize - * The maximum number of results per page that should be returned. + * The maximum number of results to return per page. * @param {string} request.pageToken * The page token. * @param {string} request.filter - * An expression that filters the results listed in the response. + * An expression that filters the list of results. * @param {string} request.orderBy * Sort the results by a certain order. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Stream} - * An object stream which emits an object representing {@link protos.google.cloud.networkconnectivity.v1.Spoke|Spoke} on 'data' event. + * An object stream which emits an object representing {@link protos.google.cloud.networkconnectivity.v1.Group|Group} on 'data' event. * The client library will perform auto-pagination by default: it will call the API as many * times as needed. Note that it can affect your quota. - * We recommend using `listSpokesAsync()` + * We recommend using `listGroupsAsync()` * method described below for async iteration which you can stop as needed. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. */ - listSpokesStream( - request?: protos.google.cloud.networkconnectivity.v1.IListSpokesRequest, + listGroupsStream( + request?: protos.google.cloud.networkconnectivity.v1.IListGroupsRequest, options?: CallOptions ): Transform { request = request || {}; @@ -1981,30 +3473,30 @@ export class HubServiceClient { this._gaxModule.routingHeader.fromParams({ parent: request.parent ?? '', }); - const defaultCallSettings = this._defaults['listSpokes']; + const defaultCallSettings = this._defaults['listGroups']; const callSettings = defaultCallSettings.merge(options); this.initialize(); - return this.descriptors.page.listSpokes.createStream( - this.innerApiCalls.listSpokes as GaxCall, + return this.descriptors.page.listGroups.createStream( + this.innerApiCalls.listGroups as GaxCall, request, callSettings ); } /** - * Equivalent to `listSpokes`, but returns an iterable object. + * Equivalent to `listGroups`, but returns an iterable object. * * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The parent resource. + * Required. The parent resource's name. * @param {number} request.pageSize - * The maximum number of results per page that should be returned. + * The maximum number of results to return per page. * @param {string} request.pageToken * The page token. * @param {string} request.filter - * An expression that filters the results listed in the response. + * An expression that filters the list of results. * @param {string} request.orderBy * Sort the results by a certain order. * @param {object} [options] @@ -2012,17 +3504,17 @@ export class HubServiceClient { * @returns {Object} * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. * When you iterate the returned iterable, each element will be an object representing - * {@link protos.google.cloud.networkconnectivity.v1.Spoke|Spoke}. The API will be called under the hood as needed, once per the page, + * {@link protos.google.cloud.networkconnectivity.v1.Group|Group}. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } * for more details and examples. - * @example include:samples/generated/v1/hub_service.list_spokes.js - * region_tag:networkconnectivity_v1_generated_HubService_ListSpokes_async + * @example include:samples/generated/v1/hub_service.list_groups.js + * region_tag:networkconnectivity_v1_generated_HubService_ListGroups_async */ - listSpokesAsync( - request?: protos.google.cloud.networkconnectivity.v1.IListSpokesRequest, + listGroupsAsync( + request?: protos.google.cloud.networkconnectivity.v1.IListGroupsRequest, options?: CallOptions - ): AsyncIterable { + ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -2031,14 +3523,14 @@ export class HubServiceClient { this._gaxModule.routingHeader.fromParams({ parent: request.parent ?? '', }); - const defaultCallSettings = this._defaults['listSpokes']; + const defaultCallSettings = this._defaults['listGroups']; const callSettings = defaultCallSettings.merge(options); this.initialize(); - return this.descriptors.page.listSpokes.asyncIterate( - this.innerApiCalls['listSpokes'] as GaxCall, + return this.descriptors.page.listGroups.asyncIterate( + this.innerApiCalls['listGroups'] as GaxCall, request as {}, callSettings - ) as AsyncIterable; + ) as AsyncIterable; } /** * Gets the access control policy for a resource. Returns an empty policy @@ -2435,6 +3927,55 @@ export class HubServiceClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified group resource name string. + * + * @param {string} project + * @param {string} hub + * @param {string} group + * @returns {string} Resource name string. + */ + groupPath(project: string, hub: string, group: string) { + return this.pathTemplates.groupPathTemplate.render({ + project: project, + hub: hub, + group: group, + }); + } + + /** + * Parse the project from Group resource. + * + * @param {string} groupName + * A fully-qualified path representing Group resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGroupName(groupName: string) { + return this.pathTemplates.groupPathTemplate.match(groupName).project; + } + + /** + * Parse the hub from Group resource. + * + * @param {string} groupName + * A fully-qualified path representing Group resource. + * @returns {string} A string representing the hub. + */ + matchHubFromGroupName(groupName: string) { + return this.pathTemplates.groupPathTemplate.match(groupName).hub; + } + + /** + * Parse the group from Group resource. + * + * @param {string} groupName + * A fully-qualified path representing Group resource. + * @returns {string} A string representing the group. + */ + matchGroupFromGroupName(groupName: string) { + return this.pathTemplates.groupPathTemplate.match(groupName).group; + } + /** * Return a fully-qualified hub resource name string. * @@ -2471,6 +4012,74 @@ export class HubServiceClient { return this.pathTemplates.hubPathTemplate.match(hubName).hub; } + /** + * Return a fully-qualified hubRoute resource name string. + * + * @param {string} project + * @param {string} hub + * @param {string} route_table + * @param {string} route + * @returns {string} Resource name string. + */ + hubRoutePath( + project: string, + hub: string, + routeTable: string, + route: string + ) { + return this.pathTemplates.hubRoutePathTemplate.render({ + project: project, + hub: hub, + route_table: routeTable, + route: route, + }); + } + + /** + * Parse the project from HubRoute resource. + * + * @param {string} hubRouteName + * A fully-qualified path representing HubRoute resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHubRouteName(hubRouteName: string) { + return this.pathTemplates.hubRoutePathTemplate.match(hubRouteName).project; + } + + /** + * Parse the hub from HubRoute resource. + * + * @param {string} hubRouteName + * A fully-qualified path representing HubRoute resource. + * @returns {string} A string representing the hub. + */ + matchHubFromHubRouteName(hubRouteName: string) { + return this.pathTemplates.hubRoutePathTemplate.match(hubRouteName).hub; + } + + /** + * Parse the route_table from HubRoute resource. + * + * @param {string} hubRouteName + * A fully-qualified path representing HubRoute resource. + * @returns {string} A string representing the route_table. + */ + matchRouteTableFromHubRouteName(hubRouteName: string) { + return this.pathTemplates.hubRoutePathTemplate.match(hubRouteName) + .route_table; + } + + /** + * Parse the route from HubRoute resource. + * + * @param {string} hubRouteName + * A fully-qualified path representing HubRoute resource. + * @returns {string} A string representing the route. + */ + matchRouteFromHubRouteName(hubRouteName: string) { + return this.pathTemplates.hubRoutePathTemplate.match(hubRouteName).route; + } + /** * Return a fully-qualified instance resource name string. * @@ -2698,6 +4307,57 @@ export class HubServiceClient { ).policy_based_route; } + /** + * Return a fully-qualified routeTable resource name string. + * + * @param {string} project + * @param {string} hub + * @param {string} route_table + * @returns {string} Resource name string. + */ + routeTablePath(project: string, hub: string, routeTable: string) { + return this.pathTemplates.routeTablePathTemplate.render({ + project: project, + hub: hub, + route_table: routeTable, + }); + } + + /** + * Parse the project from RouteTable resource. + * + * @param {string} routeTableName + * A fully-qualified path representing RouteTable resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRouteTableName(routeTableName: string) { + return this.pathTemplates.routeTablePathTemplate.match(routeTableName) + .project; + } + + /** + * Parse the hub from RouteTable resource. + * + * @param {string} routeTableName + * A fully-qualified path representing RouteTable resource. + * @returns {string} A string representing the hub. + */ + matchHubFromRouteTableName(routeTableName: string) { + return this.pathTemplates.routeTablePathTemplate.match(routeTableName).hub; + } + + /** + * Parse the route_table from RouteTable resource. + * + * @param {string} routeTableName + * A fully-qualified path representing RouteTable resource. + * @returns {string} A string representing the route_table. + */ + matchRouteTableFromRouteTableName(routeTableName: string) { + return this.pathTemplates.routeTablePathTemplate.match(routeTableName) + .route_table; + } + /** * Return a fully-qualified spoke resource name string. * diff --git a/packages/google-cloud-networkconnectivity/src/v1/hub_service_client_config.json b/packages/google-cloud-networkconnectivity/src/v1/hub_service_client_config.json index 068f769fc14..70055357500 100644 --- a/packages/google-cloud-networkconnectivity/src/v1/hub_service_client_config.json +++ b/packages/google-cloud-networkconnectivity/src/v1/hub_service_client_config.json @@ -57,6 +57,11 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "ListHubSpokes": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, "ListSpokes": { "timeout_millis": 60000, "retry_codes_name": "unavailable", @@ -77,10 +82,50 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "RejectHubSpoke": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "AcceptHubSpoke": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, "DeleteSpoke": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "GetRouteTable": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetRoute": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListRoutes": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListRouteTables": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetGroup": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListGroups": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" } } } diff --git a/packages/google-cloud-networkconnectivity/src/v1/policy_based_routing_service_client.ts b/packages/google-cloud-networkconnectivity/src/v1/policy_based_routing_service_client.ts index adee43d09d9..d666873993d 100644 --- a/packages/google-cloud-networkconnectivity/src/v1/policy_based_routing_service_client.ts +++ b/packages/google-cloud-networkconnectivity/src/v1/policy_based_routing_service_client.ts @@ -194,9 +194,15 @@ export class PolicyBasedRoutingServiceClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + groupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/global/hubs/{hub}/groups/{group}' + ), hubPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/global/hubs/{hub}' ), + hubRoutePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/global/hubs/{hub}/routeTables/{route_table}/routes/{route}' + ), locationPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}' ), @@ -206,6 +212,9 @@ export class PolicyBasedRoutingServiceClient { policyBasedRoutePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/global/PolicyBasedRoutes/{policy_based_route}' ), + routeTablePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/global/hubs/{hub}/routeTables/{route_table}' + ), spokePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/spokes/{spoke}' ), @@ -245,6 +254,9 @@ export class PolicyBasedRoutingServiceClient { selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', get: '/v1/{resource=projects/*/locations/global/hubs/*}:getIamPolicy', additional_bindings: [ + { + get: '/v1/{resource=projects/*/locations/global/hubs/*/groups/*}:getIamPolicy', + }, { get: '/v1/{resource=projects/*/locations/*/spokes/*}:getIamPolicy', }, @@ -258,6 +270,10 @@ export class PolicyBasedRoutingServiceClient { post: '/v1/{resource=projects/*/locations/global/hubs/*}:setIamPolicy', body: '*', additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/global/hubs/*/groups/*}:setIamPolicy', + body: '*', + }, { post: '/v1/{resource=projects/*/locations/*/spokes/*}:setIamPolicy', body: '*', @@ -273,6 +289,10 @@ export class PolicyBasedRoutingServiceClient { post: '/v1/{resource=projects/*/locations/global/hubs/*}:testIamPermissions', body: '*', additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/global/hubs/*/groups/*}:testIamPermissions', + body: '*', + }, { post: '/v1/{resource=projects/*/locations/*/spokes/*}:testIamPermissions', body: '*', @@ -1482,6 +1502,55 @@ export class PolicyBasedRoutingServiceClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified group resource name string. + * + * @param {string} project + * @param {string} hub + * @param {string} group + * @returns {string} Resource name string. + */ + groupPath(project: string, hub: string, group: string) { + return this.pathTemplates.groupPathTemplate.render({ + project: project, + hub: hub, + group: group, + }); + } + + /** + * Parse the project from Group resource. + * + * @param {string} groupName + * A fully-qualified path representing Group resource. + * @returns {string} A string representing the project. + */ + matchProjectFromGroupName(groupName: string) { + return this.pathTemplates.groupPathTemplate.match(groupName).project; + } + + /** + * Parse the hub from Group resource. + * + * @param {string} groupName + * A fully-qualified path representing Group resource. + * @returns {string} A string representing the hub. + */ + matchHubFromGroupName(groupName: string) { + return this.pathTemplates.groupPathTemplate.match(groupName).hub; + } + + /** + * Parse the group from Group resource. + * + * @param {string} groupName + * A fully-qualified path representing Group resource. + * @returns {string} A string representing the group. + */ + matchGroupFromGroupName(groupName: string) { + return this.pathTemplates.groupPathTemplate.match(groupName).group; + } + /** * Return a fully-qualified hub resource name string. * @@ -1518,6 +1587,74 @@ export class PolicyBasedRoutingServiceClient { return this.pathTemplates.hubPathTemplate.match(hubName).hub; } + /** + * Return a fully-qualified hubRoute resource name string. + * + * @param {string} project + * @param {string} hub + * @param {string} route_table + * @param {string} route + * @returns {string} Resource name string. + */ + hubRoutePath( + project: string, + hub: string, + routeTable: string, + route: string + ) { + return this.pathTemplates.hubRoutePathTemplate.render({ + project: project, + hub: hub, + route_table: routeTable, + route: route, + }); + } + + /** + * Parse the project from HubRoute resource. + * + * @param {string} hubRouteName + * A fully-qualified path representing HubRoute resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHubRouteName(hubRouteName: string) { + return this.pathTemplates.hubRoutePathTemplate.match(hubRouteName).project; + } + + /** + * Parse the hub from HubRoute resource. + * + * @param {string} hubRouteName + * A fully-qualified path representing HubRoute resource. + * @returns {string} A string representing the hub. + */ + matchHubFromHubRouteName(hubRouteName: string) { + return this.pathTemplates.hubRoutePathTemplate.match(hubRouteName).hub; + } + + /** + * Parse the route_table from HubRoute resource. + * + * @param {string} hubRouteName + * A fully-qualified path representing HubRoute resource. + * @returns {string} A string representing the route_table. + */ + matchRouteTableFromHubRouteName(hubRouteName: string) { + return this.pathTemplates.hubRoutePathTemplate.match(hubRouteName) + .route_table; + } + + /** + * Parse the route from HubRoute resource. + * + * @param {string} hubRouteName + * A fully-qualified path representing HubRoute resource. + * @returns {string} A string representing the route. + */ + matchRouteFromHubRouteName(hubRouteName: string) { + return this.pathTemplates.hubRoutePathTemplate.match(hubRouteName).route; + } + /** * Return a fully-qualified location resource name string. * @@ -1631,6 +1768,57 @@ export class PolicyBasedRoutingServiceClient { ).policy_based_route; } + /** + * Return a fully-qualified routeTable resource name string. + * + * @param {string} project + * @param {string} hub + * @param {string} route_table + * @returns {string} Resource name string. + */ + routeTablePath(project: string, hub: string, routeTable: string) { + return this.pathTemplates.routeTablePathTemplate.render({ + project: project, + hub: hub, + route_table: routeTable, + }); + } + + /** + * Parse the project from RouteTable resource. + * + * @param {string} routeTableName + * A fully-qualified path representing RouteTable resource. + * @returns {string} A string representing the project. + */ + matchProjectFromRouteTableName(routeTableName: string) { + return this.pathTemplates.routeTablePathTemplate.match(routeTableName) + .project; + } + + /** + * Parse the hub from RouteTable resource. + * + * @param {string} routeTableName + * A fully-qualified path representing RouteTable resource. + * @returns {string} A string representing the hub. + */ + matchHubFromRouteTableName(routeTableName: string) { + return this.pathTemplates.routeTablePathTemplate.match(routeTableName).hub; + } + + /** + * Parse the route_table from RouteTable resource. + * + * @param {string} routeTableName + * A fully-qualified path representing RouteTable resource. + * @returns {string} A string representing the route_table. + */ + matchRouteTableFromRouteTableName(routeTableName: string) { + return this.pathTemplates.routeTablePathTemplate.match(routeTableName) + .route_table; + } + /** * Return a fully-qualified spoke resource name string. * diff --git a/packages/google-cloud-networkconnectivity/test/gapic_hub_service_v1.ts b/packages/google-cloud-networkconnectivity/test/gapic_hub_service_v1.ts index b6c5a65bae8..222664bf84e 100644 --- a/packages/google-cloud-networkconnectivity/test/gapic_hub_service_v1.ts +++ b/packages/google-cloud-networkconnectivity/test/gapic_hub_service_v1.ts @@ -517,68 +517,64 @@ describe('v1.HubServiceClient', () => { }); }); - describe('createHub', () => { - it('invokes createHub without error', async () => { + describe('getRouteTable', () => { + it('invokes getRouteTable without error', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.CreateHubRequest() + new protos.google.cloud.networkconnectivity.v1.GetRouteTableRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.CreateHubRequest', - ['parent'] + '.google.cloud.networkconnectivity.v1.GetRouteTableRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.networkconnectivity.v1.RouteTable() ); - client.innerApiCalls.createHub = stubLongRunningCall(expectedResponse); - const [operation] = await client.createHub(request); - const [response] = await operation.promise(); + client.innerApiCalls.getRouteTable = stubSimpleCall(expectedResponse); + const [response] = await client.getRouteTable(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createHub as SinonStub + client.innerApiCalls.getRouteTable as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createHub as SinonStub + client.innerApiCalls.getRouteTable as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createHub without error using callback', async () => { + it('invokes getRouteTable without error using callback', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.CreateHubRequest() + new protos.google.cloud.networkconnectivity.v1.GetRouteTableRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.CreateHubRequest', - ['parent'] + '.google.cloud.networkconnectivity.v1.GetRouteTableRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.networkconnectivity.v1.RouteTable() ); - client.innerApiCalls.createHub = - stubLongRunningCallWithCallback(expectedResponse); + client.innerApiCalls.getRouteTable = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.createHub( + client.getRouteTable( request, ( err?: Error | null, - result?: LROperation< - protos.google.cloud.networkconnectivity.v1.IHub, - protos.google.cloud.networkconnectivity.v1.IOperationMetadata - > | null + result?: protos.google.cloud.networkconnectivity.v1.IRouteTable | null ) => { if (err) { reject(err); @@ -588,189 +584,127 @@ describe('v1.HubServiceClient', () => { } ); }); - const operation = (await promise) as LROperation< - protos.google.cloud.networkconnectivity.v1.IHub, - protos.google.cloud.networkconnectivity.v1.IOperationMetadata - >; - const [response] = await operation.promise(); + const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createHub as SinonStub + client.innerApiCalls.getRouteTable as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createHub as SinonStub + client.innerApiCalls.getRouteTable as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createHub with call error', async () => { + it('invokes getRouteTable with error', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.CreateHubRequest() + new protos.google.cloud.networkconnectivity.v1.GetRouteTableRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.CreateHubRequest', - ['parent'] + '.google.cloud.networkconnectivity.v1.GetRouteTableRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createHub = stubLongRunningCall( + client.innerApiCalls.getRouteTable = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.createHub(request), expectedError); + await assert.rejects(client.getRouteTable(request), expectedError); const actualRequest = ( - client.innerApiCalls.createHub as SinonStub + client.innerApiCalls.getRouteTable as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createHub as SinonStub + client.innerApiCalls.getRouteTable as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createHub with LRO error', async () => { + it('invokes getRouteTable with closed client', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.CreateHubRequest() + new protos.google.cloud.networkconnectivity.v1.GetRouteTableRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.CreateHubRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.createHub = stubLongRunningCall( - undefined, - undefined, - expectedError - ); - const [operation] = await client.createHub(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = ( - client.innerApiCalls.createHub as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.createHub as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateHubProgress without error', async () => { - const client = new hubserviceModule.v1.HubServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateHubProgress( - expectedResponse.name - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateHubProgress with error', async () => { - const client = new hubserviceModule.v1.HubServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError + '.google.cloud.networkconnectivity.v1.GetRouteTableRequest', + ['name'] ); - await assert.rejects(client.checkCreateHubProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getRouteTable(request), expectedError); }); }); - describe('updateHub', () => { - it('invokes updateHub without error', async () => { + describe('getRoute', () => { + it('invokes getRoute without error', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.UpdateHubRequest() + new protos.google.cloud.networkconnectivity.v1.GetRouteRequest() ); - request.hub ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.UpdateHubRequest', - ['hub', 'name'] + '.google.cloud.networkconnectivity.v1.GetRouteRequest', + ['name'] ); - request.hub.name = defaultValue1; - const expectedHeaderRequestParams = `hub.name=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.networkconnectivity.v1.Route() ); - client.innerApiCalls.updateHub = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateHub(request); - const [response] = await operation.promise(); + client.innerApiCalls.getRoute = stubSimpleCall(expectedResponse); + const [response] = await client.getRoute(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateHub as SinonStub + client.innerApiCalls.getRoute as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateHub as SinonStub + client.innerApiCalls.getRoute as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateHub without error using callback', async () => { + it('invokes getRoute without error using callback', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.UpdateHubRequest() + new protos.google.cloud.networkconnectivity.v1.GetRouteRequest() ); - request.hub ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.UpdateHubRequest', - ['hub', 'name'] + '.google.cloud.networkconnectivity.v1.GetRouteRequest', + ['name'] ); - request.hub.name = defaultValue1; - const expectedHeaderRequestParams = `hub.name=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.networkconnectivity.v1.Route() ); - client.innerApiCalls.updateHub = - stubLongRunningCallWithCallback(expectedResponse); + client.innerApiCalls.getRoute = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.updateHub( + client.getRoute( request, ( err?: Error | null, - result?: LROperation< - protos.google.cloud.networkconnectivity.v1.IHub, - protos.google.cloud.networkconnectivity.v1.IOperationMetadata - > | null + result?: protos.google.cloud.networkconnectivity.v1.IRoute | null ) => { if (err) { reject(err); @@ -780,189 +714,124 @@ describe('v1.HubServiceClient', () => { } ); }); - const operation = (await promise) as LROperation< - protos.google.cloud.networkconnectivity.v1.IHub, - protos.google.cloud.networkconnectivity.v1.IOperationMetadata - >; - const [response] = await operation.promise(); + const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateHub as SinonStub + client.innerApiCalls.getRoute as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateHub as SinonStub + client.innerApiCalls.getRoute as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateHub with call error', async () => { + it('invokes getRoute with error', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.UpdateHubRequest() + new protos.google.cloud.networkconnectivity.v1.GetRouteRequest() ); - request.hub ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.UpdateHubRequest', - ['hub', 'name'] + '.google.cloud.networkconnectivity.v1.GetRouteRequest', + ['name'] ); - request.hub.name = defaultValue1; - const expectedHeaderRequestParams = `hub.name=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.updateHub = stubLongRunningCall( - undefined, - expectedError - ); - await assert.rejects(client.updateHub(request), expectedError); + client.innerApiCalls.getRoute = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getRoute(request), expectedError); const actualRequest = ( - client.innerApiCalls.updateHub as SinonStub + client.innerApiCalls.getRoute as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateHub as SinonStub + client.innerApiCalls.getRoute as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateHub with LRO error', async () => { + it('invokes getRoute with closed client', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.UpdateHubRequest() + new protos.google.cloud.networkconnectivity.v1.GetRouteRequest() ); - request.hub ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.UpdateHubRequest', - ['hub', 'name'] - ); - request.hub.name = defaultValue1; - const expectedHeaderRequestParams = `hub.name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateHub = stubLongRunningCall( - undefined, - undefined, - expectedError - ); - const [operation] = await client.updateHub(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = ( - client.innerApiCalls.updateHub as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.updateHub as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateHubProgress without error', async () => { - const client = new hubserviceModule.v1.HubServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateHubProgress( - expectedResponse.name - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateHubProgress with error', async () => { - const client = new hubserviceModule.v1.HubServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError + '.google.cloud.networkconnectivity.v1.GetRouteRequest', + ['name'] ); - await assert.rejects(client.checkUpdateHubProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getRoute(request), expectedError); }); }); - describe('deleteHub', () => { - it('invokes deleteHub without error', async () => { + describe('getGroup', () => { + it('invokes getGroup without error', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.DeleteHubRequest() + new protos.google.cloud.networkconnectivity.v1.GetGroupRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.DeleteHubRequest', + '.google.cloud.networkconnectivity.v1.GetGroupRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.networkconnectivity.v1.Group() ); - client.innerApiCalls.deleteHub = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteHub(request); - const [response] = await operation.promise(); + client.innerApiCalls.getGroup = stubSimpleCall(expectedResponse); + const [response] = await client.getGroup(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteHub as SinonStub + client.innerApiCalls.getGroup as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteHub as SinonStub + client.innerApiCalls.getGroup as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteHub without error using callback', async () => { + it('invokes getGroup without error using callback', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.DeleteHubRequest() + new protos.google.cloud.networkconnectivity.v1.GetGroupRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.DeleteHubRequest', + '.google.cloud.networkconnectivity.v1.GetGroupRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + new protos.google.cloud.networkconnectivity.v1.Group() ); - client.innerApiCalls.deleteHub = - stubLongRunningCallWithCallback(expectedResponse); + client.innerApiCalls.getGroup = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.deleteHub( + client.getGroup( request, ( err?: Error | null, - result?: LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.networkconnectivity.v1.IOperationMetadata - > | null + result?: protos.google.cloud.networkconnectivity.v1.IGroup | null ) => { if (err) { reject(err); @@ -972,137 +841,78 @@ describe('v1.HubServiceClient', () => { } ); }); - const operation = (await promise) as LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.networkconnectivity.v1.IOperationMetadata - >; - const [response] = await operation.promise(); + const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteHub as SinonStub + client.innerApiCalls.getGroup as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteHub as SinonStub + client.innerApiCalls.getGroup as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteHub with call error', async () => { + it('invokes getGroup with error', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.DeleteHubRequest() + new protos.google.cloud.networkconnectivity.v1.GetGroupRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.DeleteHubRequest', + '.google.cloud.networkconnectivity.v1.GetGroupRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteHub = stubLongRunningCall( - undefined, - expectedError - ); - await assert.rejects(client.deleteHub(request), expectedError); + client.innerApiCalls.getGroup = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getGroup(request), expectedError); const actualRequest = ( - client.innerApiCalls.deleteHub as SinonStub + client.innerApiCalls.getGroup as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteHub as SinonStub + client.innerApiCalls.getGroup as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteHub with LRO error', async () => { + it('invokes getGroup with closed client', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.DeleteHubRequest() + new protos.google.cloud.networkconnectivity.v1.GetGroupRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.DeleteHubRequest', + '.google.cloud.networkconnectivity.v1.GetGroupRequest', ['name'] ); request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteHub = stubLongRunningCall( - undefined, - undefined, - expectedError - ); - const [operation] = await client.deleteHub(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = ( - client.innerApiCalls.deleteHub as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteHub as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteHubProgress without error', async () => { - const client = new hubserviceModule.v1.HubServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() - ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteHubProgress( - expectedResponse.name - ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteHubProgress with error', async () => { - const client = new hubserviceModule.v1.HubServiceClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( - undefined, - expectedError - ); - await assert.rejects(client.checkDeleteHubProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getGroup(request), expectedError); }); }); - describe('createSpoke', () => { - it('invokes createSpoke without error', async () => { + describe('createHub', () => { + it('invokes createHub without error', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.CreateSpokeRequest() + new protos.google.cloud.networkconnectivity.v1.CreateHubRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.CreateSpokeRequest', + '.google.cloud.networkconnectivity.v1.CreateHubRequest', ['parent'] ); request.parent = defaultValue1; @@ -1110,31 +920,31 @@ describe('v1.HubServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createSpoke = stubLongRunningCall(expectedResponse); - const [operation] = await client.createSpoke(request); + client.innerApiCalls.createHub = stubLongRunningCall(expectedResponse); + const [operation] = await client.createHub(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createSpoke as SinonStub + client.innerApiCalls.createHub as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createSpoke as SinonStub + client.innerApiCalls.createHub as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createSpoke without error using callback', async () => { + it('invokes createHub without error using callback', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.CreateSpokeRequest() + new protos.google.cloud.networkconnectivity.v1.CreateHubRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.CreateSpokeRequest', + '.google.cloud.networkconnectivity.v1.CreateHubRequest', ['parent'] ); request.parent = defaultValue1; @@ -1142,15 +952,15 @@ describe('v1.HubServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createSpoke = + client.innerApiCalls.createHub = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.createSpoke( + client.createHub( request, ( err?: Error | null, result?: LROperation< - protos.google.cloud.networkconnectivity.v1.ISpoke, + protos.google.cloud.networkconnectivity.v1.IHub, protos.google.cloud.networkconnectivity.v1.IOperationMetadata > | null ) => { @@ -1163,86 +973,86 @@ describe('v1.HubServiceClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.networkconnectivity.v1.ISpoke, + protos.google.cloud.networkconnectivity.v1.IHub, protos.google.cloud.networkconnectivity.v1.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createSpoke as SinonStub + client.innerApiCalls.createHub as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createSpoke as SinonStub + client.innerApiCalls.createHub as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createSpoke with call error', async () => { + it('invokes createHub with call error', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.CreateSpokeRequest() + new protos.google.cloud.networkconnectivity.v1.CreateHubRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.CreateSpokeRequest', + '.google.cloud.networkconnectivity.v1.CreateHubRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createSpoke = stubLongRunningCall( + client.innerApiCalls.createHub = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.createSpoke(request), expectedError); + await assert.rejects(client.createHub(request), expectedError); const actualRequest = ( - client.innerApiCalls.createSpoke as SinonStub + client.innerApiCalls.createHub as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createSpoke as SinonStub + client.innerApiCalls.createHub as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createSpoke with LRO error', async () => { + it('invokes createHub with LRO error', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.CreateSpokeRequest() + new protos.google.cloud.networkconnectivity.v1.CreateHubRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.CreateSpokeRequest', + '.google.cloud.networkconnectivity.v1.CreateHubRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createSpoke = stubLongRunningCall( + client.innerApiCalls.createHub = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.createSpoke(request); + const [operation] = await client.createHub(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.createSpoke as SinonStub + client.innerApiCalls.createHub as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createSpoke as SinonStub + client.innerApiCalls.createHub as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkCreateSpokeProgress without error', async () => { + it('invokes checkCreateHubProgress without error', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1256,7 +1066,7 @@ describe('v1.HubServiceClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateSpokeProgress( + const decodedOperation = await client.checkCreateHubProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -1264,7 +1074,7 @@ describe('v1.HubServiceClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkCreateSpokeProgress with error', async () => { + it('invokes checkCreateHubProgress with error', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1276,73 +1086,73 @@ describe('v1.HubServiceClient', () => { undefined, expectedError ); - await assert.rejects(client.checkCreateSpokeProgress(''), expectedError); + await assert.rejects(client.checkCreateHubProgress(''), expectedError); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('updateSpoke', () => { - it('invokes updateSpoke without error', async () => { + describe('updateHub', () => { + it('invokes updateHub without error', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.UpdateSpokeRequest() + new protos.google.cloud.networkconnectivity.v1.UpdateHubRequest() ); - request.spoke ??= {}; + request.hub ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.UpdateSpokeRequest', - ['spoke', 'name'] + '.google.cloud.networkconnectivity.v1.UpdateHubRequest', + ['hub', 'name'] ); - request.spoke.name = defaultValue1; - const expectedHeaderRequestParams = `spoke.name=${defaultValue1}`; + request.hub.name = defaultValue1; + const expectedHeaderRequestParams = `hub.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateSpoke = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateSpoke(request); + client.innerApiCalls.updateHub = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateHub(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateSpoke as SinonStub + client.innerApiCalls.updateHub as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateSpoke as SinonStub + client.innerApiCalls.updateHub as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateSpoke without error using callback', async () => { + it('invokes updateHub without error using callback', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.UpdateSpokeRequest() + new protos.google.cloud.networkconnectivity.v1.UpdateHubRequest() ); - request.spoke ??= {}; + request.hub ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.UpdateSpokeRequest', - ['spoke', 'name'] + '.google.cloud.networkconnectivity.v1.UpdateHubRequest', + ['hub', 'name'] ); - request.spoke.name = defaultValue1; - const expectedHeaderRequestParams = `spoke.name=${defaultValue1}`; + request.hub.name = defaultValue1; + const expectedHeaderRequestParams = `hub.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateSpoke = + client.innerApiCalls.updateHub = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.updateSpoke( + client.updateHub( request, ( err?: Error | null, result?: LROperation< - protos.google.cloud.networkconnectivity.v1.ISpoke, + protos.google.cloud.networkconnectivity.v1.IHub, protos.google.cloud.networkconnectivity.v1.IOperationMetadata > | null ) => { @@ -1355,88 +1165,88 @@ describe('v1.HubServiceClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.networkconnectivity.v1.ISpoke, + protos.google.cloud.networkconnectivity.v1.IHub, protos.google.cloud.networkconnectivity.v1.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateSpoke as SinonStub + client.innerApiCalls.updateHub as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateSpoke as SinonStub + client.innerApiCalls.updateHub as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateSpoke with call error', async () => { + it('invokes updateHub with call error', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.UpdateSpokeRequest() + new protos.google.cloud.networkconnectivity.v1.UpdateHubRequest() ); - request.spoke ??= {}; + request.hub ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.UpdateSpokeRequest', - ['spoke', 'name'] + '.google.cloud.networkconnectivity.v1.UpdateHubRequest', + ['hub', 'name'] ); - request.spoke.name = defaultValue1; - const expectedHeaderRequestParams = `spoke.name=${defaultValue1}`; + request.hub.name = defaultValue1; + const expectedHeaderRequestParams = `hub.name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.updateSpoke = stubLongRunningCall( + client.innerApiCalls.updateHub = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.updateSpoke(request), expectedError); + await assert.rejects(client.updateHub(request), expectedError); const actualRequest = ( - client.innerApiCalls.updateSpoke as SinonStub + client.innerApiCalls.updateHub as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateSpoke as SinonStub + client.innerApiCalls.updateHub as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateSpoke with LRO error', async () => { + it('invokes updateHub with LRO error', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.UpdateSpokeRequest() + new protos.google.cloud.networkconnectivity.v1.UpdateHubRequest() ); - request.spoke ??= {}; + request.hub ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.UpdateSpokeRequest', - ['spoke', 'name'] + '.google.cloud.networkconnectivity.v1.UpdateHubRequest', + ['hub', 'name'] ); - request.spoke.name = defaultValue1; - const expectedHeaderRequestParams = `spoke.name=${defaultValue1}`; + request.hub.name = defaultValue1; + const expectedHeaderRequestParams = `hub.name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.updateSpoke = stubLongRunningCall( + client.innerApiCalls.updateHub = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.updateSpoke(request); + const [operation] = await client.updateHub(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.updateSpoke as SinonStub + client.innerApiCalls.updateHub as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateSpoke as SinonStub + client.innerApiCalls.updateHub as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkUpdateSpokeProgress without error', async () => { + it('invokes checkUpdateHubProgress without error', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1450,7 +1260,7 @@ describe('v1.HubServiceClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateSpokeProgress( + const decodedOperation = await client.checkUpdateHubProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -1458,7 +1268,7 @@ describe('v1.HubServiceClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkUpdateSpokeProgress with error', async () => { + it('invokes checkUpdateHubProgress with error', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', @@ -1470,23 +1280,23 @@ describe('v1.HubServiceClient', () => { undefined, expectedError ); - await assert.rejects(client.checkUpdateSpokeProgress(''), expectedError); + await assert.rejects(client.checkUpdateHubProgress(''), expectedError); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('deleteSpoke', () => { - it('invokes deleteSpoke without error', async () => { + describe('deleteHub', () => { + it('invokes deleteHub without error', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.DeleteSpokeRequest() + new protos.google.cloud.networkconnectivity.v1.DeleteHubRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.DeleteSpokeRequest', + '.google.cloud.networkconnectivity.v1.DeleteHubRequest', ['name'] ); request.name = defaultValue1; @@ -1494,49 +1304,2197 @@ describe('v1.HubServiceClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteSpoke = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteSpoke(request); + client.innerApiCalls.deleteHub = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteHub(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteSpoke as SinonStub + client.innerApiCalls.deleteHub as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteSpoke as SinonStub + client.innerApiCalls.deleteHub as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteSpoke without error using callback', async () => { + it('invokes deleteHub without error using callback', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.DeleteHubRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.DeleteHubRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteHub = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteHub( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteHub as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteHub as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteHub with call error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.DeleteHubRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.DeleteHubRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteHub = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteHub(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteHub as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteHub as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteHub with LRO error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.DeleteHubRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.DeleteHubRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteHub = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteHub(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteHub as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteHub as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteHubProgress without error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteHubProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteHubProgress with error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkDeleteHubProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createSpoke', () => { + it('invokes createSpoke without error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.CreateSpokeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.CreateSpokeRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createSpoke = stubLongRunningCall(expectedResponse); + const [operation] = await client.createSpoke(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSpoke as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSpoke as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSpoke without error using callback', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.CreateSpokeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.CreateSpokeRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createSpoke = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createSpoke( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.networkconnectivity.v1.ISpoke, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.networkconnectivity.v1.ISpoke, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createSpoke as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSpoke as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSpoke with call error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.CreateSpokeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.CreateSpokeRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSpoke = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createSpoke(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createSpoke as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSpoke as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createSpoke with LRO error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.CreateSpokeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.CreateSpokeRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createSpoke = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createSpoke(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createSpoke as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createSpoke as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateSpokeProgress without error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateSpokeProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateSpokeProgress with error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkCreateSpokeProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateSpoke', () => { + it('invokes updateSpoke without error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.UpdateSpokeRequest() + ); + request.spoke ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.UpdateSpokeRequest', + ['spoke', 'name'] + ); + request.spoke.name = defaultValue1; + const expectedHeaderRequestParams = `spoke.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateSpoke = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateSpoke(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSpoke as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSpoke as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSpoke without error using callback', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.UpdateSpokeRequest() + ); + request.spoke ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.UpdateSpokeRequest', + ['spoke', 'name'] + ); + request.spoke.name = defaultValue1; + const expectedHeaderRequestParams = `spoke.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateSpoke = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSpoke( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.networkconnectivity.v1.ISpoke, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.networkconnectivity.v1.ISpoke, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSpoke as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSpoke as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSpoke with call error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.UpdateSpokeRequest() + ); + request.spoke ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.UpdateSpokeRequest', + ['spoke', 'name'] + ); + request.spoke.name = defaultValue1; + const expectedHeaderRequestParams = `spoke.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSpoke = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateSpoke(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateSpoke as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSpoke as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSpoke with LRO error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.UpdateSpokeRequest() + ); + request.spoke ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.UpdateSpokeRequest', + ['spoke', 'name'] + ); + request.spoke.name = defaultValue1; + const expectedHeaderRequestParams = `spoke.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSpoke = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateSpoke(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateSpoke as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSpoke as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateSpokeProgress without error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateSpokeProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateSpokeProgress with error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkUpdateSpokeProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('rejectHubSpoke', () => { + it('invokes rejectHubSpoke without error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.RejectHubSpokeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.RejectHubSpokeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.rejectHubSpoke = + stubLongRunningCall(expectedResponse); + const [operation] = await client.rejectHubSpoke(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.rejectHubSpoke as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rejectHubSpoke as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rejectHubSpoke without error using callback', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.RejectHubSpokeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.RejectHubSpokeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.rejectHubSpoke = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.rejectHubSpoke( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.networkconnectivity.v1.IRejectHubSpokeResponse, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.networkconnectivity.v1.IRejectHubSpokeResponse, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.rejectHubSpoke as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rejectHubSpoke as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rejectHubSpoke with call error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.RejectHubSpokeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.RejectHubSpokeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.rejectHubSpoke = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.rejectHubSpoke(request), expectedError); + const actualRequest = ( + client.innerApiCalls.rejectHubSpoke as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rejectHubSpoke as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes rejectHubSpoke with LRO error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.RejectHubSpokeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.RejectHubSpokeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.rejectHubSpoke = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.rejectHubSpoke(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.rejectHubSpoke as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.rejectHubSpoke as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRejectHubSpokeProgress without error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkRejectHubSpokeProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRejectHubSpokeProgress with error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkRejectHubSpokeProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('acceptHubSpoke', () => { + it('invokes acceptHubSpoke without error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.acceptHubSpoke = + stubLongRunningCall(expectedResponse); + const [operation] = await client.acceptHubSpoke(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.acceptHubSpoke as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.acceptHubSpoke as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes acceptHubSpoke without error using callback', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.acceptHubSpoke = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.acceptHubSpoke( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.networkconnectivity.v1.IAcceptHubSpokeResponse, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.networkconnectivity.v1.IAcceptHubSpokeResponse, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.acceptHubSpoke as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.acceptHubSpoke as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes acceptHubSpoke with call error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.acceptHubSpoke = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.acceptHubSpoke(request), expectedError); + const actualRequest = ( + client.innerApiCalls.acceptHubSpoke as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.acceptHubSpoke as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes acceptHubSpoke with LRO error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.AcceptHubSpokeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.acceptHubSpoke = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.acceptHubSpoke(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.acceptHubSpoke as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.acceptHubSpoke as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkAcceptHubSpokeProgress without error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkAcceptHubSpokeProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkAcceptHubSpokeProgress with error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkAcceptHubSpokeProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteSpoke', () => { + it('invokes deleteSpoke without error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.DeleteSpokeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.DeleteSpokeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteSpoke = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteSpoke(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSpoke as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSpoke as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSpoke without error using callback', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.DeleteSpokeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.DeleteSpokeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteSpoke = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteSpoke( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.networkconnectivity.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteSpoke as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSpoke as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSpoke with call error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.DeleteSpokeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.DeleteSpokeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSpoke = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteSpoke(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteSpoke as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSpoke as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteSpoke with LRO error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.DeleteSpokeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.DeleteSpokeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteSpoke = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteSpoke(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteSpoke as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteSpoke as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteSpokeProgress without error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteSpokeProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteSpokeProgress with error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.checkDeleteSpokeProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listHubs', () => { + it('invokes listHubs without error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.ListHubsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.ListHubsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Hub() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Hub() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Hub() + ), + ]; + client.innerApiCalls.listHubs = stubSimpleCall(expectedResponse); + const [response] = await client.listHubs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listHubs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listHubs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listHubs without error using callback', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.ListHubsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.ListHubsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Hub() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Hub() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Hub() + ), + ]; + client.innerApiCalls.listHubs = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listHubs( + request, + ( + err?: Error | null, + result?: protos.google.cloud.networkconnectivity.v1.IHub[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listHubs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listHubs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listHubs with error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.ListHubsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.ListHubsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listHubs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listHubs(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listHubs as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listHubs as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listHubsStream without error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.ListHubsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.ListHubsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Hub() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Hub() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Hub() + ), + ]; + client.descriptors.page.listHubs.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listHubsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networkconnectivity.v1.Hub[] = []; + stream.on( + 'data', + (response: protos.google.cloud.networkconnectivity.v1.Hub) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listHubs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listHubs, request) + ); + assert( + (client.descriptors.page.listHubs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listHubsStream with error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.ListHubsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.ListHubsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listHubs.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listHubsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networkconnectivity.v1.Hub[] = []; + stream.on( + 'data', + (response: protos.google.cloud.networkconnectivity.v1.Hub) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listHubs.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listHubs, request) + ); + assert( + (client.descriptors.page.listHubs.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listHubs without error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.ListHubsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.ListHubsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Hub() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Hub() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Hub() + ), + ]; + client.descriptors.page.listHubs.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networkconnectivity.v1.IHub[] = []; + const iterable = client.listHubsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listHubs.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert( + (client.descriptors.page.listHubs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listHubs with error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.ListHubsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.ListHubsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listHubs.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listHubsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networkconnectivity.v1.IHub[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listHubs.asyncIterate as SinonStub).getCall(0) + .args[1], + request + ); + assert( + (client.descriptors.page.listHubs.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listHubSpokes', () => { + it('invokes listHubSpokes without error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.ListHubSpokesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.ListHubSpokesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Spoke() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Spoke() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Spoke() + ), + ]; + client.innerApiCalls.listHubSpokes = stubSimpleCall(expectedResponse); + const [response] = await client.listHubSpokes(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listHubSpokes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listHubSpokes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listHubSpokes without error using callback', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.ListHubSpokesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.ListHubSpokesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Spoke() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Spoke() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Spoke() + ), + ]; + client.innerApiCalls.listHubSpokes = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listHubSpokes( + request, + ( + err?: Error | null, + result?: protos.google.cloud.networkconnectivity.v1.ISpoke[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listHubSpokes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listHubSpokes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listHubSpokes with error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.ListHubSpokesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.ListHubSpokesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listHubSpokes = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listHubSpokes(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listHubSpokes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listHubSpokes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listHubSpokesStream without error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.ListHubSpokesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.ListHubSpokesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Spoke() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Spoke() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Spoke() + ), + ]; + client.descriptors.page.listHubSpokes.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listHubSpokesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networkconnectivity.v1.Spoke[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.networkconnectivity.v1.Spoke) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listHubSpokes.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listHubSpokes, request) + ); + assert( + (client.descriptors.page.listHubSpokes.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listHubSpokesStream with error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.ListHubSpokesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.ListHubSpokesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listHubSpokes.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listHubSpokesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networkconnectivity.v1.Spoke[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.networkconnectivity.v1.Spoke) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listHubSpokes.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listHubSpokes, request) + ); + assert( + (client.descriptors.page.listHubSpokes.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listHubSpokes without error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.ListHubSpokesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.ListHubSpokesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Spoke() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Spoke() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Spoke() + ), + ]; + client.descriptors.page.listHubSpokes.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networkconnectivity.v1.ISpoke[] = []; + const iterable = client.listHubSpokesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listHubSpokes.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listHubSpokes.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listHubSpokes with error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.ListHubSpokesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.ListHubSpokesRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listHubSpokes.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listHubSpokesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networkconnectivity.v1.ISpoke[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listHubSpokes.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listHubSpokes.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listSpokes', () => { + it('invokes listSpokes without error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.ListSpokesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.ListSpokesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Spoke() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Spoke() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Spoke() + ), + ]; + client.innerApiCalls.listSpokes = stubSimpleCall(expectedResponse); + const [response] = await client.listSpokes(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSpokes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSpokes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSpokes without error using callback', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.ListSpokesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.ListSpokesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Spoke() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Spoke() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Spoke() + ), + ]; + client.innerApiCalls.listSpokes = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSpokes( + request, + ( + err?: Error | null, + result?: protos.google.cloud.networkconnectivity.v1.ISpoke[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSpokes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSpokes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSpokes with error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.ListSpokesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.ListSpokesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSpokes = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listSpokes(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listSpokes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSpokes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSpokesStream without error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.ListSpokesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.ListSpokesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Spoke() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Spoke() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Spoke() + ), + ]; + client.descriptors.page.listSpokes.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listSpokesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networkconnectivity.v1.Spoke[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.networkconnectivity.v1.Spoke) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listSpokes.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSpokes, request) + ); + assert( + (client.descriptors.page.listSpokes.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSpokesStream with error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.ListSpokesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.ListSpokesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSpokes.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listSpokesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networkconnectivity.v1.Spoke[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.networkconnectivity.v1.Spoke) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listSpokes.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSpokes, request) + ); + assert( + (client.descriptors.page.listSpokes.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSpokes without error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.ListSpokesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.ListSpokesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Spoke() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Spoke() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Spoke() + ), + ]; + client.descriptors.page.listSpokes.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networkconnectivity.v1.ISpoke[] = []; + const iterable = client.listSpokesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSpokes.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listSpokes.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSpokes with error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.ListSpokesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.ListSpokesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSpokes.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listSpokesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networkconnectivity.v1.ISpoke[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSpokes.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listSpokes.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listRoutes', () => { + it('invokes listRoutes without error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.ListRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.ListRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Route() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Route() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Route() + ), + ]; + client.innerApiCalls.listRoutes = stubSimpleCall(expectedResponse); + const [response] = await client.listRoutes(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listRoutes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listRoutes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listRoutes without error using callback', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.DeleteSpokeRequest() + new protos.google.cloud.networkconnectivity.v1.ListRoutesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.DeleteSpokeRequest', - ['name'] - ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() + '.google.cloud.networkconnectivity.v1.ListRoutesRequest', + ['parent'] ); - client.innerApiCalls.deleteSpoke = - stubLongRunningCallWithCallback(expectedResponse); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Route() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Route() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Route() + ), + ]; + client.innerApiCalls.listRoutes = + stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.deleteSpoke( + client.listRoutes( request, ( err?: Error | null, - result?: LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.networkconnectivity.v1.IOperationMetadata - > | null + result?: protos.google.cloud.networkconnectivity.v1.IRoute[] | null ) => { if (err) { reject(err); @@ -1546,199 +3504,331 @@ describe('v1.HubServiceClient', () => { } ); }); - const operation = (await promise) as LROperation< - protos.google.protobuf.IEmpty, - protos.google.cloud.networkconnectivity.v1.IOperationMetadata - >; - const [response] = await operation.promise(); + const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteSpoke as SinonStub + client.innerApiCalls.listRoutes as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteSpoke as SinonStub + client.innerApiCalls.listRoutes as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteSpoke with call error', async () => { + it('invokes listRoutes with error', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.DeleteSpokeRequest() + new protos.google.cloud.networkconnectivity.v1.ListRoutesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.DeleteSpokeRequest', - ['name'] + '.google.cloud.networkconnectivity.v1.ListRoutesRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteSpoke = stubLongRunningCall( + client.innerApiCalls.listRoutes = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.deleteSpoke(request), expectedError); + await assert.rejects(client.listRoutes(request), expectedError); const actualRequest = ( - client.innerApiCalls.deleteSpoke as SinonStub + client.innerApiCalls.listRoutes as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteSpoke as SinonStub + client.innerApiCalls.listRoutes as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteSpoke with LRO error', async () => { + it('invokes listRoutesStream without error', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.DeleteSpokeRequest() + new protos.google.cloud.networkconnectivity.v1.ListRoutesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.DeleteSpokeRequest', - ['name'] + '.google.cloud.networkconnectivity.v1.ListRoutesRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Route() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Route() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Route() + ), + ]; + client.descriptors.page.listRoutes.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listRoutesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networkconnectivity.v1.Route[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.networkconnectivity.v1.Route) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listRoutes.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listRoutes, request) + ); + assert( + (client.descriptors.page.listRoutes.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listRoutesStream with error', async () => { + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.ListRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.ListRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteSpoke = stubLongRunningCall( - undefined, + client.descriptors.page.listRoutes.createStream = stubPageStreamingCall( undefined, expectedError ); - const [operation] = await client.deleteSpoke(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = ( - client.innerApiCalls.deleteSpoke as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.deleteSpoke as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + const stream = client.listRoutesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.networkconnectivity.v1.Route[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.networkconnectivity.v1.Route) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listRoutes.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listRoutes, request) + ); + assert( + (client.descriptors.page.listRoutes.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); }); - it('invokes checkDeleteSpokeProgress without error', async () => { + it('uses async iteration with listRoutes without error', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - const expectedResponse = generateSampleMessage( - new operationsProtos.google.longrunning.Operation() + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.ListRoutesRequest() ); - expectedResponse.name = 'test'; - expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; - expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; - - client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteSpokeProgress( - expectedResponse.name + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.ListRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Route() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Route() + ), + generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.Route() + ), + ]; + client.descriptors.page.listRoutes.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.networkconnectivity.v1.IRoute[] = []; + const iterable = client.listRoutesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listRoutes.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listRoutes.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkDeleteSpokeProgress with error', async () => { + it('uses async iteration with listRoutes with error', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.networkconnectivity.v1.ListRoutesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.networkconnectivity.v1.ListRoutesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - - client.operationsClient.getOperation = stubSimpleCall( + client.descriptors.page.listRoutes.asyncIterate = stubAsyncIterationCall( undefined, expectedError ); - await assert.rejects(client.checkDeleteSpokeProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + const iterable = client.listRoutesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.networkconnectivity.v1.IRoute[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listRoutes.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listRoutes.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); }); }); - describe('listHubs', () => { - it('invokes listHubs without error', async () => { + describe('listRouteTables', () => { + it('invokes listRouteTables without error', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.ListHubsRequest() + new protos.google.cloud.networkconnectivity.v1.ListRouteTablesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.ListHubsRequest', + '.google.cloud.networkconnectivity.v1.ListRouteTablesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.Hub() + new protos.google.cloud.networkconnectivity.v1.RouteTable() ), generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.Hub() + new protos.google.cloud.networkconnectivity.v1.RouteTable() ), generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.Hub() + new protos.google.cloud.networkconnectivity.v1.RouteTable() ), ]; - client.innerApiCalls.listHubs = stubSimpleCall(expectedResponse); - const [response] = await client.listHubs(request); + client.innerApiCalls.listRouteTables = stubSimpleCall(expectedResponse); + const [response] = await client.listRouteTables(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listHubs as SinonStub + client.innerApiCalls.listRouteTables as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listHubs as SinonStub + client.innerApiCalls.listRouteTables as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listHubs without error using callback', async () => { + it('invokes listRouteTables without error using callback', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.ListHubsRequest() + new protos.google.cloud.networkconnectivity.v1.ListRouteTablesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.ListHubsRequest', + '.google.cloud.networkconnectivity.v1.ListRouteTablesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.Hub() + new protos.google.cloud.networkconnectivity.v1.RouteTable() ), generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.Hub() + new protos.google.cloud.networkconnectivity.v1.RouteTable() ), generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.Hub() + new protos.google.cloud.networkconnectivity.v1.RouteTable() ), ]; - client.innerApiCalls.listHubs = + client.innerApiCalls.listRouteTables = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listHubs( + client.listRouteTables( request, ( err?: Error | null, - result?: protos.google.cloud.networkconnectivity.v1.IHub[] | null + result?: + | protos.google.cloud.networkconnectivity.v1.IRouteTable[] + | null ) => { if (err) { reject(err); @@ -1751,77 +3841,81 @@ describe('v1.HubServiceClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listHubs as SinonStub + client.innerApiCalls.listRouteTables as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listHubs as SinonStub + client.innerApiCalls.listRouteTables as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listHubs with error', async () => { + it('invokes listRouteTables with error', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.ListHubsRequest() + new protos.google.cloud.networkconnectivity.v1.ListRouteTablesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.ListHubsRequest', + '.google.cloud.networkconnectivity.v1.ListRouteTablesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.listHubs = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listHubs(request), expectedError); + client.innerApiCalls.listRouteTables = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listRouteTables(request), expectedError); const actualRequest = ( - client.innerApiCalls.listHubs as SinonStub + client.innerApiCalls.listRouteTables as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listHubs as SinonStub + client.innerApiCalls.listRouteTables as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listHubsStream without error', async () => { + it('invokes listRouteTablesStream without error', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.ListHubsRequest() + new protos.google.cloud.networkconnectivity.v1.ListRouteTablesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.ListHubsRequest', + '.google.cloud.networkconnectivity.v1.ListRouteTablesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.Hub() + new protos.google.cloud.networkconnectivity.v1.RouteTable() ), generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.Hub() + new protos.google.cloud.networkconnectivity.v1.RouteTable() ), generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.Hub() + new protos.google.cloud.networkconnectivity.v1.RouteTable() ), ]; - client.descriptors.page.listHubs.createStream = + client.descriptors.page.listRouteTables.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listHubsStream(request); + const stream = client.listRouteTablesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.networkconnectivity.v1.Hub[] = []; + const responses: protos.google.cloud.networkconnectivity.v1.RouteTable[] = + []; stream.on( 'data', - (response: protos.google.cloud.networkconnectivity.v1.Hub) => { + (response: protos.google.cloud.networkconnectivity.v1.RouteTable) => { responses.push(response); } ); @@ -1835,12 +3929,12 @@ describe('v1.HubServiceClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listHubs.createStream as SinonStub) + (client.descriptors.page.listRouteTables.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listHubs, request) + .calledWith(client.innerApiCalls.listRouteTables, request) ); assert( - (client.descriptors.page.listHubs.createStream as SinonStub) + (client.descriptors.page.listRouteTables.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -1848,32 +3942,31 @@ describe('v1.HubServiceClient', () => { ); }); - it('invokes listHubsStream with error', async () => { + it('invokes listRouteTablesStream with error', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.ListHubsRequest() + new protos.google.cloud.networkconnectivity.v1.ListRouteTablesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.ListHubsRequest', + '.google.cloud.networkconnectivity.v1.ListRouteTablesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listHubs.createStream = stubPageStreamingCall( - undefined, - expectedError - ); - const stream = client.listHubsStream(request); + client.descriptors.page.listRouteTables.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listRouteTablesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.networkconnectivity.v1.Hub[] = []; + const responses: protos.google.cloud.networkconnectivity.v1.RouteTable[] = + []; stream.on( 'data', - (response: protos.google.cloud.networkconnectivity.v1.Hub) => { + (response: protos.google.cloud.networkconnectivity.v1.RouteTable) => { responses.push(response); } ); @@ -1886,12 +3979,12 @@ describe('v1.HubServiceClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listHubs.createStream as SinonStub) + (client.descriptors.page.listRouteTables.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listHubs, request) + .calledWith(client.innerApiCalls.listRouteTables, request) ); assert( - (client.descriptors.page.listHubs.createStream as SinonStub) + (client.descriptors.page.listRouteTables.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -1899,47 +3992,49 @@ describe('v1.HubServiceClient', () => { ); }); - it('uses async iteration with listHubs without error', async () => { + it('uses async iteration with listRouteTables without error', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.ListHubsRequest() + new protos.google.cloud.networkconnectivity.v1.ListRouteTablesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.ListHubsRequest', + '.google.cloud.networkconnectivity.v1.ListRouteTablesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.Hub() + new protos.google.cloud.networkconnectivity.v1.RouteTable() ), generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.Hub() + new protos.google.cloud.networkconnectivity.v1.RouteTable() ), generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.Hub() + new protos.google.cloud.networkconnectivity.v1.RouteTable() ), ]; - client.descriptors.page.listHubs.asyncIterate = + client.descriptors.page.listRouteTables.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.networkconnectivity.v1.IHub[] = []; - const iterable = client.listHubsAsync(request); + const responses: protos.google.cloud.networkconnectivity.v1.IRouteTable[] = + []; + const iterable = client.listRouteTablesAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listHubs.asyncIterate as SinonStub).getCall(0) - .args[1], + ( + client.descriptors.page.listRouteTables.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listHubs.asyncIterate as SinonStub) + (client.descriptors.page.listRouteTables.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -1947,40 +4042,40 @@ describe('v1.HubServiceClient', () => { ); }); - it('uses async iteration with listHubs with error', async () => { + it('uses async iteration with listRouteTables with error', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.ListHubsRequest() + new protos.google.cloud.networkconnectivity.v1.ListRouteTablesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.ListHubsRequest', + '.google.cloud.networkconnectivity.v1.ListRouteTablesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listHubs.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); - const iterable = client.listHubsAsync(request); + client.descriptors.page.listRouteTables.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listRouteTablesAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.networkconnectivity.v1.IHub[] = []; + const responses: protos.google.cloud.networkconnectivity.v1.IRouteTable[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.listHubs.asyncIterate as SinonStub).getCall(0) - .args[1], + ( + client.descriptors.page.listRouteTables.asyncIterate as SinonStub + ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listHubs.asyncIterate as SinonStub) + (client.descriptors.page.listRouteTables.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -1989,80 +4084,80 @@ describe('v1.HubServiceClient', () => { }); }); - describe('listSpokes', () => { - it('invokes listSpokes without error', async () => { + describe('listGroups', () => { + it('invokes listGroups without error', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.ListSpokesRequest() + new protos.google.cloud.networkconnectivity.v1.ListGroupsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.ListSpokesRequest', + '.google.cloud.networkconnectivity.v1.ListGroupsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.Spoke() + new protos.google.cloud.networkconnectivity.v1.Group() ), generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.Spoke() + new protos.google.cloud.networkconnectivity.v1.Group() ), generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.Spoke() + new protos.google.cloud.networkconnectivity.v1.Group() ), ]; - client.innerApiCalls.listSpokes = stubSimpleCall(expectedResponse); - const [response] = await client.listSpokes(request); + client.innerApiCalls.listGroups = stubSimpleCall(expectedResponse); + const [response] = await client.listGroups(request); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listSpokes as SinonStub + client.innerApiCalls.listGroups as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listSpokes as SinonStub + client.innerApiCalls.listGroups as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listSpokes without error using callback', async () => { + it('invokes listGroups without error using callback', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.ListSpokesRequest() + new protos.google.cloud.networkconnectivity.v1.ListGroupsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.ListSpokesRequest', + '.google.cloud.networkconnectivity.v1.ListGroupsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.Spoke() + new protos.google.cloud.networkconnectivity.v1.Group() ), generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.Spoke() + new protos.google.cloud.networkconnectivity.v1.Group() ), generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.Spoke() + new protos.google.cloud.networkconnectivity.v1.Group() ), ]; - client.innerApiCalls.listSpokes = + client.innerApiCalls.listGroups = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listSpokes( + client.listGroups( request, ( err?: Error | null, - result?: protos.google.cloud.networkconnectivity.v1.ISpoke[] | null + result?: protos.google.cloud.networkconnectivity.v1.IGroup[] | null ) => { if (err) { reject(err); @@ -2075,81 +4170,81 @@ describe('v1.HubServiceClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listSpokes as SinonStub + client.innerApiCalls.listGroups as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listSpokes as SinonStub + client.innerApiCalls.listGroups as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listSpokes with error', async () => { + it('invokes listGroups with error', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.ListSpokesRequest() + new protos.google.cloud.networkconnectivity.v1.ListGroupsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.ListSpokesRequest', + '.google.cloud.networkconnectivity.v1.ListGroupsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.listSpokes = stubSimpleCall( + client.innerApiCalls.listGroups = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listSpokes(request), expectedError); + await assert.rejects(client.listGroups(request), expectedError); const actualRequest = ( - client.innerApiCalls.listSpokes as SinonStub + client.innerApiCalls.listGroups as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listSpokes as SinonStub + client.innerApiCalls.listGroups as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listSpokesStream without error', async () => { + it('invokes listGroupsStream without error', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.ListSpokesRequest() + new protos.google.cloud.networkconnectivity.v1.ListGroupsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.ListSpokesRequest', + '.google.cloud.networkconnectivity.v1.ListGroupsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.Spoke() + new protos.google.cloud.networkconnectivity.v1.Group() ), generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.Spoke() + new protos.google.cloud.networkconnectivity.v1.Group() ), generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.Spoke() + new protos.google.cloud.networkconnectivity.v1.Group() ), ]; - client.descriptors.page.listSpokes.createStream = + client.descriptors.page.listGroups.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listSpokesStream(request); + const stream = client.listGroupsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.networkconnectivity.v1.Spoke[] = + const responses: protos.google.cloud.networkconnectivity.v1.Group[] = []; stream.on( 'data', - (response: protos.google.cloud.networkconnectivity.v1.Spoke) => { + (response: protos.google.cloud.networkconnectivity.v1.Group) => { responses.push(response); } ); @@ -2163,12 +4258,12 @@ describe('v1.HubServiceClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listSpokes.createStream as SinonStub) + (client.descriptors.page.listGroups.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listSpokes, request) + .calledWith(client.innerApiCalls.listGroups, request) ); assert( - (client.descriptors.page.listSpokes.createStream as SinonStub) + (client.descriptors.page.listGroups.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -2176,33 +4271,33 @@ describe('v1.HubServiceClient', () => { ); }); - it('invokes listSpokesStream with error', async () => { + it('invokes listGroupsStream with error', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.ListSpokesRequest() + new protos.google.cloud.networkconnectivity.v1.ListGroupsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.ListSpokesRequest', + '.google.cloud.networkconnectivity.v1.ListGroupsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listSpokes.createStream = stubPageStreamingCall( + client.descriptors.page.listGroups.createStream = stubPageStreamingCall( undefined, expectedError ); - const stream = client.listSpokesStream(request); + const stream = client.listGroupsStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.networkconnectivity.v1.Spoke[] = + const responses: protos.google.cloud.networkconnectivity.v1.Group[] = []; stream.on( 'data', - (response: protos.google.cloud.networkconnectivity.v1.Spoke) => { + (response: protos.google.cloud.networkconnectivity.v1.Group) => { responses.push(response); } ); @@ -2215,12 +4310,12 @@ describe('v1.HubServiceClient', () => { }); await assert.rejects(promise, expectedError); assert( - (client.descriptors.page.listSpokes.createStream as SinonStub) + (client.descriptors.page.listGroups.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listSpokes, request) + .calledWith(client.innerApiCalls.listGroups, request) ); assert( - (client.descriptors.page.listSpokes.createStream as SinonStub) + (client.descriptors.page.listGroups.createStream as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -2228,48 +4323,48 @@ describe('v1.HubServiceClient', () => { ); }); - it('uses async iteration with listSpokes without error', async () => { + it('uses async iteration with listGroups without error', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.ListSpokesRequest() + new protos.google.cloud.networkconnectivity.v1.ListGroupsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.ListSpokesRequest', + '.google.cloud.networkconnectivity.v1.ListGroupsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.Spoke() + new protos.google.cloud.networkconnectivity.v1.Group() ), generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.Spoke() + new protos.google.cloud.networkconnectivity.v1.Group() ), generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.Spoke() + new protos.google.cloud.networkconnectivity.v1.Group() ), ]; - client.descriptors.page.listSpokes.asyncIterate = + client.descriptors.page.listGroups.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.networkconnectivity.v1.ISpoke[] = []; - const iterable = client.listSpokesAsync(request); + const responses: protos.google.cloud.networkconnectivity.v1.IGroup[] = []; + const iterable = client.listGroupsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listSpokes.asyncIterate as SinonStub).getCall( + (client.descriptors.page.listGroups.asyncIterate as SinonStub).getCall( 0 ).args[1], request ); assert( - (client.descriptors.page.listSpokes.asyncIterate as SinonStub) + (client.descriptors.page.listGroups.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -2277,42 +4372,42 @@ describe('v1.HubServiceClient', () => { ); }); - it('uses async iteration with listSpokes with error', async () => { + it('uses async iteration with listGroups with error', async () => { const client = new hubserviceModule.v1.HubServiceClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.networkconnectivity.v1.ListSpokesRequest() + new protos.google.cloud.networkconnectivity.v1.ListGroupsRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.networkconnectivity.v1.ListSpokesRequest', + '.google.cloud.networkconnectivity.v1.ListGroupsRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listSpokes.asyncIterate = stubAsyncIterationCall( + client.descriptors.page.listGroups.asyncIterate = stubAsyncIterationCall( undefined, expectedError ); - const iterable = client.listSpokesAsync(request); + const iterable = client.listGroupsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.networkconnectivity.v1.ISpoke[] = + const responses: protos.google.cloud.networkconnectivity.v1.IGroup[] = []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.listSpokes.asyncIterate as SinonStub).getCall( + (client.descriptors.page.listGroups.asyncIterate as SinonStub).getCall( 0 ).args[1], request ); assert( - (client.descriptors.page.listSpokes.asyncIterate as SinonStub) + (client.descriptors.page.listGroups.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -3149,6 +5244,70 @@ describe('v1.HubServiceClient', () => { }); describe('Path templates', () => { + describe('group', () => { + const fakePath = '/rendered/path/group'; + const expectedParameters = { + project: 'projectValue', + hub: 'hubValue', + group: 'groupValue', + }; + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.groupPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.groupPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('groupPath', () => { + const result = client.groupPath( + 'projectValue', + 'hubValue', + 'groupValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.groupPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGroupName', () => { + const result = client.matchProjectFromGroupName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.groupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchHubFromGroupName', () => { + const result = client.matchHubFromGroupName(fakePath); + assert.strictEqual(result, 'hubValue'); + assert( + (client.pathTemplates.groupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchGroupFromGroupName', () => { + const result = client.matchGroupFromGroupName(fakePath); + assert.strictEqual(result, 'groupValue'); + assert( + (client.pathTemplates.groupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('hub', () => { const fakePath = '/rendered/path/hub'; const expectedParameters = { @@ -3198,6 +5357,82 @@ describe('v1.HubServiceClient', () => { }); }); + describe('hubRoute', () => { + const fakePath = '/rendered/path/hubRoute'; + const expectedParameters = { + project: 'projectValue', + hub: 'hubValue', + route_table: 'routeTableValue', + route: 'routeValue', + }; + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hubRoutePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.hubRoutePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('hubRoutePath', () => { + const result = client.hubRoutePath( + 'projectValue', + 'hubValue', + 'routeTableValue', + 'routeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.hubRoutePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromHubRouteName', () => { + const result = client.matchProjectFromHubRouteName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.hubRoutePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchHubFromHubRouteName', () => { + const result = client.matchHubFromHubRouteName(fakePath); + assert.strictEqual(result, 'hubValue'); + assert( + (client.pathTemplates.hubRoutePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRouteTableFromHubRouteName', () => { + const result = client.matchRouteTableFromHubRouteName(fakePath); + assert.strictEqual(result, 'routeTableValue'); + assert( + (client.pathTemplates.hubRoutePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRouteFromHubRouteName', () => { + const result = client.matchRouteFromHubRouteName(fakePath); + assert.strictEqual(result, 'routeValue'); + assert( + (client.pathTemplates.hubRoutePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('instance', () => { const fakePath = '/rendered/path/instance'; const expectedParameters = { @@ -3495,6 +5730,70 @@ describe('v1.HubServiceClient', () => { }); }); + describe('routeTable', () => { + const fakePath = '/rendered/path/routeTable'; + const expectedParameters = { + project: 'projectValue', + hub: 'hubValue', + route_table: 'routeTableValue', + }; + const client = new hubserviceModule.v1.HubServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.routeTablePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.routeTablePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('routeTablePath', () => { + const result = client.routeTablePath( + 'projectValue', + 'hubValue', + 'routeTableValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.routeTablePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRouteTableName', () => { + const result = client.matchProjectFromRouteTableName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.routeTablePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchHubFromRouteTableName', () => { + const result = client.matchHubFromRouteTableName(fakePath); + assert.strictEqual(result, 'hubValue'); + assert( + (client.pathTemplates.routeTablePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRouteTableFromRouteTableName', () => { + const result = client.matchRouteTableFromRouteTableName(fakePath); + assert.strictEqual(result, 'routeTableValue'); + assert( + (client.pathTemplates.routeTablePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('spoke', () => { const fakePath = '/rendered/path/spoke'; const expectedParameters = { diff --git a/packages/google-cloud-networkconnectivity/test/gapic_policy_based_routing_service_v1.ts b/packages/google-cloud-networkconnectivity/test/gapic_policy_based_routing_service_v1.ts index 8d15c21b5e3..c7233f855e2 100644 --- a/packages/google-cloud-networkconnectivity/test/gapic_policy_based_routing_service_v1.ts +++ b/packages/google-cloud-networkconnectivity/test/gapic_policy_based_routing_service_v1.ts @@ -2035,6 +2035,71 @@ describe('v1.PolicyBasedRoutingServiceClient', () => { }); describe('Path templates', () => { + describe('group', () => { + const fakePath = '/rendered/path/group'; + const expectedParameters = { + project: 'projectValue', + hub: 'hubValue', + group: 'groupValue', + }; + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.groupPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.groupPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('groupPath', () => { + const result = client.groupPath( + 'projectValue', + 'hubValue', + 'groupValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.groupPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromGroupName', () => { + const result = client.matchProjectFromGroupName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.groupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchHubFromGroupName', () => { + const result = client.matchHubFromGroupName(fakePath); + assert.strictEqual(result, 'hubValue'); + assert( + (client.pathTemplates.groupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchGroupFromGroupName', () => { + const result = client.matchGroupFromGroupName(fakePath); + assert.strictEqual(result, 'groupValue'); + assert( + (client.pathTemplates.groupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('hub', () => { const fakePath = '/rendered/path/hub'; const expectedParameters = { @@ -2085,6 +2150,83 @@ describe('v1.PolicyBasedRoutingServiceClient', () => { }); }); + describe('hubRoute', () => { + const fakePath = '/rendered/path/hubRoute'; + const expectedParameters = { + project: 'projectValue', + hub: 'hubValue', + route_table: 'routeTableValue', + route: 'routeValue', + }; + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hubRoutePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.hubRoutePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('hubRoutePath', () => { + const result = client.hubRoutePath( + 'projectValue', + 'hubValue', + 'routeTableValue', + 'routeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.hubRoutePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromHubRouteName', () => { + const result = client.matchProjectFromHubRouteName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.hubRoutePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchHubFromHubRouteName', () => { + const result = client.matchHubFromHubRouteName(fakePath); + assert.strictEqual(result, 'hubValue'); + assert( + (client.pathTemplates.hubRoutePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRouteTableFromHubRouteName', () => { + const result = client.matchRouteTableFromHubRouteName(fakePath); + assert.strictEqual(result, 'routeTableValue'); + assert( + (client.pathTemplates.hubRoutePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRouteFromHubRouteName', () => { + const result = client.matchRouteFromHubRouteName(fakePath); + assert.strictEqual(result, 'routeValue'); + assert( + (client.pathTemplates.hubRoutePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('location', () => { const fakePath = '/rendered/path/location'; const expectedParameters = { @@ -2242,6 +2384,71 @@ describe('v1.PolicyBasedRoutingServiceClient', () => { }); }); + describe('routeTable', () => { + const fakePath = '/rendered/path/routeTable'; + const expectedParameters = { + project: 'projectValue', + hub: 'hubValue', + route_table: 'routeTableValue', + }; + const client = + new policybasedroutingserviceModule.v1.PolicyBasedRoutingServiceClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.routeTablePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.routeTablePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('routeTablePath', () => { + const result = client.routeTablePath( + 'projectValue', + 'hubValue', + 'routeTableValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.routeTablePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromRouteTableName', () => { + const result = client.matchProjectFromRouteTableName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.routeTablePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchHubFromRouteTableName', () => { + const result = client.matchHubFromRouteTableName(fakePath); + assert.strictEqual(result, 'hubValue'); + assert( + (client.pathTemplates.routeTablePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchRouteTableFromRouteTableName', () => { + const result = client.matchRouteTableFromRouteTableName(fakePath); + assert.strictEqual(result, 'routeTableValue'); + assert( + (client.pathTemplates.routeTablePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('spoke', () => { const fakePath = '/rendered/path/spoke'; const expectedParameters = {