diff --git a/apis/bigtable/v1beta1/types.generated.go b/apis/bigtable/v1beta1/types.generated.go index c69d0daeda..405add7f95 100644 --- a/apis/bigtable/v1beta1/types.generated.go +++ b/apis/bigtable/v1beta1/types.generated.go @@ -491,8 +491,10 @@ type Table struct { // TODO: map type string message for cluster_states + // TODO: map type string message for column_families + // Immutable. The granularity (i.e. `MILLIS`) at which timestamps are stored // in this table. Timestamps not matching the granularity will be rejected. If // unspecified at creation time, the value will be set to `MILLIS`. Views: diff --git a/apis/networkconnectivity/v1alpha1/doc.go b/apis/networkconnectivity/v1alpha1/doc.go new file mode 100644 index 0000000000..fd0530dc30 --- /dev/null +++ b/apis/networkconnectivity/v1alpha1/doc.go @@ -0,0 +1,16 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// +kcc:proto=google.cloud.networkconnectivity.v1 +package v1alpha1 diff --git a/apis/networkconnectivity/v1alpha1/groupversion_info.go b/apis/networkconnectivity/v1alpha1/groupversion_info.go new file mode 100644 index 0000000000..89c7bfeac2 --- /dev/null +++ b/apis/networkconnectivity/v1alpha1/groupversion_info.go @@ -0,0 +1,33 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// +kubebuilder:object:generate=true +// +groupName=networkconnectivity.cnrm.cloud.google.com +package v1alpha1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +var ( + // GroupVersion is group version used to register these objects + GroupVersion = schema.GroupVersion{Group: "networkconnectivity.cnrm.cloud.google.com", Version: "v1alpha1"} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme + SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) diff --git a/apis/networkconnectivity/v1alpha1/networkconnectivityserviceconnectionpolicy_types.go b/apis/networkconnectivity/v1alpha1/networkconnectivityserviceconnectionpolicy_types.go new file mode 100644 index 0000000000..c943136363 --- /dev/null +++ b/apis/networkconnectivity/v1alpha1/networkconnectivityserviceconnectionpolicy_types.go @@ -0,0 +1,141 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package v1alpha1 + +import ( + refs "github.com/GoogleCloudPlatform/k8s-config-connector/apis/refs/v1beta1" + "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/apis/k8s/v1alpha1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +var ( + NetworkConnectivityServiceConnectionPolicyGVK = schema.GroupVersionKind{ + Group: GroupVersion.Group, + Version: GroupVersion.Version, + Kind: "NetworkConnectivityServiceConnectionPolicy", + } +) + +// NetworkConnectivityServiceConnectionPolicySpec defines the desired state of NetworkConnectivityServiceConnectionPolicy +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.ServiceConnectionPolicy +type NetworkConnectivityServiceConnectionPolicySpec struct { + // The NetworkConnectivityServiceConnectionPolicy name. If not given, the metadata.name will be used. + // + optional + ResourceID *string `json:"resourceID,omitempty"` + + // A description of this resource. + Description *string `json:"description,omitempty"` + + // // User-defined labels. + // Labels map[string]string `json:"labels,omitempty"` + + // // Immutable. The name of a ServiceConnectionPolicy. Format: projects/{project}/locations/{location}/serviceConnectionPolicies/{service_connection_policy} See: https://google.aip.dev/122#fields-representing-resource-names + // Name *string `json:"name,omitempty"` + + // The resource path of the consumer network. Example: - projects/{projectNumOrId}/global/networks/{resourceId}. + Network *refs.ComputeNetworkRef `json:"networkRef,omitempty"` + + // Configuration used for Private Service Connect connections. Used when Infrastructure is PSC. + PscConfig *PscConfig `json:"pscConfig,omitempty"` + + // The service class identifier for which this ServiceConnectionPolicy is for. The service class identifier is a unique, symbolic representation of a ServiceClass. It is provided by the Service Producer. Google services have a prefix of gcp. For example, gcp-cloud-sql. 3rd party services do not. For example, test-service-a3dfcx. + ServiceClass *string `json:"serviceClass,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.PscConfig +type PscConfig struct { + /* TODO:AFTER-MAPPINGS + // Optional. List of Projects, Folders, or Organizations from where the Producer instance can be within. For example, a network administrator can provide both 'organizations/foo' and 'projects/bar' as allowed_google_producers_resource_hierarchy_levels. This allowlists this network to connect with any Producer instance within the 'foo' organization or the 'bar' project. By default, allowed_google_producers_resource_hierarchy_level is empty. The format for each allowed_google_producers_resource_hierarchy_level is / where is one of 'projects', 'folders', or 'organizations' and is either the ID or the number of the resource type. Format for each allowed_google_producers_resource_hierarchy_level value: 'projects/' or 'folders/' or 'organizations/' Eg. [projects/my-project-id, projects/567, folders/891, organizations/123] + AllowedGoogleProducersResourceHierarchyLevel []string `json:"allowedGoogleProducersResourceHierarchyLevel,omitempty"` + */ + + // Optional. Max number of PSC connections for this policy. + Limit *int64 `json:"limit,omitempty"` + + // Required. ProducerInstanceLocation is used to specify which authorization mechanism to use to determine which projects the Producer instance can be within. + ProducerInstanceLocation *string `json:"producerInstanceLocation,omitempty"` + + // The resource paths of subnetworks to use for IP address management. Example: projects/{projectNumOrId}/regions/{region}/subnetworks/{resourceId}. + Subnetworks []refs.ComputeSubnetworkRef `json:"subnetworkRefs,omitempty"` +} + +// NetworkConnectivityServiceConnectionPolicyStatus defines the config connector machine state of NetworkConnectivityServiceConnectionPolicy +type NetworkConnectivityServiceConnectionPolicyStatus struct { + /* Conditions represent the latest available observations of the + object's current state. */ + Conditions []v1alpha1.Condition `json:"conditions,omitempty"` + + /* ObservedGeneration is the generation of the resource that was most recently observed by the Config Connector controller. If this is equal to metadata.generation, then that means that the current reported status reflects the most recent desired state of the resource. */ + // +optional + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` + + /* A unique specifier for the NetworkConnectivityServiceConnectionPolicy resource in GCP.*/ + // +optional + ExternalRef *string `json:"externalRef,omitempty"` + + /* ObservedState is the state of the resource as most recently observed in GCP. */ + // +optional + ObservedState *NetworkConnectivityServiceConnectionPolicyObservedState `json:"observedState,omitempty"` +} + +// NetworkConnectivityServiceConnectionPolicySpec defines the desired state of NetworkConnectivityServiceConnectionPolicy +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.ServiceConnectionPolicy +type NetworkConnectivityServiceConnectionPolicyObservedState struct { + // Output only. Time when the ServiceConnectionMap was created. + CreateTime *string `json:"createTime,omitempty"` + + // Optional. The etag is computed by the server, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding. + Etag *string `json:"etag,omitempty"` + + // Output only. The type of underlying resources used to create the connection. + Infrastructure *string `json:"infrastructure,omitempty"` + + // Output only. [Output only] Information about each Private Service Connect connection. + PscConnections []PscConnection `json:"pscConnections,omitempty"` + + // Output only. Time when the ServiceConnectionMap was updated. + UpdateTime *string `json:"updateTime,omitempty"` +} + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:subresource:status +// +kubebuilder:metadata:labels="cnrm.cloud.google.com/managed-by-kcc=true";"cnrm.cloud.google.com/system=true" +// +kubebuilder:printcolumn:name="Ready",JSONPath=".status.conditions[?(@.type=='Ready')].status",type="string",description="When 'True', the most recent reconcile of the resource succeeded" +// +kubebuilder:printcolumn:name="Status",JSONPath=".status.conditions[?(@.type=='Ready')].reason",type="string",description="The reason for the value in 'Ready'" +// +kubebuilder:printcolumn:name="Status Age",JSONPath=".status.conditions[?(@.type=='Ready')].lastTransitionTime",type="date",description="The last transition time for the value in 'Status'" + +// NetworkConnectivityServiceConnectionPolicy is the Schema for the NetworkConnectivityServiceConnectionPolicy API +// +k8s:openapi-gen=true +type NetworkConnectivityServiceConnectionPolicy struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec NetworkConnectivityServiceConnectionPolicySpec `json:"spec,omitempty"` + Status NetworkConnectivityServiceConnectionPolicyStatus `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// NetworkConnectivityServiceConnectionPolicyList contains a list of NetworkConnectivityServiceConnectionPolicy +type NetworkConnectivityServiceConnectionPolicyList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []NetworkConnectivityServiceConnectionPolicy `json:"items"` +} + +func init() { + SchemeBuilder.Register(&NetworkConnectivityServiceConnectionPolicy{}, &NetworkConnectivityServiceConnectionPolicyList{}) +} diff --git a/apis/networkconnectivity/v1alpha1/types.generated.go b/apis/networkconnectivity/v1alpha1/types.generated.go new file mode 100644 index 0000000000..eacb36651d --- /dev/null +++ b/apis/networkconnectivity/v1alpha1/types.generated.go @@ -0,0 +1,886 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package v1alpha1 + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.AuditConfig +type AuditConfig struct { + // The configuration for logging of each type of permission. + AuditLogConfigs []AuditLogConfig `json:"auditLogConfigs,omitempty"` + + // Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services. + Service *string `json:"service,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.AuditLogConfig +type AuditLogConfig struct { + // Specifies the identities that do not cause logging for this type of permission. Follows the same format of Binding.members. + ExemptedMembers []string `json:"exemptedMembers,omitempty"` + + // The log type that this config enables. + LogType *string `json:"logType,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.AutoAccept +type AutoAccept struct { + // A list of project ids or project numbers for which you want to enable auto-accept. The auto-accept setting is applied to spokes being created or updated in these projects. + AutoAcceptProjects []string `json:"autoAcceptProjects,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.Binding +type Binding struct { + // The condition that is associated with this binding. If the condition evaluates to `true`, then this binding applies to the current request. If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the principals in this binding. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + Condition *Expr `json:"condition,omitempty"` + + // Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. * `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`: A single identity in a workforce identity pool. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/group/{group_id}`: All workforce identities in a group. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/attribute.{attribute_name}/{attribute_value}`: All workforce identities with a specific attribute value. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/*`: All identities in a workforce identity pool. * `principal://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: A single identity in a workload identity pool. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/group/{group_id}`: A workload identity pool group. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}`: All identities in a workload identity pool with a certain attribute. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/*`: All identities in a workload identity pool. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`: Deleted single identity in a workforce identity pool. For example, `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-pool-id/subject/my-subject-attribute-value`. + Members []string `json:"members,omitempty"` + + // Role that is assigned to the list of `members`, or principals. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview of the IAM roles and permissions, see the [IAM documentation](https://cloud.google.com/iam/docs/roles-overview). For a list of the available pre-defined roles, see [here](https://cloud.google.com/iam/docs/understanding-roles). + Role *string `json:"role,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.ConsumerPscConfig +type ConsumerPscConfig struct { + // Required. The project ID or project number of the consumer project. This project is the one that the consumer uses to interact with the producer instance. From the perspective of a consumer who's created a producer instance, this is the project of the producer instance. Format: 'projects/' Eg. 'projects/consumer-project' or 'projects/1234' + ConsumerInstanceProject *string `json:"consumerInstanceProject,omitempty"` + + // This is used in PSC consumer ForwardingRule to control whether the PSC endpoint can be accessed from another region. + DisableGlobalAccess *bool `json:"disableGlobalAccess,omitempty"` + + // The resource path of the consumer network where PSC connections are allowed to be created in. Note, this network does not need be in the ConsumerPscConfig.project in the case of SharedVPC. Example: projects/{projectNumOrId}/global/networks/{networkId}. + Network *string `json:"network,omitempty"` + + // Immutable. An immutable identifier for the producer instance. + ProducerInstanceID *string `json:"producerInstanceID,omitempty"` + + // The consumer project where PSC connections are allowed to be created in. + Project *string `json:"project,omitempty"` + + // Output only. A map to store mapping between customer vip and target service attachment. Only service attachment with producer specified ip addresses are stored here. + ServiceAttachmentIpAddressMap map[string]string `json:"serviceAttachmentIpAddressMap,omitempty"` + + // Output only. Overall state of PSC Connections management for this consumer psc config. + State *string `json:"state,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.ConsumerPscConnection +type ConsumerPscConnection struct { + // The most recent error during operating this connection. + Error *GoogleRpcStatus `json:"error,omitempty"` + + // Output only. The error info for the latest error during operating this connection. + ErrorInfo *GoogleRpcErrorInfo `json:"errorInfo,omitempty"` + + // The error type indicates whether the error is consumer facing, producer facing or system internal. + ErrorType *string `json:"errorType,omitempty"` + + // The URI of the consumer forwarding rule created. Example: projects/{projectNumOrId}/regions/us-east1/networks/{resourceId}. + ForwardingRule *string `json:"forwardingRule,omitempty"` + + // The last Compute Engine operation to setup PSC connection. + GceOperation *string `json:"gceOperation,omitempty"` + + // The IP literal allocated on the consumer network for the PSC forwarding rule that is created to connect to the producer service attachment in this service connection map. + Ip *string `json:"ip,omitempty"` + + // The consumer network whose PSC forwarding rule is connected to the service attachments in this service connection map. Note that the network could be on a different project (shared VPC). + Network *string `json:"network,omitempty"` + + // Immutable. An immutable identifier for the producer instance. + ProducerInstanceID *string `json:"producerInstanceID,omitempty"` + + // The consumer project whose PSC forwarding rule is connected to the service attachments in this service connection map. + Project *string `json:"project,omitempty"` + + // The PSC connection id of the PSC forwarding rule connected to the service attachments in this service connection map. + PscConnectionID *string `json:"pscConnectionID,omitempty"` + + // Output only. The URI of the selected subnetwork selected to allocate IP address for this connection. + SelectedSubnetwork *string `json:"selectedSubnetwork,omitempty"` + + // The URI of a service attachment which is the target of the PSC connection. + ServiceAttachmentUri *string `json:"serviceAttachmentUri,omitempty"` + + // The state of the PSC connection. + State *string `json:"state,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.Empty +type Empty struct { +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.Expr +type Expr struct { + // Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI. + Description *string `json:"description,omitempty"` + + // Textual representation of an expression in Common Expression Language syntax. + Expression *string `json:"expression,omitempty"` + + // Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file. + Location *string `json:"location,omitempty"` + + // Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression. + Title *string `json:"title,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.Filter +type Filter struct { + // Optional. The destination IP range of outgoing packets that this policy-based route applies to. Default is "0.0.0.0/0" if protocol version is IPv4. + DestRange *string `json:"destRange,omitempty"` + + // Optional. The IP protocol that this policy-based route applies to. Valid values are 'TCP', 'UDP', and 'ALL'. Default is 'ALL'. + IpProtocol *string `json:"ipProtocol,omitempty"` + + // Required. Internet protocol versions this policy-based route applies to. For this version, only IPV4 is supported. IPV6 is supported in preview. + ProtocolVersion *string `json:"protocolVersion,omitempty"` + + // Optional. The source IP range of outgoing packets that this policy-based route applies to. Default is "0.0.0.0/0" if protocol version is IPv4. + SrcRange *string `json:"srcRange,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.GoogleRpcErrorInfo +type GoogleRpcErrorInfo struct { + // The logical grouping to which the "reason" belongs. The error domain is typically the registered service name of the tool or product that generates the error. Example: "pubsub.googleapis.com". If the error is generated by some common infrastructure, the error domain must be a globally unique value that identifies the infrastructure. For Google API infrastructure, the error domain is "googleapis.com". + Domain *string `json:"domain,omitempty"` + + // Additional structured details about this error. Keys must match /a-z+/ but should ideally be lowerCamelCase. Also they must be limited to 64 characters in length. When identifying the current value of an exceeded limit, the units should be contained in the key, not the value. For example, rather than {"instanceLimit": "100/request"}, should be returned as, {"instanceLimitPerRequest": "100"}, if the client exceeds the number of instances that can be created in a single (batch) request. + Metadata map[string]string `json:"metadata,omitempty"` + + // The reason of the error. This is a constant value that identifies the proximate cause of the error. Error reasons are unique within a particular domain of errors. This should be at most 63 characters and match a regular expression of `A-Z+[A-Z0-9]`, which represents UPPER_SNAKE_CASE. + Reason *string `json:"reason,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.Group +type Group struct { + // Optional. The auto-accept setting for this group. + AutoAccept *AutoAccept `json:"autoAccept,omitempty"` + + // Output only. The time the group was created. + CreateTime *string `json:"createTime,omitempty"` + + // Optional. The description of the group. + Description *string `json:"description,omitempty"` + + // 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). + Labels map[string]string `json:"labels,omitempty"` + + // 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}` + Name *string `json:"name,omitempty"` + + // Output only. The name of the route table that corresponds to this group. They use the following form: `projects/{project_number}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}` + RouteTable *string `json:"routeTable,omitempty"` + + // Output only. The current lifecycle state of this group. + State *string `json:"state,omitempty"` + + // 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. + Uid *string `json:"uid,omitempty"` + + // Output only. The time the group was last updated. + UpdateTime *string `json:"updateTime,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.Hub +type Hub struct { + // Output only. The time the hub was created. + CreateTime *string `json:"createTime,omitempty"` + + // An optional description of the hub. + Description *string `json:"description,omitempty"` + + // Optional. Whether Private Service Connect transitivity is enabled for the hub. If true, Private Service Connect endpoints in VPC spokes attached to the hub are made accessible to other VPC spokes attached to the hub. The default value is false. + ExportPsc *bool `json:"exportPsc,omitempty"` + + // 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). + Labels map[string]string `json:"labels,omitempty"` + + // Immutable. The name of the hub. Hub names must be unique. They use the following form: `projects/{project_number}/locations/global/hubs/{hub_id}` + Name *string `json:"name,omitempty"` + + // Optional. The policy mode of this hub. This field can be either PRESET or CUSTOM. If unspecified, the policy_mode defaults to PRESET. + PolicyMode *string `json:"policyMode,omitempty"` + + // Optional. The topology implemented in this hub. Currently, this field is only used when policy_mode = PRESET. The available preset topologies are MESH and STAR. If preset_topology is unspecified and policy_mode = PRESET, the preset_topology defaults to MESH. When policy_mode = CUSTOM, the preset_topology is set to PRESET_TOPOLOGY_UNSPECIFIED. + PresetTopology *string `json:"presetTopology,omitempty"` + + // 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. + RouteTables []string `json:"routeTables,omitempty"` + + // The VPC networks associated with this hub's spokes. This field is read-only. Network Connectivity Center automatically populates it based on the set of spokes attached to the hub. + RoutingVpcs []RoutingVPC `json:"routingVpcs,omitempty"` + + // 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 *SpokeSummary `json:"spokeSummary,omitempty"` + + // Output only. The current lifecycle state of this hub. + State *string `json:"state,omitempty"` + + // Output only. The Google-generated UUID for the hub. This value is unique across all hub resources. If a hub is deleted and another with the same name is created, the new hub is assigned a different unique_id. + UniqueID *string `json:"uniqueID,omitempty"` + + // Output only. The time the hub was last updated. + UpdateTime *string `json:"updateTime,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.InterconnectAttachment +type InterconnectAttachment struct { + // Optional. Cloud region to install this policy-based route on interconnect attachment. Use `all` to install it on all interconnect attachments. + Region *string `json:"region,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.InternalRange +type InternalRange struct { + // Time when the internal range was created. + CreateTime *string `json:"createTime,omitempty"` + + // A description of this resource. + Description *string `json:"description,omitempty"` + + // The IP range that this internal range defines. + IpCidrRange *string `json:"ipCidrRange,omitempty"` + + // User-defined labels. + Labels map[string]string `json:"labels,omitempty"` + + // Immutable. The name of an internal range. Format: projects/{project}/locations/{location}/internalRanges/{internal_range} See: https://google.aip.dev/122#fields-representing-resource-names + Name *string `json:"name,omitempty"` + + // The URL or resource ID of the network in which to reserve the internal range. The network cannot be deleted if there are any reserved internal ranges referring to it. Legacy networks are not supported. For example: https://www.googleapis.com/compute/v1/projects/{project}/locations/global/networks/{network} projects/{project}/locations/global/networks/{network} {network} + Network *string `json:"network,omitempty"` + + // Optional. Types of resources that are allowed to overlap with the current internal range. + Overlaps []string `json:"overlaps,omitempty"` + + // The type of peering set for this internal range. + Peering *string `json:"peering,omitempty"` + + // An alternate to ip_cidr_range. Can be set when trying to create a reservation that automatically finds a free range of the given size. If both ip_cidr_range and prefix_length are set, there is an error if the range sizes do not match. Can also be used during updates to change the range size. + PrefixLength *int32 `json:"prefixLength,omitempty"` + + // Optional. Can be set to narrow down or pick a different address space while searching for a free range. If not set, defaults to the "10.0.0.0/8" address space. This can be used to search in other rfc-1918 address spaces like "172.16.0.0/12" and "192.168.0.0/16" or non-rfc-1918 address spaces used in the VPC. + TargetCidrRange []string `json:"targetCidrRange,omitempty"` + + // Time when the internal range was updated. + UpdateTime *string `json:"updateTime,omitempty"` + + // The type of usage set for this InternalRange. + Usage *string `json:"usage,omitempty"` + + // Output only. The list of resources that refer to this internal range. Resources that use the internal range for their range allocation are referred to as users of the range. Other resources mark themselves as users while doing so by creating a reference to this internal range. Having a user, based on this reference, prevents deletion of the internal range referred to. Can be empty. + Users []string `json:"users,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.LinkedInterconnectAttachments +type LinkedInterconnectAttachments struct { + // Optional. IP ranges allowed to be included during import from hub.(does not control transit connectivity) The only allowed value for now is "ALL_IPV4_RANGES". + IncludeImportRanges []string `json:"includeImportRanges,omitempty"` + + // A value that controls whether site-to-site data transfer is enabled for these resources. Data transfer is available only in [supported locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations). + SiteToSiteDataTransfer *bool `json:"siteToSiteDataTransfer,omitempty"` + + // The URIs of linked interconnect attachment resources + Uris []string `json:"uris,omitempty"` + + // Output only. The VPC network where these VLAN attachments are located. + VpcNetwork *string `json:"vpcNetwork,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances +type LinkedRouterApplianceInstances struct { + // Optional. IP ranges allowed to be included during import from hub.(does not control transit connectivity) The only allowed value for now is "ALL_IPV4_RANGES". + IncludeImportRanges []string `json:"includeImportRanges,omitempty"` + + // The list of router appliance instances. + Instances []RouterApplianceInstance `json:"instances,omitempty"` + + // A value that controls whether site-to-site data transfer is enabled for these resources. Data transfer is available only in [supported locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations). + SiteToSiteDataTransfer *bool `json:"siteToSiteDataTransfer,omitempty"` + + // Output only. The VPC network where these router appliance instances are located. + VpcNetwork *string `json:"vpcNetwork,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.LinkedVpcNetwork +type LinkedVpcNetwork struct { + // Optional. IP ranges encompassing the subnets to be excluded from peering. + ExcludeExportRanges []string `json:"excludeExportRanges,omitempty"` + + // Optional. IP ranges allowed to be included from peering. + IncludeExportRanges []string `json:"includeExportRanges,omitempty"` + + // Required. The URI of the VPC network resource. + Uri *string `json:"uri,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.LinkedVpnTunnels +type LinkedVpnTunnels struct { + // Optional. IP ranges allowed to be included during import from hub.(does not control transit connectivity) The only allowed value for now is "ALL_IPV4_RANGES". + IncludeImportRanges []string `json:"includeImportRanges,omitempty"` + + // A value that controls whether site-to-site data transfer is enabled for these resources. Data transfer is available only in [supported locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations). + SiteToSiteDataTransfer *bool `json:"siteToSiteDataTransfer,omitempty"` + + // The URIs of linked VPN tunnel resources. + Uris []string `json:"uris,omitempty"` + + // Output only. The VPC network where these VPN tunnels are located. + VpcNetwork *string `json:"vpcNetwork,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.Location +type Location struct { + // The friendly name for this location, typically a nearby city name. For example, "Tokyo". + DisplayName *string `json:"displayName,omitempty"` + + // Cross-service attributes for the location. For example {"cloud.googleapis.com/region": "us-east1"} + Labels map[string]string `json:"labels,omitempty"` + + // The canonical id for this location. For example: `"us-east1"`. + LocationID *string `json:"locationID,omitempty"` + + // TODO: map type string message for metadata + + + // Resource name for the location, which may vary between implementations. For example: `"projects/example-project/locations/us-east1"` + Name *string `json:"name,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.NextHopInterconnectAttachment +type NextHopInterconnectAttachment struct { + // Indicates whether site-to-site data transfer is allowed for this interconnect attachment resource. Data transfer is available only in [supported locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations). + SiteToSiteDataTransfer *bool `json:"siteToSiteDataTransfer,omitempty"` + + // The URI of the interconnect attachment resource. + Uri *string `json:"uri,omitempty"` + + // The VPC network where this interconnect attachment is located. + VpcNetwork *string `json:"vpcNetwork,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.NextHopRouterApplianceInstance +type NextHopRouterApplianceInstance struct { + // Indicates whether site-to-site data transfer is allowed for this Router appliance instance resource. Data transfer is available only in [supported locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations). + SiteToSiteDataTransfer *bool `json:"siteToSiteDataTransfer,omitempty"` + + // The URI of the Router appliance instance. + Uri *string `json:"uri,omitempty"` + + // The VPC network where this VM is located. + VpcNetwork *string `json:"vpcNetwork,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.NextHopVPNTunnel +type NextHopVPNTunnel struct { + // Indicates whether site-to-site data transfer is allowed for this VPN tunnel resource. Data transfer is available only in [supported locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations). + SiteToSiteDataTransfer *bool `json:"siteToSiteDataTransfer,omitempty"` + + // The URI of the VPN tunnel resource. + Uri *string `json:"uri,omitempty"` + + // The VPC network where this VPN tunnel is located. + VpcNetwork *string `json:"vpcNetwork,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.NextHopVpcNetwork +type NextHopVpcNetwork struct { + // The URI of the VPC network resource + Uri *string `json:"uri,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.Policy +type Policy struct { + // Specifies cloud audit logging configuration for this policy. + AuditConfigs []AuditConfig `json:"auditConfigs,omitempty"` + + // Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`. + Bindings []Binding `json:"bindings,omitempty"` + + // `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy. **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. + Etag *[]byte `json:"etag,omitempty"` + + // Specifies the format of the policy. Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected. Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations: * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + Version *int32 `json:"version,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.PolicyBasedRoute +type PolicyBasedRoute struct { + // Output only. Time when the policy-based route was created. + CreateTime *string `json:"createTime,omitempty"` + + // Optional. An optional description of this resource. Provide this field when you create the resource. + Description *string `json:"description,omitempty"` + + // Required. The filter to match L4 traffic. + Filter *Filter `json:"filter,omitempty"` + + // Optional. The interconnect attachments that this policy-based route applies to. + InterconnectAttachment *InterconnectAttachment `json:"interconnectAttachment,omitempty"` + + // Output only. Type of this resource. Always networkconnectivity#policyBasedRoute for policy-based Route resources. + Kind *string `json:"kind,omitempty"` + + // User-defined labels. + Labels map[string]string `json:"labels,omitempty"` + + // Immutable. A unique name of the resource in the form of `projects/{project_number}/locations/global/PolicyBasedRoutes/{policy_based_route_id}` + Name *string `json:"name,omitempty"` + + // Required. Fully-qualified URL of the network that this route applies to, for example: projects/my-project/global/networks/my-network. + Network *string `json:"network,omitempty"` + + // Optional. The IP address of a global-access-enabled L4 ILB that is the next hop for matching packets. For this version, only nextHopIlbIp is supported. + NextHopIlbIp *string `json:"nextHopIlbIp,omitempty"` + + // Optional. Other routes that will be referenced to determine the next hop of the packet. + NextHopOtherRoutes *string `json:"nextHopOtherRoutes,omitempty"` + + // Optional. The priority of this policy-based route. Priority is used to break ties in cases where there are more than one matching policy-based routes found. In cases where multiple policy-based routes are matched, the one with the lowest-numbered priority value wins. The default value is 1000. The priority value must be from 1 to 65535, inclusive. + Priority *int32 `json:"priority,omitempty"` + + // Output only. Server-defined fully-qualified URL for this resource. + SelfLink *string `json:"selfLink,omitempty"` + + // Output only. Time when the policy-based route was updated. + UpdateTime *string `json:"updateTime,omitempty"` + + // Optional. VM instances that this policy-based route applies to. + VirtualMachine *VirtualMachine `json:"virtualMachine,omitempty"` + + // Output only. If potential misconfigurations are detected for this route, this field will be populated with warning messages. + Warnings []Warnings `json:"warnings,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.ProducerPscConfig +type ProducerPscConfig struct { + // The resource path of a service attachment. Example: projects/{projectNumOrId}/regions/{region}/serviceAttachments/{resourceId}. + ServiceAttachmentUri *string `json:"serviceAttachmentUri,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.PscConnection +type PscConnection struct { + // The resource reference of the consumer address. + ConsumerAddress *string `json:"consumerAddress,omitempty"` + + // The resource reference of the PSC Forwarding Rule within the consumer VPC. + ConsumerForwardingRule *string `json:"consumerForwardingRule,omitempty"` + + // The project where the PSC connection is created. + ConsumerTargetProject *string `json:"consumerTargetProject,omitempty"` + + // The most recent error during operating this connection. + Error *GoogleRpcStatus `json:"error,omitempty"` + + // Output only. The error info for the latest error during operating this connection. + ErrorInfo *GoogleRpcErrorInfo `json:"errorInfo,omitempty"` + + // The error type indicates whether the error is consumer facing, producer facing or system internal. + ErrorType *string `json:"errorType,omitempty"` + + // The last Compute Engine operation to setup PSC connection. + GceOperation *string `json:"gceOperation,omitempty"` + + // Immutable. An immutable identifier for the producer instance. + ProducerInstanceID *string `json:"producerInstanceID,omitempty"` + + // The PSC connection id of the PSC forwarding rule. + PscConnectionID *string `json:"pscConnectionID,omitempty"` + + // Output only. The URI of the subnetwork selected to allocate IP address for this connection. + SelectedSubnetwork *string `json:"selectedSubnetwork,omitempty"` + + // State of the PSC Connection + State *string `json:"state,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.RegionalEndpoint +type RegionalEndpoint struct { + // Required. The access type of this regional endpoint. This field is reflected in the PSC Forwarding Rule configuration to enable global access. + AccessType *string `json:"accessType,omitempty"` + + // Optional. The IP Address of the Regional Endpoint. When no address is provided, an IP from the subnetwork is allocated. Use one of the following formats: * IPv4 address as in `10.0.0.1` * Address resource URI as in `projects/{project}/regions/{region}/addresses/{address_name}` + Address *string `json:"address,omitempty"` + + // Output only. Time when the RegionalEndpoint was created. + CreateTime *string `json:"createTime,omitempty"` + + // Optional. A description of this resource. + Description *string `json:"description,omitempty"` + + // Output only. The literal IP address of the PSC Forwarding Rule created on behalf of the customer. This field is deprecated. Use address instead. + IpAddress *string `json:"ipAddress,omitempty"` + + // User-defined labels. + Labels map[string]string `json:"labels,omitempty"` + + // Output only. The name of a RegionalEndpoint. Format: `projects/{project}/locations/{location}/regionalEndpoints/{regional_endpoint}`. + Name *string `json:"name,omitempty"` + + // The name of the VPC network for this private regional endpoint. Format: `projects/{project}/global/networks/{network}` + Network *string `json:"network,omitempty"` + + // Output only. The resource reference of the PSC Forwarding Rule created on behalf of the customer. Format: `//compute.googleapis.com/projects/{project}/regions/{region}/forwardingRules/{forwarding_rule_name}` + PscForwardingRule *string `json:"pscForwardingRule,omitempty"` + + // The name of the subnetwork from which the IP address will be allocated. Format: `projects/{project}/regions/{region}/subnetworks/{subnetwork}` + Subnetwork *string `json:"subnetwork,omitempty"` + + // Required. The service endpoint this private regional endpoint connects to. Format: `{apiname}.{region}.p.rep.googleapis.com` Example: "cloudkms.us-central1.p.rep.googleapis.com". + TargetGoogleApi *string `json:"targetGoogleApi,omitempty"` + + // Output only. Time when the RegionalEndpoint was updated. + UpdateTime *string `json:"updateTime,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.Route +type Route struct { + // Output only. The time the route was created. + CreateTime *string `json:"createTime,omitempty"` + + // An optional description of the route. + Description *string `json:"description,omitempty"` + + // The destination IP address range. + IpCidrRange *string `json:"ipCidrRange,omitempty"` + + // 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). + Labels map[string]string `json:"labels,omitempty"` + + // Output only. The origin location of the route. Uses the following form: "projects/{project}/locations/{location}" Example: projects/1234/locations/us-central1 + Location *string `json:"location,omitempty"` + + // 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}` + Name *string `json:"name,omitempty"` + + // Immutable. The next-hop VLAN attachment for packets on this route. + NextHopInterconnectAttachment *NextHopInterconnectAttachment `json:"nextHopInterconnectAttachment,omitempty"` + + // Immutable. The next-hop Router appliance instance for packets on this route. + NextHopRouterApplianceInstance *NextHopRouterApplianceInstance `json:"nextHopRouterApplianceInstance,omitempty"` + + // Immutable. The destination VPC network for packets on this route. + NextHopVpcNetwork *NextHopVpcNetwork `json:"nextHopVpcNetwork,omitempty"` + + // Immutable. The next-hop VPN tunnel for packets on this route. + NextHopVpnTunnel *NextHopVPNTunnel `json:"nextHopVpnTunnel,omitempty"` + + // Output only. The priority of this route. Priority is used to break ties in cases where a destination matches more than one route. In these cases the route with the lowest-numbered priority value wins. + Priority *int64 `json:"priority,omitempty"` + + // Immutable. The spoke that this route leads to. Example: projects/12345/locations/global/spokes/SPOKE + Spoke *string `json:"spoke,omitempty"` + + // Output only. The current lifecycle state of the route. + State *string `json:"state,omitempty"` + + // Output only. The route's type. Its type is determined by the properties of its IP address range. + Type *string `json:"type,omitempty"` + + // 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`. + Uid *string `json:"uid,omitempty"` + + // Output only. The time the route was last updated. + UpdateTime *string `json:"updateTime,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.RouteTable +type RouteTable struct { + // Output only. The time the route table was created. + CreateTime *string `json:"createTime,omitempty"` + + // An optional description of the route table. + Description *string `json:"description,omitempty"` + + // 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). + Labels map[string]string `json:"labels,omitempty"` + + // 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}` + Name *string `json:"name,omitempty"` + + // Output only. The current lifecycle state of this route table. + State *string `json:"state,omitempty"` + + // 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`. + Uid *string `json:"uid,omitempty"` + + // Output only. The time the route table was last updated. + UpdateTime *string `json:"updateTime,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.RouterApplianceInstance +type RouterApplianceInstance struct { + // The IP address on the VM to use for peering. + IpAddress *string `json:"ipAddress,omitempty"` + + // The URI of the VM. + VirtualMachine *string `json:"virtualMachine,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.RoutingVPC +type RoutingVPC struct { + // Output only. If true, indicates that this VPC network is currently associated with spokes that use the data transfer feature (spokes where the site_to_site_data_transfer field is set to true). If you create new spokes that use data transfer, they must be associated with this VPC network. At most, one VPC network will have this field set to true. + RequiredForNewSiteToSiteDataTransferSpokes *bool `json:"requiredForNewSiteToSiteDataTransferSpokes,omitempty"` + + // The URI of the VPC network. + Uri *string `json:"uri,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.ServiceClass +type ServiceClass struct { + // Output only. Time when the ServiceClass was created. + CreateTime *string `json:"createTime,omitempty"` + + // A description of this resource. + Description *string `json:"description,omitempty"` + + // Optional. The etag is computed by the server, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding. + Etag *string `json:"etag,omitempty"` + + // User-defined labels. + Labels map[string]string `json:"labels,omitempty"` + + // Immutable. The name of a ServiceClass resource. Format: projects/{project}/locations/{location}/serviceClasses/{service_class} See: https://google.aip.dev/122#fields-representing-resource-names + Name *string `json:"name,omitempty"` + + // Output only. The generated service class name. Use this name to refer to the Service class in Service Connection Maps and Service Connection Policies. + ServiceClass *string `json:"serviceClass,omitempty"` + + // Output only. Time when the ServiceClass was updated. + UpdateTime *string `json:"updateTime,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.ServiceConnectionMap +type ServiceConnectionMap struct { + // The PSC configurations on consumer side. + ConsumerPscConfigs []ConsumerPscConfig `json:"consumerPscConfigs,omitempty"` + + // Output only. PSC connection details on consumer side. + ConsumerPscConnections []ConsumerPscConnection `json:"consumerPscConnections,omitempty"` + + // Output only. Time when the ServiceConnectionMap was created. + CreateTime *string `json:"createTime,omitempty"` + + // A description of this resource. + Description *string `json:"description,omitempty"` + + // Optional. The etag is computed by the server, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding. + Etag *string `json:"etag,omitempty"` + + // Output only. The infrastructure used for connections between consumers/producers. + Infrastructure *string `json:"infrastructure,omitempty"` + + // User-defined labels. + Labels map[string]string `json:"labels,omitempty"` + + // Immutable. The name of a ServiceConnectionMap. Format: projects/{project}/locations/{location}/serviceConnectionMaps/{service_connection_map} See: https://google.aip.dev/122#fields-representing-resource-names + Name *string `json:"name,omitempty"` + + // The PSC configurations on producer side. + ProducerPscConfigs []ProducerPscConfig `json:"producerPscConfigs,omitempty"` + + // The service class identifier this ServiceConnectionMap is for. The user of ServiceConnectionMap create API needs to have networkconnecitivty.serviceclasses.use iam permission for the service class. + ServiceClass *string `json:"serviceClass,omitempty"` + + // Output only. The service class uri this ServiceConnectionMap is for. + ServiceClassUri *string `json:"serviceClassUri,omitempty"` + + // The token provided by the consumer. This token authenticates that the consumer can create a connecton within the specified project and network. + Token *string `json:"token,omitempty"` + + // Output only. Time when the ServiceConnectionMap was updated. + UpdateTime *string `json:"updateTime,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.ServiceConnectionPolicy +type ServiceConnectionPolicy struct { + // Output only. Time when the ServiceConnectionMap was created. + CreateTime *string `json:"createTime,omitempty"` + + // A description of this resource. + Description *string `json:"description,omitempty"` + + // Optional. The etag is computed by the server, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding. + Etag *string `json:"etag,omitempty"` + + // Output only. The type of underlying resources used to create the connection. + Infrastructure *string `json:"infrastructure,omitempty"` + + // User-defined labels. + Labels map[string]string `json:"labels,omitempty"` + + // Immutable. The name of a ServiceConnectionPolicy. Format: projects/{project}/locations/{location}/serviceConnectionPolicies/{service_connection_policy} See: https://google.aip.dev/122#fields-representing-resource-names + Name *string `json:"name,omitempty"` + + // The resource path of the consumer network. Example: - projects/{projectNumOrId}/global/networks/{resourceId}. + Network *string `json:"network,omitempty"` + + // Configuration used for Private Service Connect connections. Used when Infrastructure is PSC. + PscConfig *PscConfig `json:"pscConfig,omitempty"` + + // Output only. [Output only] Information about each Private Service Connect connection. + PscConnections []PscConnection `json:"pscConnections,omitempty"` + + // The service class identifier for which this ServiceConnectionPolicy is for. The service class identifier is a unique, symbolic representation of a ServiceClass. It is provided by the Service Producer. Google services have a prefix of gcp. For example, gcp-cloud-sql. 3rd party services do not. For example, test-service-a3dfcx. + ServiceClass *string `json:"serviceClass,omitempty"` + + // Output only. Time when the ServiceConnectionMap was updated. + UpdateTime *string `json:"updateTime,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.ServiceConnectionToken +type ServiceConnectionToken struct { + // Output only. Time when the ServiceConnectionToken was created. + CreateTime *string `json:"createTime,omitempty"` + + // A description of this resource. + Description *string `json:"description,omitempty"` + + // Optional. The etag is computed by the server, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding. + Etag *string `json:"etag,omitempty"` + + // Output only. The time to which this token is valid. + ExpireTime *string `json:"expireTime,omitempty"` + + // User-defined labels. + Labels map[string]string `json:"labels,omitempty"` + + // Immutable. The name of a ServiceConnectionToken. Format: projects/{project}/locations/{location}/ServiceConnectionTokens/{service_connection_token} See: https://google.aip.dev/122#fields-representing-resource-names + Name *string `json:"name,omitempty"` + + // The resource path of the network associated with this token. Example: projects/{projectNumOrId}/global/networks/{resourceId}. + Network *string `json:"network,omitempty"` + + // Output only. The token generated by Automation. + Token *string `json:"token,omitempty"` + + // Output only. Time when the ServiceConnectionToken was updated. + UpdateTime *string `json:"updateTime,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.Spoke +type Spoke struct { + // Output only. The time the spoke was created. + CreateTime *string `json:"createTime,omitempty"` + + // An optional description of the spoke. + Description *string `json:"description,omitempty"` + + // Optional. The name of the group that this spoke is associated with. + Group *string `json:"group,omitempty"` + + // Immutable. The name of the hub that this spoke is attached to. + Hub *string `json:"hub,omitempty"` + + // 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). + Labels map[string]string `json:"labels,omitempty"` + + // VLAN attachments that are associated with the spoke. + LinkedInterconnectAttachments *LinkedInterconnectAttachments `json:"linkedInterconnectAttachments,omitempty"` + + // Router appliance instances that are associated with the spoke. + LinkedRouterApplianceInstances *LinkedRouterApplianceInstances `json:"linkedRouterApplianceInstances,omitempty"` + + // Optional. VPC network that is associated with the spoke. + LinkedVpcNetwork *LinkedVpcNetwork `json:"linkedVpcNetwork,omitempty"` + + // VPN tunnels that are associated with the spoke. + LinkedVpnTunnels *LinkedVpnTunnels `json:"linkedVpnTunnels,omitempty"` + + // Immutable. The name of the spoke. Spoke names must be unique. They use the following form: `projects/{project_number}/locations/{region}/spokes/{spoke_id}` + Name *string `json:"name,omitempty"` + + // Output only. The reasons for current state of the spoke. Only present when the spoke is in the `INACTIVE` state. + Reasons []StateReason `json:"reasons,omitempty"` + + // Output only. The type of resource associated with the spoke. + SpokeType *string `json:"spokeType,omitempty"` + + // Output only. The current lifecycle state of this spoke. + State *string `json:"state,omitempty"` + + // 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`. + UniqueID *string `json:"uniqueID,omitempty"` + + // Output only. The time the spoke was last updated. + UpdateTime *string `json:"updateTime,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.SpokeStateCount +type SpokeStateCount struct { + // Output only. The total number of spokes that are in this state and associated with a given hub. + Count *int64 `json:"count,omitempty"` + + // Output only. The state of the spokes. + State *string `json:"state,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.SpokeStateReasonCount +type SpokeStateReasonCount struct { + // Output only. The total number of spokes that are inactive for a particular reason and associated with a given hub. + Count *int64 `json:"count,omitempty"` + + // Output only. The reason that a spoke is inactive. + StateReasonCode *string `json:"stateReasonCode,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.SpokeSummary +type SpokeSummary struct { + // Output only. Counts the number of spokes that are in each state and associated with a given hub. + SpokeStateCounts []SpokeStateCount `json:"spokeStateCounts,omitempty"` + + // Output only. Counts the number of spokes that are inactive for each possible reason and associated with a given hub. + SpokeStateReasonCounts []SpokeStateReasonCount `json:"spokeStateReasonCounts,omitempty"` + + // Output only. Counts the number of spokes of each type that are associated with a specific hub. + SpokeTypeCounts []SpokeTypeCount `json:"spokeTypeCounts,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.SpokeTypeCount +type SpokeTypeCount struct { + // Output only. The total number of spokes of this type that are associated with the hub. + Count *int64 `json:"count,omitempty"` + + // Output only. The type of the spokes. + SpokeType *string `json:"spokeType,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.StateReason +type StateReason struct { + // The code associated with this reason. + Code *string `json:"code,omitempty"` + + // Human-readable details about this reason. + Message *string `json:"message,omitempty"` + + // Additional information provided by the user in the RejectSpoke call. + UserDetails *string `json:"userDetails,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.VirtualMachine +type VirtualMachine struct { + // Optional. A list of VM instance tags that this policy-based route applies to. VM instances that have ANY of tags specified here installs this PBR. + Tags []string `json:"tags,omitempty"` +} + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.Warnings +type Warnings struct { + // Output only. A warning code, if applicable. + Code *string `json:"code,omitempty"` + + // Output only. Metadata about this warning in key: value format. The key should provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement. + Data map[string]string `json:"data,omitempty"` + + // Output only. A human-readable description of the warning code. + WarningMessage *string `json:"warningMessage,omitempty"` +} diff --git a/apis/networkconnectivity/v1alpha1/types.go b/apis/networkconnectivity/v1alpha1/types.go new file mode 100644 index 0000000000..a4f3312499 --- /dev/null +++ b/apis/networkconnectivity/v1alpha1/types.go @@ -0,0 +1,29 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package v1alpha1 + +// +kcc:proto=mockgcp.cloud.networkconnectivity.v1.GoogleRpcStatus +type GoogleRpcStatus struct { + // The status code, which should be an enum value of google.rpc.Code. + Code *int32 `json:"code,omitempty"` + + /*NOTYET + // A list of messages that carry the error details. There is a common set of message types for APIs to use. + Details []google_protobuf_Any `json:"details,omitempty"` + */ + + // A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client. + Message *string `json:"message,omitempty"` +} diff --git a/apis/networkconnectivity/v1alpha1/zz_generated.deepcopy.go b/apis/networkconnectivity/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 0000000000..78c33faf37 --- /dev/null +++ b/apis/networkconnectivity/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,2191 @@ +//go:build !ignore_autogenerated + +// Code generated by controller-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "github.com/GoogleCloudPlatform/k8s-config-connector/apis/refs/v1beta1" + k8sv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/apis/k8s/v1alpha1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AuditConfig) DeepCopyInto(out *AuditConfig) { + *out = *in + if in.AuditLogConfigs != nil { + in, out := &in.AuditLogConfigs, &out.AuditLogConfigs + *out = make([]AuditLogConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Service != nil { + in, out := &in.Service, &out.Service + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuditConfig. +func (in *AuditConfig) DeepCopy() *AuditConfig { + if in == nil { + return nil + } + out := new(AuditConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AuditLogConfig) DeepCopyInto(out *AuditLogConfig) { + *out = *in + if in.ExemptedMembers != nil { + in, out := &in.ExemptedMembers, &out.ExemptedMembers + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.LogType != nil { + in, out := &in.LogType, &out.LogType + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AuditLogConfig. +func (in *AuditLogConfig) DeepCopy() *AuditLogConfig { + if in == nil { + return nil + } + out := new(AuditLogConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AutoAccept) DeepCopyInto(out *AutoAccept) { + *out = *in + if in.AutoAcceptProjects != nil { + in, out := &in.AutoAcceptProjects, &out.AutoAcceptProjects + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoAccept. +func (in *AutoAccept) DeepCopy() *AutoAccept { + if in == nil { + return nil + } + out := new(AutoAccept) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Binding) DeepCopyInto(out *Binding) { + *out = *in + if in.Condition != nil { + in, out := &in.Condition, &out.Condition + *out = new(Expr) + (*in).DeepCopyInto(*out) + } + if in.Members != nil { + in, out := &in.Members, &out.Members + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Role != nil { + in, out := &in.Role, &out.Role + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Binding. +func (in *Binding) DeepCopy() *Binding { + if in == nil { + return nil + } + out := new(Binding) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConsumerPscConfig) DeepCopyInto(out *ConsumerPscConfig) { + *out = *in + if in.ConsumerInstanceProject != nil { + in, out := &in.ConsumerInstanceProject, &out.ConsumerInstanceProject + *out = new(string) + **out = **in + } + if in.DisableGlobalAccess != nil { + in, out := &in.DisableGlobalAccess, &out.DisableGlobalAccess + *out = new(bool) + **out = **in + } + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(string) + **out = **in + } + if in.ProducerInstanceID != nil { + in, out := &in.ProducerInstanceID, &out.ProducerInstanceID + *out = new(string) + **out = **in + } + if in.Project != nil { + in, out := &in.Project, &out.Project + *out = new(string) + **out = **in + } + if in.ServiceAttachmentIpAddressMap != nil { + in, out := &in.ServiceAttachmentIpAddressMap, &out.ServiceAttachmentIpAddressMap + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.State != nil { + in, out := &in.State, &out.State + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConsumerPscConfig. +func (in *ConsumerPscConfig) DeepCopy() *ConsumerPscConfig { + if in == nil { + return nil + } + out := new(ConsumerPscConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConsumerPscConnection) DeepCopyInto(out *ConsumerPscConnection) { + *out = *in + if in.Error != nil { + in, out := &in.Error, &out.Error + *out = new(GoogleRpcStatus) + (*in).DeepCopyInto(*out) + } + if in.ErrorInfo != nil { + in, out := &in.ErrorInfo, &out.ErrorInfo + *out = new(GoogleRpcErrorInfo) + (*in).DeepCopyInto(*out) + } + if in.ErrorType != nil { + in, out := &in.ErrorType, &out.ErrorType + *out = new(string) + **out = **in + } + if in.ForwardingRule != nil { + in, out := &in.ForwardingRule, &out.ForwardingRule + *out = new(string) + **out = **in + } + if in.GceOperation != nil { + in, out := &in.GceOperation, &out.GceOperation + *out = new(string) + **out = **in + } + if in.Ip != nil { + in, out := &in.Ip, &out.Ip + *out = new(string) + **out = **in + } + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(string) + **out = **in + } + if in.ProducerInstanceID != nil { + in, out := &in.ProducerInstanceID, &out.ProducerInstanceID + *out = new(string) + **out = **in + } + if in.Project != nil { + in, out := &in.Project, &out.Project + *out = new(string) + **out = **in + } + if in.PscConnectionID != nil { + in, out := &in.PscConnectionID, &out.PscConnectionID + *out = new(string) + **out = **in + } + if in.SelectedSubnetwork != nil { + in, out := &in.SelectedSubnetwork, &out.SelectedSubnetwork + *out = new(string) + **out = **in + } + if in.ServiceAttachmentUri != nil { + in, out := &in.ServiceAttachmentUri, &out.ServiceAttachmentUri + *out = new(string) + **out = **in + } + if in.State != nil { + in, out := &in.State, &out.State + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConsumerPscConnection. +func (in *ConsumerPscConnection) DeepCopy() *ConsumerPscConnection { + if in == nil { + return nil + } + out := new(ConsumerPscConnection) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Empty) DeepCopyInto(out *Empty) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Empty. +func (in *Empty) DeepCopy() *Empty { + if in == nil { + return nil + } + out := new(Empty) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Expr) DeepCopyInto(out *Expr) { + *out = *in + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Expression != nil { + in, out := &in.Expression, &out.Expression + *out = new(string) + **out = **in + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.Title != nil { + in, out := &in.Title, &out.Title + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Expr. +func (in *Expr) DeepCopy() *Expr { + if in == nil { + return nil + } + out := new(Expr) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Filter) DeepCopyInto(out *Filter) { + *out = *in + if in.DestRange != nil { + in, out := &in.DestRange, &out.DestRange + *out = new(string) + **out = **in + } + if in.IpProtocol != nil { + in, out := &in.IpProtocol, &out.IpProtocol + *out = new(string) + **out = **in + } + if in.ProtocolVersion != nil { + in, out := &in.ProtocolVersion, &out.ProtocolVersion + *out = new(string) + **out = **in + } + if in.SrcRange != nil { + in, out := &in.SrcRange, &out.SrcRange + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Filter. +func (in *Filter) DeepCopy() *Filter { + if in == nil { + return nil + } + out := new(Filter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GoogleRpcErrorInfo) DeepCopyInto(out *GoogleRpcErrorInfo) { + *out = *in + if in.Domain != nil { + in, out := &in.Domain, &out.Domain + *out = new(string) + **out = **in + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Reason != nil { + in, out := &in.Reason, &out.Reason + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GoogleRpcErrorInfo. +func (in *GoogleRpcErrorInfo) DeepCopy() *GoogleRpcErrorInfo { + if in == nil { + return nil + } + out := new(GoogleRpcErrorInfo) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GoogleRpcStatus) DeepCopyInto(out *GoogleRpcStatus) { + *out = *in + if in.Code != nil { + in, out := &in.Code, &out.Code + *out = new(int32) + **out = **in + } + if in.Message != nil { + in, out := &in.Message, &out.Message + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GoogleRpcStatus. +func (in *GoogleRpcStatus) DeepCopy() *GoogleRpcStatus { + if in == nil { + return nil + } + out := new(GoogleRpcStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Group) DeepCopyInto(out *Group) { + *out = *in + if in.AutoAccept != nil { + in, out := &in.AutoAccept, &out.AutoAccept + *out = new(AutoAccept) + (*in).DeepCopyInto(*out) + } + if in.CreateTime != nil { + in, out := &in.CreateTime, &out.CreateTime + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.RouteTable != nil { + in, out := &in.RouteTable, &out.RouteTable + *out = new(string) + **out = **in + } + if in.State != nil { + in, out := &in.State, &out.State + *out = new(string) + **out = **in + } + if in.Uid != nil { + in, out := &in.Uid, &out.Uid + *out = new(string) + **out = **in + } + if in.UpdateTime != nil { + in, out := &in.UpdateTime, &out.UpdateTime + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Group. +func (in *Group) DeepCopy() *Group { + if in == nil { + return nil + } + out := new(Group) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Hub) DeepCopyInto(out *Hub) { + *out = *in + if in.CreateTime != nil { + in, out := &in.CreateTime, &out.CreateTime + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.ExportPsc != nil { + in, out := &in.ExportPsc, &out.ExportPsc + *out = new(bool) + **out = **in + } + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.PolicyMode != nil { + in, out := &in.PolicyMode, &out.PolicyMode + *out = new(string) + **out = **in + } + if in.PresetTopology != nil { + in, out := &in.PresetTopology, &out.PresetTopology + *out = new(string) + **out = **in + } + if in.RouteTables != nil { + in, out := &in.RouteTables, &out.RouteTables + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.RoutingVpcs != nil { + in, out := &in.RoutingVpcs, &out.RoutingVpcs + *out = make([]RoutingVPC, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SpokeSummary != nil { + in, out := &in.SpokeSummary, &out.SpokeSummary + *out = new(SpokeSummary) + (*in).DeepCopyInto(*out) + } + if in.State != nil { + in, out := &in.State, &out.State + *out = new(string) + **out = **in + } + if in.UniqueID != nil { + in, out := &in.UniqueID, &out.UniqueID + *out = new(string) + **out = **in + } + if in.UpdateTime != nil { + in, out := &in.UpdateTime, &out.UpdateTime + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Hub. +func (in *Hub) DeepCopy() *Hub { + if in == nil { + return nil + } + out := new(Hub) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InterconnectAttachment) DeepCopyInto(out *InterconnectAttachment) { + *out = *in + if in.Region != nil { + in, out := &in.Region, &out.Region + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InterconnectAttachment. +func (in *InterconnectAttachment) DeepCopy() *InterconnectAttachment { + if in == nil { + return nil + } + out := new(InterconnectAttachment) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InternalRange) DeepCopyInto(out *InternalRange) { + *out = *in + if in.CreateTime != nil { + in, out := &in.CreateTime, &out.CreateTime + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.IpCidrRange != nil { + in, out := &in.IpCidrRange, &out.IpCidrRange + *out = new(string) + **out = **in + } + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(string) + **out = **in + } + if in.Overlaps != nil { + in, out := &in.Overlaps, &out.Overlaps + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Peering != nil { + in, out := &in.Peering, &out.Peering + *out = new(string) + **out = **in + } + if in.PrefixLength != nil { + in, out := &in.PrefixLength, &out.PrefixLength + *out = new(int32) + **out = **in + } + if in.TargetCidrRange != nil { + in, out := &in.TargetCidrRange, &out.TargetCidrRange + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.UpdateTime != nil { + in, out := &in.UpdateTime, &out.UpdateTime + *out = new(string) + **out = **in + } + if in.Usage != nil { + in, out := &in.Usage, &out.Usage + *out = new(string) + **out = **in + } + if in.Users != nil { + in, out := &in.Users, &out.Users + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InternalRange. +func (in *InternalRange) DeepCopy() *InternalRange { + if in == nil { + return nil + } + out := new(InternalRange) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LinkedInterconnectAttachments) DeepCopyInto(out *LinkedInterconnectAttachments) { + *out = *in + if in.IncludeImportRanges != nil { + in, out := &in.IncludeImportRanges, &out.IncludeImportRanges + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.SiteToSiteDataTransfer != nil { + in, out := &in.SiteToSiteDataTransfer, &out.SiteToSiteDataTransfer + *out = new(bool) + **out = **in + } + if in.Uris != nil { + in, out := &in.Uris, &out.Uris + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.VpcNetwork != nil { + in, out := &in.VpcNetwork, &out.VpcNetwork + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LinkedInterconnectAttachments. +func (in *LinkedInterconnectAttachments) DeepCopy() *LinkedInterconnectAttachments { + if in == nil { + return nil + } + out := new(LinkedInterconnectAttachments) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LinkedRouterApplianceInstances) DeepCopyInto(out *LinkedRouterApplianceInstances) { + *out = *in + if in.IncludeImportRanges != nil { + in, out := &in.IncludeImportRanges, &out.IncludeImportRanges + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Instances != nil { + in, out := &in.Instances, &out.Instances + *out = make([]RouterApplianceInstance, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SiteToSiteDataTransfer != nil { + in, out := &in.SiteToSiteDataTransfer, &out.SiteToSiteDataTransfer + *out = new(bool) + **out = **in + } + if in.VpcNetwork != nil { + in, out := &in.VpcNetwork, &out.VpcNetwork + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LinkedRouterApplianceInstances. +func (in *LinkedRouterApplianceInstances) DeepCopy() *LinkedRouterApplianceInstances { + if in == nil { + return nil + } + out := new(LinkedRouterApplianceInstances) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LinkedVpcNetwork) DeepCopyInto(out *LinkedVpcNetwork) { + *out = *in + if in.ExcludeExportRanges != nil { + in, out := &in.ExcludeExportRanges, &out.ExcludeExportRanges + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.IncludeExportRanges != nil { + in, out := &in.IncludeExportRanges, &out.IncludeExportRanges + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Uri != nil { + in, out := &in.Uri, &out.Uri + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LinkedVpcNetwork. +func (in *LinkedVpcNetwork) DeepCopy() *LinkedVpcNetwork { + if in == nil { + return nil + } + out := new(LinkedVpcNetwork) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LinkedVpnTunnels) DeepCopyInto(out *LinkedVpnTunnels) { + *out = *in + if in.IncludeImportRanges != nil { + in, out := &in.IncludeImportRanges, &out.IncludeImportRanges + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.SiteToSiteDataTransfer != nil { + in, out := &in.SiteToSiteDataTransfer, &out.SiteToSiteDataTransfer + *out = new(bool) + **out = **in + } + if in.Uris != nil { + in, out := &in.Uris, &out.Uris + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.VpcNetwork != nil { + in, out := &in.VpcNetwork, &out.VpcNetwork + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LinkedVpnTunnels. +func (in *LinkedVpnTunnels) DeepCopy() *LinkedVpnTunnels { + if in == nil { + return nil + } + out := new(LinkedVpnTunnels) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Location) DeepCopyInto(out *Location) { + *out = *in + if in.DisplayName != nil { + in, out := &in.DisplayName, &out.DisplayName + *out = new(string) + **out = **in + } + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.LocationID != nil { + in, out := &in.LocationID, &out.LocationID + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Location. +func (in *Location) DeepCopy() *Location { + if in == nil { + return nil + } + out := new(Location) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkConnectivityServiceConnectionPolicy) DeepCopyInto(out *NetworkConnectivityServiceConnectionPolicy) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkConnectivityServiceConnectionPolicy. +func (in *NetworkConnectivityServiceConnectionPolicy) DeepCopy() *NetworkConnectivityServiceConnectionPolicy { + if in == nil { + return nil + } + out := new(NetworkConnectivityServiceConnectionPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NetworkConnectivityServiceConnectionPolicy) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkConnectivityServiceConnectionPolicyList) DeepCopyInto(out *NetworkConnectivityServiceConnectionPolicyList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NetworkConnectivityServiceConnectionPolicy, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkConnectivityServiceConnectionPolicyList. +func (in *NetworkConnectivityServiceConnectionPolicyList) DeepCopy() *NetworkConnectivityServiceConnectionPolicyList { + if in == nil { + return nil + } + out := new(NetworkConnectivityServiceConnectionPolicyList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NetworkConnectivityServiceConnectionPolicyList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkConnectivityServiceConnectionPolicyObservedState) DeepCopyInto(out *NetworkConnectivityServiceConnectionPolicyObservedState) { + *out = *in + if in.CreateTime != nil { + in, out := &in.CreateTime, &out.CreateTime + *out = new(string) + **out = **in + } + if in.Etag != nil { + in, out := &in.Etag, &out.Etag + *out = new(string) + **out = **in + } + if in.Infrastructure != nil { + in, out := &in.Infrastructure, &out.Infrastructure + *out = new(string) + **out = **in + } + if in.PscConnections != nil { + in, out := &in.PscConnections, &out.PscConnections + *out = make([]PscConnection, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.UpdateTime != nil { + in, out := &in.UpdateTime, &out.UpdateTime + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkConnectivityServiceConnectionPolicyObservedState. +func (in *NetworkConnectivityServiceConnectionPolicyObservedState) DeepCopy() *NetworkConnectivityServiceConnectionPolicyObservedState { + if in == nil { + return nil + } + out := new(NetworkConnectivityServiceConnectionPolicyObservedState) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkConnectivityServiceConnectionPolicySpec) DeepCopyInto(out *NetworkConnectivityServiceConnectionPolicySpec) { + *out = *in + if in.ResourceID != nil { + in, out := &in.ResourceID, &out.ResourceID + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(v1beta1.ComputeNetworkRef) + **out = **in + } + if in.PscConfig != nil { + in, out := &in.PscConfig, &out.PscConfig + *out = new(PscConfig) + (*in).DeepCopyInto(*out) + } + if in.ServiceClass != nil { + in, out := &in.ServiceClass, &out.ServiceClass + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkConnectivityServiceConnectionPolicySpec. +func (in *NetworkConnectivityServiceConnectionPolicySpec) DeepCopy() *NetworkConnectivityServiceConnectionPolicySpec { + if in == nil { + return nil + } + out := new(NetworkConnectivityServiceConnectionPolicySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkConnectivityServiceConnectionPolicyStatus) DeepCopyInto(out *NetworkConnectivityServiceConnectionPolicyStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]k8sv1alpha1.Condition, len(*in)) + copy(*out, *in) + } + if in.ObservedGeneration != nil { + in, out := &in.ObservedGeneration, &out.ObservedGeneration + *out = new(int64) + **out = **in + } + if in.ExternalRef != nil { + in, out := &in.ExternalRef, &out.ExternalRef + *out = new(string) + **out = **in + } + if in.ObservedState != nil { + in, out := &in.ObservedState, &out.ObservedState + *out = new(NetworkConnectivityServiceConnectionPolicyObservedState) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkConnectivityServiceConnectionPolicyStatus. +func (in *NetworkConnectivityServiceConnectionPolicyStatus) DeepCopy() *NetworkConnectivityServiceConnectionPolicyStatus { + if in == nil { + return nil + } + out := new(NetworkConnectivityServiceConnectionPolicyStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NextHopInterconnectAttachment) DeepCopyInto(out *NextHopInterconnectAttachment) { + *out = *in + if in.SiteToSiteDataTransfer != nil { + in, out := &in.SiteToSiteDataTransfer, &out.SiteToSiteDataTransfer + *out = new(bool) + **out = **in + } + if in.Uri != nil { + in, out := &in.Uri, &out.Uri + *out = new(string) + **out = **in + } + if in.VpcNetwork != nil { + in, out := &in.VpcNetwork, &out.VpcNetwork + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NextHopInterconnectAttachment. +func (in *NextHopInterconnectAttachment) DeepCopy() *NextHopInterconnectAttachment { + if in == nil { + return nil + } + out := new(NextHopInterconnectAttachment) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NextHopRouterApplianceInstance) DeepCopyInto(out *NextHopRouterApplianceInstance) { + *out = *in + if in.SiteToSiteDataTransfer != nil { + in, out := &in.SiteToSiteDataTransfer, &out.SiteToSiteDataTransfer + *out = new(bool) + **out = **in + } + if in.Uri != nil { + in, out := &in.Uri, &out.Uri + *out = new(string) + **out = **in + } + if in.VpcNetwork != nil { + in, out := &in.VpcNetwork, &out.VpcNetwork + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NextHopRouterApplianceInstance. +func (in *NextHopRouterApplianceInstance) DeepCopy() *NextHopRouterApplianceInstance { + if in == nil { + return nil + } + out := new(NextHopRouterApplianceInstance) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NextHopVPNTunnel) DeepCopyInto(out *NextHopVPNTunnel) { + *out = *in + if in.SiteToSiteDataTransfer != nil { + in, out := &in.SiteToSiteDataTransfer, &out.SiteToSiteDataTransfer + *out = new(bool) + **out = **in + } + if in.Uri != nil { + in, out := &in.Uri, &out.Uri + *out = new(string) + **out = **in + } + if in.VpcNetwork != nil { + in, out := &in.VpcNetwork, &out.VpcNetwork + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NextHopVPNTunnel. +func (in *NextHopVPNTunnel) DeepCopy() *NextHopVPNTunnel { + if in == nil { + return nil + } + out := new(NextHopVPNTunnel) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NextHopVpcNetwork) DeepCopyInto(out *NextHopVpcNetwork) { + *out = *in + if in.Uri != nil { + in, out := &in.Uri, &out.Uri + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NextHopVpcNetwork. +func (in *NextHopVpcNetwork) DeepCopy() *NextHopVpcNetwork { + if in == nil { + return nil + } + out := new(NextHopVpcNetwork) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Policy) DeepCopyInto(out *Policy) { + *out = *in + if in.AuditConfigs != nil { + in, out := &in.AuditConfigs, &out.AuditConfigs + *out = make([]AuditConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Bindings != nil { + in, out := &in.Bindings, &out.Bindings + *out = make([]Binding, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Etag != nil { + in, out := &in.Etag, &out.Etag + *out = new([]byte) + if **in != nil { + in, out := *in, *out + *out = make([]byte, len(*in)) + copy(*out, *in) + } + } + if in.Version != nil { + in, out := &in.Version, &out.Version + *out = new(int32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Policy. +func (in *Policy) DeepCopy() *Policy { + if in == nil { + return nil + } + out := new(Policy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PolicyBasedRoute) DeepCopyInto(out *PolicyBasedRoute) { + *out = *in + if in.CreateTime != nil { + in, out := &in.CreateTime, &out.CreateTime + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Filter != nil { + in, out := &in.Filter, &out.Filter + *out = new(Filter) + (*in).DeepCopyInto(*out) + } + if in.InterconnectAttachment != nil { + in, out := &in.InterconnectAttachment, &out.InterconnectAttachment + *out = new(InterconnectAttachment) + (*in).DeepCopyInto(*out) + } + if in.Kind != nil { + in, out := &in.Kind, &out.Kind + *out = new(string) + **out = **in + } + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(string) + **out = **in + } + if in.NextHopIlbIp != nil { + in, out := &in.NextHopIlbIp, &out.NextHopIlbIp + *out = new(string) + **out = **in + } + if in.NextHopOtherRoutes != nil { + in, out := &in.NextHopOtherRoutes, &out.NextHopOtherRoutes + *out = new(string) + **out = **in + } + if in.Priority != nil { + in, out := &in.Priority, &out.Priority + *out = new(int32) + **out = **in + } + if in.SelfLink != nil { + in, out := &in.SelfLink, &out.SelfLink + *out = new(string) + **out = **in + } + if in.UpdateTime != nil { + in, out := &in.UpdateTime, &out.UpdateTime + *out = new(string) + **out = **in + } + if in.VirtualMachine != nil { + in, out := &in.VirtualMachine, &out.VirtualMachine + *out = new(VirtualMachine) + (*in).DeepCopyInto(*out) + } + if in.Warnings != nil { + in, out := &in.Warnings, &out.Warnings + *out = make([]Warnings, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyBasedRoute. +func (in *PolicyBasedRoute) DeepCopy() *PolicyBasedRoute { + if in == nil { + return nil + } + out := new(PolicyBasedRoute) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ProducerPscConfig) DeepCopyInto(out *ProducerPscConfig) { + *out = *in + if in.ServiceAttachmentUri != nil { + in, out := &in.ServiceAttachmentUri, &out.ServiceAttachmentUri + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProducerPscConfig. +func (in *ProducerPscConfig) DeepCopy() *ProducerPscConfig { + if in == nil { + return nil + } + out := new(ProducerPscConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PscConfig) DeepCopyInto(out *PscConfig) { + *out = *in + if in.Limit != nil { + in, out := &in.Limit, &out.Limit + *out = new(int64) + **out = **in + } + if in.ProducerInstanceLocation != nil { + in, out := &in.ProducerInstanceLocation, &out.ProducerInstanceLocation + *out = new(string) + **out = **in + } + if in.Subnetworks != nil { + in, out := &in.Subnetworks, &out.Subnetworks + *out = make([]v1beta1.ComputeSubnetworkRef, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PscConfig. +func (in *PscConfig) DeepCopy() *PscConfig { + if in == nil { + return nil + } + out := new(PscConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PscConnection) DeepCopyInto(out *PscConnection) { + *out = *in + if in.ConsumerAddress != nil { + in, out := &in.ConsumerAddress, &out.ConsumerAddress + *out = new(string) + **out = **in + } + if in.ConsumerForwardingRule != nil { + in, out := &in.ConsumerForwardingRule, &out.ConsumerForwardingRule + *out = new(string) + **out = **in + } + if in.ConsumerTargetProject != nil { + in, out := &in.ConsumerTargetProject, &out.ConsumerTargetProject + *out = new(string) + **out = **in + } + if in.Error != nil { + in, out := &in.Error, &out.Error + *out = new(GoogleRpcStatus) + (*in).DeepCopyInto(*out) + } + if in.ErrorInfo != nil { + in, out := &in.ErrorInfo, &out.ErrorInfo + *out = new(GoogleRpcErrorInfo) + (*in).DeepCopyInto(*out) + } + if in.ErrorType != nil { + in, out := &in.ErrorType, &out.ErrorType + *out = new(string) + **out = **in + } + if in.GceOperation != nil { + in, out := &in.GceOperation, &out.GceOperation + *out = new(string) + **out = **in + } + if in.ProducerInstanceID != nil { + in, out := &in.ProducerInstanceID, &out.ProducerInstanceID + *out = new(string) + **out = **in + } + if in.PscConnectionID != nil { + in, out := &in.PscConnectionID, &out.PscConnectionID + *out = new(string) + **out = **in + } + if in.SelectedSubnetwork != nil { + in, out := &in.SelectedSubnetwork, &out.SelectedSubnetwork + *out = new(string) + **out = **in + } + if in.State != nil { + in, out := &in.State, &out.State + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PscConnection. +func (in *PscConnection) DeepCopy() *PscConnection { + if in == nil { + return nil + } + out := new(PscConnection) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RegionalEndpoint) DeepCopyInto(out *RegionalEndpoint) { + *out = *in + if in.AccessType != nil { + in, out := &in.AccessType, &out.AccessType + *out = new(string) + **out = **in + } + if in.Address != nil { + in, out := &in.Address, &out.Address + *out = new(string) + **out = **in + } + if in.CreateTime != nil { + in, out := &in.CreateTime, &out.CreateTime + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.IpAddress != nil { + in, out := &in.IpAddress, &out.IpAddress + *out = new(string) + **out = **in + } + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(string) + **out = **in + } + if in.PscForwardingRule != nil { + in, out := &in.PscForwardingRule, &out.PscForwardingRule + *out = new(string) + **out = **in + } + if in.Subnetwork != nil { + in, out := &in.Subnetwork, &out.Subnetwork + *out = new(string) + **out = **in + } + if in.TargetGoogleApi != nil { + in, out := &in.TargetGoogleApi, &out.TargetGoogleApi + *out = new(string) + **out = **in + } + if in.UpdateTime != nil { + in, out := &in.UpdateTime, &out.UpdateTime + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegionalEndpoint. +func (in *RegionalEndpoint) DeepCopy() *RegionalEndpoint { + if in == nil { + return nil + } + out := new(RegionalEndpoint) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Route) DeepCopyInto(out *Route) { + *out = *in + if in.CreateTime != nil { + in, out := &in.CreateTime, &out.CreateTime + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.IpCidrRange != nil { + in, out := &in.IpCidrRange, &out.IpCidrRange + *out = new(string) + **out = **in + } + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Location != nil { + in, out := &in.Location, &out.Location + *out = new(string) + **out = **in + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.NextHopInterconnectAttachment != nil { + in, out := &in.NextHopInterconnectAttachment, &out.NextHopInterconnectAttachment + *out = new(NextHopInterconnectAttachment) + (*in).DeepCopyInto(*out) + } + if in.NextHopRouterApplianceInstance != nil { + in, out := &in.NextHopRouterApplianceInstance, &out.NextHopRouterApplianceInstance + *out = new(NextHopRouterApplianceInstance) + (*in).DeepCopyInto(*out) + } + if in.NextHopVpcNetwork != nil { + in, out := &in.NextHopVpcNetwork, &out.NextHopVpcNetwork + *out = new(NextHopVpcNetwork) + (*in).DeepCopyInto(*out) + } + if in.NextHopVpnTunnel != nil { + in, out := &in.NextHopVpnTunnel, &out.NextHopVpnTunnel + *out = new(NextHopVPNTunnel) + (*in).DeepCopyInto(*out) + } + if in.Priority != nil { + in, out := &in.Priority, &out.Priority + *out = new(int64) + **out = **in + } + if in.Spoke != nil { + in, out := &in.Spoke, &out.Spoke + *out = new(string) + **out = **in + } + if in.State != nil { + in, out := &in.State, &out.State + *out = new(string) + **out = **in + } + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(string) + **out = **in + } + if in.Uid != nil { + in, out := &in.Uid, &out.Uid + *out = new(string) + **out = **in + } + if in.UpdateTime != nil { + in, out := &in.UpdateTime, &out.UpdateTime + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Route. +func (in *Route) DeepCopy() *Route { + if in == nil { + return nil + } + out := new(Route) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RouteTable) DeepCopyInto(out *RouteTable) { + *out = *in + if in.CreateTime != nil { + in, out := &in.CreateTime, &out.CreateTime + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.State != nil { + in, out := &in.State, &out.State + *out = new(string) + **out = **in + } + if in.Uid != nil { + in, out := &in.Uid, &out.Uid + *out = new(string) + **out = **in + } + if in.UpdateTime != nil { + in, out := &in.UpdateTime, &out.UpdateTime + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouteTable. +func (in *RouteTable) DeepCopy() *RouteTable { + if in == nil { + return nil + } + out := new(RouteTable) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RouterApplianceInstance) DeepCopyInto(out *RouterApplianceInstance) { + *out = *in + if in.IpAddress != nil { + in, out := &in.IpAddress, &out.IpAddress + *out = new(string) + **out = **in + } + if in.VirtualMachine != nil { + in, out := &in.VirtualMachine, &out.VirtualMachine + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouterApplianceInstance. +func (in *RouterApplianceInstance) DeepCopy() *RouterApplianceInstance { + if in == nil { + return nil + } + out := new(RouterApplianceInstance) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RoutingVPC) DeepCopyInto(out *RoutingVPC) { + *out = *in + if in.RequiredForNewSiteToSiteDataTransferSpokes != nil { + in, out := &in.RequiredForNewSiteToSiteDataTransferSpokes, &out.RequiredForNewSiteToSiteDataTransferSpokes + *out = new(bool) + **out = **in + } + if in.Uri != nil { + in, out := &in.Uri, &out.Uri + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RoutingVPC. +func (in *RoutingVPC) DeepCopy() *RoutingVPC { + if in == nil { + return nil + } + out := new(RoutingVPC) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceClass) DeepCopyInto(out *ServiceClass) { + *out = *in + if in.CreateTime != nil { + in, out := &in.CreateTime, &out.CreateTime + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Etag != nil { + in, out := &in.Etag, &out.Etag + *out = new(string) + **out = **in + } + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.ServiceClass != nil { + in, out := &in.ServiceClass, &out.ServiceClass + *out = new(string) + **out = **in + } + if in.UpdateTime != nil { + in, out := &in.UpdateTime, &out.UpdateTime + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceClass. +func (in *ServiceClass) DeepCopy() *ServiceClass { + if in == nil { + return nil + } + out := new(ServiceClass) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceConnectionMap) DeepCopyInto(out *ServiceConnectionMap) { + *out = *in + if in.ConsumerPscConfigs != nil { + in, out := &in.ConsumerPscConfigs, &out.ConsumerPscConfigs + *out = make([]ConsumerPscConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ConsumerPscConnections != nil { + in, out := &in.ConsumerPscConnections, &out.ConsumerPscConnections + *out = make([]ConsumerPscConnection, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.CreateTime != nil { + in, out := &in.CreateTime, &out.CreateTime + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Etag != nil { + in, out := &in.Etag, &out.Etag + *out = new(string) + **out = **in + } + if in.Infrastructure != nil { + in, out := &in.Infrastructure, &out.Infrastructure + *out = new(string) + **out = **in + } + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.ProducerPscConfigs != nil { + in, out := &in.ProducerPscConfigs, &out.ProducerPscConfigs + *out = make([]ProducerPscConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ServiceClass != nil { + in, out := &in.ServiceClass, &out.ServiceClass + *out = new(string) + **out = **in + } + if in.ServiceClassUri != nil { + in, out := &in.ServiceClassUri, &out.ServiceClassUri + *out = new(string) + **out = **in + } + if in.Token != nil { + in, out := &in.Token, &out.Token + *out = new(string) + **out = **in + } + if in.UpdateTime != nil { + in, out := &in.UpdateTime, &out.UpdateTime + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceConnectionMap. +func (in *ServiceConnectionMap) DeepCopy() *ServiceConnectionMap { + if in == nil { + return nil + } + out := new(ServiceConnectionMap) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceConnectionPolicy) DeepCopyInto(out *ServiceConnectionPolicy) { + *out = *in + if in.CreateTime != nil { + in, out := &in.CreateTime, &out.CreateTime + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Etag != nil { + in, out := &in.Etag, &out.Etag + *out = new(string) + **out = **in + } + if in.Infrastructure != nil { + in, out := &in.Infrastructure, &out.Infrastructure + *out = new(string) + **out = **in + } + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(string) + **out = **in + } + if in.PscConfig != nil { + in, out := &in.PscConfig, &out.PscConfig + *out = new(PscConfig) + (*in).DeepCopyInto(*out) + } + if in.PscConnections != nil { + in, out := &in.PscConnections, &out.PscConnections + *out = make([]PscConnection, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ServiceClass != nil { + in, out := &in.ServiceClass, &out.ServiceClass + *out = new(string) + **out = **in + } + if in.UpdateTime != nil { + in, out := &in.UpdateTime, &out.UpdateTime + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceConnectionPolicy. +func (in *ServiceConnectionPolicy) DeepCopy() *ServiceConnectionPolicy { + if in == nil { + return nil + } + out := new(ServiceConnectionPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceConnectionToken) DeepCopyInto(out *ServiceConnectionToken) { + *out = *in + if in.CreateTime != nil { + in, out := &in.CreateTime, &out.CreateTime + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Etag != nil { + in, out := &in.Etag, &out.Etag + *out = new(string) + **out = **in + } + if in.ExpireTime != nil { + in, out := &in.ExpireTime, &out.ExpireTime + *out = new(string) + **out = **in + } + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Network != nil { + in, out := &in.Network, &out.Network + *out = new(string) + **out = **in + } + if in.Token != nil { + in, out := &in.Token, &out.Token + *out = new(string) + **out = **in + } + if in.UpdateTime != nil { + in, out := &in.UpdateTime, &out.UpdateTime + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceConnectionToken. +func (in *ServiceConnectionToken) DeepCopy() *ServiceConnectionToken { + if in == nil { + return nil + } + out := new(ServiceConnectionToken) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Spoke) DeepCopyInto(out *Spoke) { + *out = *in + if in.CreateTime != nil { + in, out := &in.CreateTime, &out.CreateTime + *out = new(string) + **out = **in + } + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.Group != nil { + in, out := &in.Group, &out.Group + *out = new(string) + **out = **in + } + if in.Hub != nil { + in, out := &in.Hub, &out.Hub + *out = new(string) + **out = **in + } + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.LinkedInterconnectAttachments != nil { + in, out := &in.LinkedInterconnectAttachments, &out.LinkedInterconnectAttachments + *out = new(LinkedInterconnectAttachments) + (*in).DeepCopyInto(*out) + } + if in.LinkedRouterApplianceInstances != nil { + in, out := &in.LinkedRouterApplianceInstances, &out.LinkedRouterApplianceInstances + *out = new(LinkedRouterApplianceInstances) + (*in).DeepCopyInto(*out) + } + if in.LinkedVpcNetwork != nil { + in, out := &in.LinkedVpcNetwork, &out.LinkedVpcNetwork + *out = new(LinkedVpcNetwork) + (*in).DeepCopyInto(*out) + } + if in.LinkedVpnTunnels != nil { + in, out := &in.LinkedVpnTunnels, &out.LinkedVpnTunnels + *out = new(LinkedVpnTunnels) + (*in).DeepCopyInto(*out) + } + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Reasons != nil { + in, out := &in.Reasons, &out.Reasons + *out = make([]StateReason, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SpokeType != nil { + in, out := &in.SpokeType, &out.SpokeType + *out = new(string) + **out = **in + } + if in.State != nil { + in, out := &in.State, &out.State + *out = new(string) + **out = **in + } + if in.UniqueID != nil { + in, out := &in.UniqueID, &out.UniqueID + *out = new(string) + **out = **in + } + if in.UpdateTime != nil { + in, out := &in.UpdateTime, &out.UpdateTime + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Spoke. +func (in *Spoke) DeepCopy() *Spoke { + if in == nil { + return nil + } + out := new(Spoke) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SpokeStateCount) DeepCopyInto(out *SpokeStateCount) { + *out = *in + if in.Count != nil { + in, out := &in.Count, &out.Count + *out = new(int64) + **out = **in + } + if in.State != nil { + in, out := &in.State, &out.State + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SpokeStateCount. +func (in *SpokeStateCount) DeepCopy() *SpokeStateCount { + if in == nil { + return nil + } + out := new(SpokeStateCount) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SpokeStateReasonCount) DeepCopyInto(out *SpokeStateReasonCount) { + *out = *in + if in.Count != nil { + in, out := &in.Count, &out.Count + *out = new(int64) + **out = **in + } + if in.StateReasonCode != nil { + in, out := &in.StateReasonCode, &out.StateReasonCode + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SpokeStateReasonCount. +func (in *SpokeStateReasonCount) DeepCopy() *SpokeStateReasonCount { + if in == nil { + return nil + } + out := new(SpokeStateReasonCount) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SpokeSummary) DeepCopyInto(out *SpokeSummary) { + *out = *in + if in.SpokeStateCounts != nil { + in, out := &in.SpokeStateCounts, &out.SpokeStateCounts + *out = make([]SpokeStateCount, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SpokeStateReasonCounts != nil { + in, out := &in.SpokeStateReasonCounts, &out.SpokeStateReasonCounts + *out = make([]SpokeStateReasonCount, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SpokeTypeCounts != nil { + in, out := &in.SpokeTypeCounts, &out.SpokeTypeCounts + *out = make([]SpokeTypeCount, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SpokeSummary. +func (in *SpokeSummary) DeepCopy() *SpokeSummary { + if in == nil { + return nil + } + out := new(SpokeSummary) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SpokeTypeCount) DeepCopyInto(out *SpokeTypeCount) { + *out = *in + if in.Count != nil { + in, out := &in.Count, &out.Count + *out = new(int64) + **out = **in + } + if in.SpokeType != nil { + in, out := &in.SpokeType, &out.SpokeType + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SpokeTypeCount. +func (in *SpokeTypeCount) DeepCopy() *SpokeTypeCount { + if in == nil { + return nil + } + out := new(SpokeTypeCount) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StateReason) DeepCopyInto(out *StateReason) { + *out = *in + if in.Code != nil { + in, out := &in.Code, &out.Code + *out = new(string) + **out = **in + } + if in.Message != nil { + in, out := &in.Message, &out.Message + *out = new(string) + **out = **in + } + if in.UserDetails != nil { + in, out := &in.UserDetails, &out.UserDetails + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StateReason. +func (in *StateReason) DeepCopy() *StateReason { + if in == nil { + return nil + } + out := new(StateReason) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VirtualMachine) DeepCopyInto(out *VirtualMachine) { + *out = *in + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualMachine. +func (in *VirtualMachine) DeepCopy() *VirtualMachine { + if in == nil { + return nil + } + out := new(VirtualMachine) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Warnings) DeepCopyInto(out *Warnings) { + *out = *in + if in.Code != nil { + in, out := &in.Code, &out.Code + *out = new(string) + **out = **in + } + if in.Data != nil { + in, out := &in.Data, &out.Data + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.WarningMessage != nil { + in, out := &in.WarningMessage, &out.WarningMessage + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Warnings. +func (in *Warnings) DeepCopy() *Warnings { + if in == nil { + return nil + } + out := new(Warnings) + in.DeepCopyInto(out) + return out +} diff --git a/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_networkconnectivityserviceconnectionpolicies.networkconnectivity.cnrm.cloud.google.com.yaml b/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_networkconnectivityserviceconnectionpolicies.networkconnectivity.cnrm.cloud.google.com.yaml new file mode 100644 index 0000000000..3cb9231c34 --- /dev/null +++ b/config/crds/resources/apiextensions.k8s.io_v1_customresourcedefinition_networkconnectivityserviceconnectionpolicies.networkconnectivity.cnrm.cloud.google.com.yaml @@ -0,0 +1,308 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + cnrm.cloud.google.com/version: 0.0.0-dev + creationTimestamp: null + labels: + cnrm.cloud.google.com/managed-by-kcc: "true" + cnrm.cloud.google.com/system: "true" + name: networkconnectivityserviceconnectionpolicies.networkconnectivity.cnrm.cloud.google.com +spec: + group: networkconnectivity.cnrm.cloud.google.com + names: + kind: NetworkConnectivityServiceConnectionPolicy + listKind: NetworkConnectivityServiceConnectionPolicyList + plural: networkconnectivityserviceconnectionpolicies + singular: networkconnectivityserviceconnectionpolicy + preserveUnknownFields: false + scope: Namespaced + versions: + - additionalPrinterColumns: + - description: When 'True', the most recent reconcile of the resource succeeded + jsonPath: .status.conditions[?(@.type=='Ready')].status + name: Ready + type: string + - description: The reason for the value in 'Ready' + jsonPath: .status.conditions[?(@.type=='Ready')].reason + name: Status + type: string + - description: The last transition time for the value in 'Status' + jsonPath: .status.conditions[?(@.type=='Ready')].lastTransitionTime + name: Status Age + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: NetworkConnectivityServiceConnectionPolicy is the Schema for + the NetworkConnectivityServiceConnectionPolicy API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: NetworkConnectivityServiceConnectionPolicySpec defines the + desired state of NetworkConnectivityServiceConnectionPolicy + properties: + description: + description: A description of this resource. + type: string + networkRef: + description: 'The resource path of the consumer network. Example: + - projects/{projectNumOrId}/global/networks/{resourceId}.' + oneOf: + - not: + required: + - external + required: + - name + - not: + anyOf: + - required: + - name + - required: + - namespace + required: + - external + properties: + external: + description: The compute network selflink of form "projects//global/networks/", + when not managed by KCC. + type: string + name: + description: The `name` field of a `ComputeNetwork` resource. + type: string + namespace: + description: The `namespace` field of a `ComputeNetwork` resource. + type: string + type: object + pscConfig: + description: Configuration used for Private Service Connect connections. + Used when Infrastructure is PSC. + properties: + limit: + description: Optional. Max number of PSC connections for this + policy. + format: int64 + type: integer + producerInstanceLocation: + description: Required. ProducerInstanceLocation is used to specify + which authorization mechanism to use to determine which projects + the Producer instance can be within. + type: string + subnetworkRefs: + description: 'The resource paths of subnetworks to use for IP + address management. Example: projects/{projectNumOrId}/regions/{region}/subnetworks/{resourceId}.' + items: + oneOf: + - not: + required: + - external + required: + - name + - not: + anyOf: + - required: + - name + - required: + - namespace + required: + - external + properties: + external: + description: The ComputeSubnetwork selflink of form "projects/{{project}}/regions/{{region}}/subnetworks/{{name}}", + when not managed by KCC. + type: string + name: + description: The `name` field of a `ComputeSubnetwork` resource. + type: string + namespace: + description: The `namespace` field of a `ComputeSubnetwork` + resource. + type: string + type: object + type: array + type: object + resourceID: + description: The NetworkConnectivityServiceConnectionPolicy name. + If not given, the metadata.name will be used. + type: string + serviceClass: + description: The service class identifier for which this ServiceConnectionPolicy + is for. The service class identifier is a unique, symbolic representation + of a ServiceClass. It is provided by the Service Producer. Google + services have a prefix of gcp. For example, gcp-cloud-sql. 3rd party + services do not. For example, test-service-a3dfcx. + type: string + type: object + status: + description: NetworkConnectivityServiceConnectionPolicyStatus defines + the config connector machine state of NetworkConnectivityServiceConnectionPolicy + properties: + conditions: + description: Conditions represent the latest available observations + of the object's current state. + items: + properties: + lastTransitionTime: + description: Last time the condition transitioned from one status + to another. + type: string + message: + description: Human-readable message indicating details about + last transition. + type: string + reason: + description: Unique, one-word, CamelCase reason for the condition's + last transition. + type: string + status: + description: Status is the status of the condition. Can be True, + False, Unknown. + type: string + type: + description: Type is the type of the condition. + type: string + type: object + type: array + externalRef: + description: A unique specifier for the NetworkConnectivityServiceConnectionPolicy + resource in GCP. + type: string + observedGeneration: + description: ObservedGeneration is the generation of the resource + that was most recently observed by the Config Connector controller. + If this is equal to metadata.generation, then that means that the + current reported status reflects the most recent desired state of + the resource. + format: int64 + type: integer + observedState: + description: ObservedState is the state of the resource as most recently + observed in GCP. + properties: + createTime: + description: Output only. Time when the ServiceConnectionMap was + created. + type: string + etag: + description: Optional. The etag is computed by the server, and + may be sent on update and delete requests to ensure the client + has an up-to-date value before proceeding. + type: string + infrastructure: + description: Output only. The type of underlying resources used + to create the connection. + type: string + pscConnections: + description: Output only. [Output only] Information about each + Private Service Connect connection. + items: + properties: + consumerAddress: + description: The resource reference of the consumer address. + type: string + consumerForwardingRule: + description: The resource reference of the PSC Forwarding + Rule within the consumer VPC. + type: string + consumerTargetProject: + description: The project where the PSC connection is created. + type: string + error: + description: The most recent error during operating this + connection. + properties: + code: + description: The status code, which should be an enum + value of google.rpc.Code. + format: int32 + type: integer + message: + description: A developer-facing error message, which + should be in English. Any user-facing error message + should be localized and sent in the google.rpc.Status.details + field, or localized by the client. + type: string + type: object + errorInfo: + description: Output only. The error info for the latest + error during operating this connection. + properties: + domain: + description: 'The logical grouping to which the "reason" + belongs. The error domain is typically the registered + service name of the tool or product that generates + the error. Example: "pubsub.googleapis.com". If the + error is generated by some common infrastructure, + the error domain must be a globally unique value that + identifies the infrastructure. For Google API infrastructure, + the error domain is "googleapis.com".' + type: string + metadata: + additionalProperties: + type: string + description: 'Additional structured details about this + error. Keys must match /a-z+/ but should ideally be + lowerCamelCase. Also they must be limited to 64 characters + in length. When identifying the current value of an + exceeded limit, the units should be contained in the + key, not the value. For example, rather than {"instanceLimit": + "100/request"}, should be returned as, {"instanceLimitPerRequest": + "100"}, if the client exceeds the number of instances + that can be created in a single (batch) request.' + type: object + reason: + description: The reason of the error. This is a constant + value that identifies the proximate cause of the error. + Error reasons are unique within a particular domain + of errors. This should be at most 63 characters and + match a regular expression of `A-Z+[A-Z0-9]`, which + represents UPPER_SNAKE_CASE. + type: string + type: object + errorType: + description: The error type indicates whether the error + is consumer facing, producer facing or system internal. + type: string + gceOperation: + description: The last Compute Engine operation to setup + PSC connection. + type: string + producerInstanceID: + description: Immutable. An immutable identifier for the + producer instance. + type: string + pscConnectionID: + description: The PSC connection id of the PSC forwarding + rule. + type: string + selectedSubnetwork: + description: Output only. The URI of the subnetwork selected + to allocate IP address for this connection. + type: string + state: + description: State of the PSC Connection + type: string + type: object + type: array + updateTime: + description: Output only. Time when the ServiceConnectionMap was + updated. + type: string + type: object + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/dev/tools/controllerbuilder/generate.sh b/dev/tools/controllerbuilder/generate.sh index ebb2945829..e2678b331d 100755 --- a/dev/tools/controllerbuilder/generate.sh +++ b/dev/tools/controllerbuilder/generate.sh @@ -49,3 +49,20 @@ go run . generate-mapper \ --api-go-package-path github.com/GoogleCloudPlatform/k8s-config-connector/apis \ --output-dir ~/kcc/k8s-config-connector/pkg/controller/direct/ \ --api-dir ~/kcc/k8s-config-connector/apis/ + +# NetworkConnectivity +go run . generate-types \ + --proto-source-path ../proto-to-mapper/build/googleapis.pb \ + --service mockgcp.cloud.networkconnectivity.v1 \ + --version networkconnectivity.cnrm.cloud.google.com/v1alpha1 \ + --output-api ~/kcc/k8s-config-connector/apis \ + --kinds NetworkConnectivityServiceConnectionPolicy + +# TODO: mappers +# go run . generate-mapper \ +# --proto-source-path ../proto-to-mapper/build/googleapis.pb \ +# --service mockgcp.cloud.networkconnectivity.v1 \ +# --version networkconnectivity.cnrm.cloud.google.com/v1alpha1 \ +# --api-go-package-path github.com/GoogleCloudPlatform/k8s-config-connector/apis \ +# --output-dir ~/kcc/k8s-config-connector/pkg/controller/direct/ \ +# --api-dir ~/kcc/k8s-config-connector/apis/ diff --git a/dev/tools/controllerbuilder/go.mod b/dev/tools/controllerbuilder/go.mod index d2064fc6d3..55de523f28 100644 --- a/dev/tools/controllerbuilder/go.mod +++ b/dev/tools/controllerbuilder/go.mod @@ -7,19 +7,19 @@ toolchain go1.22.5 require ( github.com/fatih/color v1.17.0 github.com/spf13/cobra v1.8.0 - golang.org/x/tools v0.21.0 + golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d google.golang.org/protobuf v1.34.2 - k8s.io/apimachinery v0.30.2 + k8s.io/apimachinery v0.27.11 k8s.io/klog/v2 v2.130.1 ) require ( - github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/logr v1.4.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/spf13/pflag v1.0.5 // indirect golang.org/x/mod v0.17.0 // indirect - golang.org/x/sys v0.20.0 // indirect + golang.org/x/sys v0.22.0 // indirect ) diff --git a/dev/tools/controllerbuilder/go.sum b/dev/tools/controllerbuilder/go.sum index d32910d571..d30a4d3eb5 100644 --- a/dev/tools/controllerbuilder/go.sum +++ b/dev/tools/controllerbuilder/go.sum @@ -1,8 +1,7 @@ github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= -github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= @@ -44,16 +43,14 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.21.0 h1:qc0xYgIbsSDt9EyWz05J5wfa7LOVW0YTLOXrqdLAWIw= -golang.org/x/tools v0.21.0/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -62,7 +59,6 @@ google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6h google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/apimachinery v0.30.2 h1:fEMcnBj6qkzzPGSVsAZtQThU62SmQ4ZymlXRC5yFSCg= -k8s.io/apimachinery v0.30.2/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc= +k8s.io/apimachinery v0.27.11 h1:ivrKMN7JgdtKhay14S5UQlvilV3z6W+wjiSQTzyr5zc= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= diff --git a/dev/tools/controllerbuilder/pkg/codegen/generatorbase.go b/dev/tools/controllerbuilder/pkg/codegen/generatorbase.go index 951e8a46ca..36c22770a8 100644 --- a/dev/tools/controllerbuilder/pkg/codegen/generatorbase.go +++ b/dev/tools/controllerbuilder/pkg/codegen/generatorbase.go @@ -26,43 +26,55 @@ import ( ) type generatorBase struct { + outputBaseDir string generatedFiles map[generatedFileKey]*generatedFile + errors []error } -func (g *generatorBase) init() { +func (g *generatorBase) init(outputBaseDir string) { + g.outputBaseDir = outputBaseDir g.generatedFiles = make(map[generatedFileKey]*generatedFile) } func (g *generatorBase) getOutputFile(k generatedFileKey) *generatedFile { out := g.generatedFiles[k] if out == nil { - out = &generatedFile{key: k} + out = &generatedFile{key: k, baseDir: g.outputBaseDir} g.generatedFiles[k] = out } return out } +func (g *generatorBase) Errorf(msg string, args ...any) { + g.errors = append(g.errors, fmt.Errorf(msg, args...)) +} + type generatedFile struct { + baseDir string key generatedFileKey contents bytes.Buffer } type generatedFileKey struct { - GoPackagePath string + GoPackage string + + FileName string +} - File string +func (f *generatedFile) OutputDir() string { + tokens := strings.Split(f.key.GoPackage, ".") + dirTokens := []string{f.baseDir} + dirTokens = append(dirTokens, tokens...) + dir := filepath.Join(dirTokens...) + return dir } -func (f *generatedFile) Write(baseDir string, addCopyright bool) error { +func (f *generatedFile) Write(addCopyright bool) error { if f.contents.Len() == 0 { return nil } - fullName := f.key.GoPackagePath - tokens := strings.Split(fullName, ".") - dirTokens := []string{baseDir} - dirTokens = append(dirTokens, tokens...) - dir := filepath.Join(dirTokens...) + dir := f.OutputDir() if err := os.MkdirAll(dir, 0755); err != nil { return fmt.Errorf("creating directory %q: %w", dir, err) @@ -76,7 +88,7 @@ func (f *generatedFile) Write(baseDir string, addCopyright bool) error { f.contents.WriteTo(&w) - p := filepath.Join(dir, f.key.File) + p := filepath.Join(dir, f.key.FileName) klog.Infof("writing file %v", p) if err := os.WriteFile(p, w.Bytes(), 0644); err != nil { return fmt.Errorf("writing %q: %w", p, err) @@ -85,9 +97,9 @@ func (f *generatedFile) Write(baseDir string, addCopyright bool) error { return nil } -func (v *generatorBase) WriteFiles(baseDir string, addCopyright bool) error { +func (v *generatorBase) WriteFiles(addCopyright bool) error { for _, f := range v.generatedFiles { - if err := f.Write(baseDir, addCopyright); err != nil { + if err := f.Write(addCopyright); err != nil { return err } } diff --git a/dev/tools/controllerbuilder/pkg/codegen/mappergenerator.go b/dev/tools/controllerbuilder/pkg/codegen/mappergenerator.go index 68726bb50b..1005926e49 100644 --- a/dev/tools/controllerbuilder/pkg/codegen/mappergenerator.go +++ b/dev/tools/controllerbuilder/pkg/codegen/mappergenerator.go @@ -39,12 +39,12 @@ type MapperGenerator struct { precomputedMappings map[protoreflect.FullName]map[string]*gocode.GoStruct } -func NewMapperGenerator(goPathForMessage OutputFunc) *MapperGenerator { +func NewMapperGenerator(goPathForMessage OutputFunc, outputBaseDir string) *MapperGenerator { g := &MapperGenerator{ goPathForMessage: goPathForMessage, precomputedMappings: make(map[protoreflect.FullName]map[string]*gocode.GoStruct), } - g.generatorBase.init() + g.generatorBase.init(outputBaseDir) return g } @@ -162,12 +162,12 @@ func (v *MapperGenerator) GenerateMappers() error { } k := generatedFileKey{ - GoPackagePath: goPackage, - File: "mapper.generated.go", + GoPackage: goPackage, + FileName: "mapper.generated.go", } out := v.generatedFiles[k] if out == nil { - out = &generatedFile{key: k} + out = &generatedFile{key: k, baseDir: v.outputBaseDir} v.generatedFiles[k] = out pbPackage := pair.ProtoGoPackage diff --git a/dev/tools/controllerbuilder/pkg/codegen/typegenerator.go b/dev/tools/controllerbuilder/pkg/codegen/typegenerator.go index 5a301cc12f..7cc060da91 100644 --- a/dev/tools/controllerbuilder/pkg/codegen/typegenerator.go +++ b/dev/tools/controllerbuilder/pkg/codegen/typegenerator.go @@ -17,6 +17,7 @@ package codegen import ( "fmt" "io" + "os" "path/filepath" "sort" "strconv" @@ -30,15 +31,15 @@ import ( type TypeGenerator struct { generatorBase - goPathForMessage OutputFunc - visitedMessages []protoreflect.MessageDescriptor + goPackageForMessage OutputFunc + visitedMessages []protoreflect.MessageDescriptor } -func NewTypeGenerator(goPathForMessage OutputFunc) *TypeGenerator { +func NewTypeGenerator(goPathForMessage OutputFunc, outputBaseDir string) *TypeGenerator { g := &TypeGenerator{ - goPathForMessage: goPathForMessage, + goPackageForMessage: goPathForMessage, } - g.generatorBase.init() + g.generatorBase.init(outputBaseDir) return g } @@ -86,7 +87,7 @@ func writeCopyright(w io.Writer, year int) { } func (g *TypeGenerator) visitMessage(msg protoreflect.MessageDescriptor, seen map[string]bool) { - if _, visit := g.goPathForMessage(msg); !visit { + if _, visit := g.goPackageForMessage(msg); !visit { return } @@ -109,19 +110,31 @@ func (g *TypeGenerator) writeVisitedMessages() { continue } - goPath, ok := g.goPathForMessage(msg) + goPackage, ok := g.goPackageForMessage(msg) if !ok { continue } - krmVersion := filepath.Base(goPath) + krmVersion := filepath.Base(goPackage) k := generatedFileKey{ - GoPackagePath: goPath, - File: "types.generated.go", + GoPackage: goPackage, + FileName: "types.generated.go", } out := g.getOutputFile(k) + goTypeName := goNameForProtoMessage(msg, msg) + skipGenerated := true + goType, err := g.findTypeDeclaration(goTypeName, out.OutputDir(), skipGenerated) + if err != nil { + g.Errorf("lookup up go type: %w", err) + continue + } + if goType != nil { + klog.Infof("found existing non-generated go type %q, won't generate", goTypeName) + continue + } + w := &out.contents if out.contents.Len() == 0 { @@ -160,7 +173,7 @@ func WriteField(out io.Writer, field protoreflect.FieldDescriptor, msg protorefl } else if keyKind == protoreflect.StringKind && valueKind == protoreflect.Int64Kind { goType = "map[string]int64" } else { - fmt.Fprintf(out, "\n\n\t// TODO: map type %v %v for %v\n\n", keyKind, valueKind, field.Name()) + fmt.Fprintf(out, "\n\t// TODO: map type %v %v for %v\n\n", keyKind, valueKind, field.Name()) return } } else { @@ -279,3 +292,33 @@ func getJSONForKRM(protoField protoreflect.FieldDescriptor) string { } return jsonName } + +func (g *TypeGenerator) findTypeDeclaration(goTypeName string, srcDir string, skipGenerated bool) (*string, error) { + files, err := os.ReadDir(srcDir) + if err != nil { + return nil, fmt.Errorf("reading directory %q: %w", srcDir, err) + } + + for _, f := range files { + p := filepath.Join(srcDir, f.Name()) + if !strings.HasSuffix(p, ".go") { + continue + } + if strings.HasSuffix(p, "generated.go") { + continue + } + b, err := os.ReadFile(p) + if err != nil { + return nil, fmt.Errorf("reading file %q: %w", p, err) + } + + for _, line := range strings.Split(string(b), "\n") { + line = strings.TrimSpace(line) + if strings.HasPrefix(line, "type "+goTypeName+" ") { + return &line, nil + } + } + } + + return nil, nil +} diff --git a/dev/tools/controllerbuilder/pkg/commands/generatemapper/generatemappercommand.go b/dev/tools/controllerbuilder/pkg/commands/generatemapper/generatemappercommand.go index 2ddbf3ef3a..a17750e784 100644 --- a/dev/tools/controllerbuilder/pkg/commands/generatemapper/generatemappercommand.go +++ b/dev/tools/controllerbuilder/pkg/commands/generatemapper/generatemappercommand.go @@ -79,6 +79,9 @@ func RunGenerateMapper(ctx context.Context, o *GenerateMapperOptions) error { if o.APIGoPackagePath == "" { return fmt.Errorf("GoPackagePath is required") } + if o.OutputMapperDirectory == "" { + return fmt.Errorf("OutputMapperDirectory is required") + } api, err := protoapi.LoadProto(o.GenerateOptions.ProtoSourcePath) if err != nil { @@ -104,6 +107,7 @@ func RunGenerateMapper(ctx context.Context, o *GenerateMapperOptions) error { } protoPackagePath := string(msg.ParentFile().Package()) + protoPackagePath = strings.TrimPrefix(protoPackagePath, "mockgcp.") protoPackagePath = strings.TrimPrefix(protoPackagePath, "google.") protoPackagePath = strings.TrimPrefix(protoPackagePath, "cloud.") protoPackagePath = strings.TrimSuffix(protoPackagePath, ".v1") @@ -114,7 +118,7 @@ func RunGenerateMapper(ctx context.Context, o *GenerateMapperOptions) error { return goPackage, true } - mapperGenerator := codegen.NewMapperGenerator(pathForMessage) + mapperGenerator := codegen.NewMapperGenerator(pathForMessage, o.OutputMapperDirectory) if err := mapperGenerator.VisitGoCode(o.APIGoPackagePath, o.APIDirectory); err != nil { return err @@ -129,7 +133,7 @@ func RunGenerateMapper(ctx context.Context, o *GenerateMapperOptions) error { } addCopyright := true - if err := mapperGenerator.WriteFiles(o.OutputMapperDirectory, addCopyright); err != nil { + if err := mapperGenerator.WriteFiles(addCopyright); err != nil { return err } diff --git a/dev/tools/controllerbuilder/pkg/commands/generatetypes/generatetypescommand.go b/dev/tools/controllerbuilder/pkg/commands/generatetypes/generatetypescommand.go index 41b8e3571c..275a7e2437 100644 --- a/dev/tools/controllerbuilder/pkg/commands/generatetypes/generatetypescommand.go +++ b/dev/tools/controllerbuilder/pkg/commands/generatetypes/generatetypescommand.go @@ -121,13 +121,13 @@ func RunGenerateCRD(ctx context.Context, o *GenerateCRDOptions) error { return goPackage, true } - typeGenerator := codegen.NewTypeGenerator(pathForMessage) + typeGenerator := codegen.NewTypeGenerator(pathForMessage, o.OutputAPIDirectory) if err := typeGenerator.VisitProto(api); err != nil { return err } addCopyright := true - if err := typeGenerator.WriteFiles(o.OutputAPIDirectory, addCopyright); err != nil { + if err := typeGenerator.WriteFiles(addCopyright); err != nil { return err } @@ -154,7 +154,7 @@ func RunGenerateCRD(ctx context.Context, o *GenerateCRDOptions) error { } for _, kind := range o.KindNames { if !scaffolder.TypeFileNotExist(kind) { - fmt.Printf("file %s already exist, skip", scaffolder.GetTypeFile(kind)) + fmt.Printf("file %s already exists, skipping\n", scaffolder.GetTypeFile(kind)) continue } if err := scaffolder.AddTypeFile(kind); err != nil { diff --git a/dev/tools/proto-to-mapper/Makefile b/dev/tools/proto-to-mapper/Makefile index 84eb794d4e..df64100ebe 100644 --- a/dev/tools/proto-to-mapper/Makefile +++ b/dev/tools/proto-to-mapper/Makefile @@ -9,6 +9,8 @@ generate-pb: install-protoc-linux git clone https://github.com/googleapis/googleapis.git third_party/googleapis || (cd third_party/googleapis && git reset --hard origin/master && git pull) protoc --include_imports --include_source_info \ -I ./third_party/googleapis/ \ + -I ../../../mockgcp/apis \ + ../../../mockgcp/apis/mockgcp/cloud/networkconnectivity/*/*.proto \ ./third_party/googleapis/google/api/*.proto \ ./third_party/googleapis/google/api/*/*/*.proto \ ./third_party/googleapis/google/bigtable/*/*/*.proto \ diff --git a/go.mod b/go.mod index c0c5a6837d..66f510a68a 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( github.com/appscode/jsonpatch v0.0.0-20190108182946-7c0e3b262f30 github.com/blang/semver v3.5.1+incompatible github.com/cenkalti/backoff v2.2.1+incompatible - github.com/fatih/color v1.15.0 + github.com/fatih/color v1.17.0 github.com/ghodss/yaml v1.0.0 github.com/go-logr/logr v1.4.2 github.com/go-logr/zapr v1.3.0 @@ -45,7 +45,7 @@ require ( github.com/prometheus/procfs v0.12.0 github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd - github.com/spf13/cobra v1.7.0 + github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 github.com/tmccombs/hcl2json v0.3.4 github.com/zclconf/go-cty v1.13.0 @@ -66,7 +66,7 @@ require ( k8s.io/apiextensions-apiserver v0.27.9 k8s.io/apimachinery v0.27.11 k8s.io/client-go v0.27.11 - k8s.io/klog/v2 v2.100.1 + k8s.io/klog/v2 v2.130.1 sigs.k8s.io/controller-runtime v0.15.2 sigs.k8s.io/controller-tools v0.6.2 sigs.k8s.io/kubebuilder-declarative-pattern v0.15.0-beta.2 @@ -169,7 +169,7 @@ require ( github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.17 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.9 // indirect github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect diff --git a/go.sum b/go.sum index f3313c5063..8f92bdf59f 100644 --- a/go.sum +++ b/go.sum @@ -208,7 +208,7 @@ github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfc github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creachadair/staticfile v0.1.2/go.mod h1:a3qySzCIXEprDGxk6tSxSI+dBBdLzqeBOMhZ+o2d3pM= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -269,8 +269,8 @@ github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwo github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= -github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= +github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= +github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/flowstack/go-jsonschema v0.1.1/go.mod h1:yL7fNggx1o8rm9RlgXv7hTBWxdBM0rVwpMwimd3F3N0= @@ -321,7 +321,6 @@ github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -674,8 +673,8 @@ github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= @@ -852,8 +851,8 @@ github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3 github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -1541,8 +1540,8 @@ k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= -k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= +k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= diff --git a/go.work b/go.work index d1230ed5d5..c4e017f45a 100644 --- a/go.work +++ b/go.work @@ -2,6 +2,7 @@ go 1.22.5 use ( . + ./dev/tools/controllerbuilder ./mockgcp // ./third_party/github.com/hashicorp/terraform-provider-google-beta ) diff --git a/go.work.sum b/go.work.sum index d399638f5c..bc7b594d58 100644 --- a/go.work.sum +++ b/go.work.sum @@ -134,24 +134,34 @@ github.com/antlr/antlr4/runtime/Go/antlr v1.4.10/go.mod h1:F7bn7fEU90QkQ3tnmaTx3 github.com/apache/arrow/go/v15 v15.0.2/go.mod h1:DGXsR3ajT524njufqf95822i+KTh+yea1jass9YXgjA= github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0= github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= +github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ= github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk= +github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8= github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/coreos/go-systemd/v22 v22.4.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/daviddengcn/go-colortext v1.0.0/go.mod h1:zDqEI5NVUop5QPpVJUxE9UO10hRnmkD5G4Pmri9+m4c= github.com/docker/distribution v2.8.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk= +github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE= +github.com/fxamacker/cbor/v2 v2.6.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= -github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/cel-go v0.12.7/go.mod h1:Jk7ljRzLBhkmiAwBoUxB1sZSCVBAzkqPF25olK/iRDw= github.com/google/flatbuffers v23.5.26+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= +github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= github.com/google/go-pkcs11 v0.2.1-0.20230907215043-c6f79328ddf9/go.mod h1:6eQoGcuNJpa7jnd5pMGdkSaQpNDYvPlXWMcjXXThLlY= github.com/google/martian/v3 v3.3.3/go.mod h1:iEPrYcgCF7jA9OtScMFQyAlZZ4YXTKEtJ1E6RWzmBA0= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/cloud-bigtable-clients-test v0.0.0-20230505150253-16eeee810d3a/go.mod h1:2n/InOx7Q1jaqXZJ0poJmsZxb6K+OfHEbhA/+LPJrII= github.com/googleapis/cloud-bigtable-clients-test v0.0.2/go.mod h1:mk3CrkrouRgtnhID6UZQDK3DrFFa7cYCAJcEmNsHYrY= github.com/googleapis/gax-go/v2 v2.12.4/go.mod h1:KYEYLorsnIGDi/rPC8b5TdlB9kbKoFubselGIoBMCwI= @@ -168,19 +178,26 @@ github.com/lyft/protoc-gen-star/v2 v2.0.3/go.mod h1:amey7yeodaJhXSbf/TlLvWiqQfLO github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mmcloughlin/avo v0.5.0/go.mod h1:ChHFdoV7ql95Wi7vuq2YT1bwCJqiWdZrQ1im3VujLYM= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU= +github.com/onsi/ginkgo/v2 v2.13.2/go.mod h1:XStQ8QcGwLyF4HdfcZB8SFOS/MWCgDuXMSBe6zrvLgM= +github.com/onsi/ginkgo/v2 v2.15.0/go.mod h1:HlxMHtYF57y6Dpf+mc5529KKmSq9h2FpCF+/ZkwUxKM= +github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= +github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= +github.com/onsi/gomega v1.31.0/go.mod h1:DW9aCi7U6Yi40wNVAvT6kzFnEVEI5n3DloYBiKiT6zk= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/pierrec/lz4/v4 v4.1.18/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= -github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75/go.mod h1:KO6IkyS8Y3j8OdNO85qEYBsRPuteD+YciPomcXdrMnk= github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU= github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA= go.einride.tech/aip v0.67.1/go.mod h1:ZGX4/zKw8dcgzdLsrvpOOGxfxI2QSk12SlP7d6c0/XI= @@ -201,29 +218,39 @@ golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= +golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE= golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8= golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= +golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= +golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= google.golang.org/api v0.183.0/go.mod h1:q43adC5/pHoSZTx5h2mSmdF7NcyfW9JuDyIOJAgS9ZQ= @@ -251,6 +278,7 @@ google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSs google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= google.golang.org/grpc v1.64.0/go.mod h1:oxjF8E3FBnjp+/gVFYdWacaLDx9na1aqy9oovLpxQYg= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.2.0/go.mod h1:DNq5QpG7LJqD2AamLZ7zvKE0DEpVl2BSEVjFycAAjRY= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= @@ -259,10 +287,16 @@ k8s.io/code-generator v0.27.9/go.mod h1:NEx95JBRos8MSki+CuSoiEyKk6yv1rC4z/eY8DCZ k8s.io/component-base v0.23.0/go.mod h1:DHH5uiFvLC1edCpvcTDV++NKULdYYU6pR9Tt3HIKMKI= k8s.io/component-helpers v0.26.3/go.mod h1:feC+CaxJXULs5TSD3lG8K5ecftOkF8eY0pHQgd7koEI= k8s.io/gengo v0.0.0-20220902162205-c0856e24416d/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70/go.mod h1:VH3AT8AaQOqiGjMF9p0/IM1Dj+82ZwjfxUP1IxaHE+8= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= +k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/kms v0.27.9/go.mod h1:Au1ELrxN11Usj5F3Ht6ZLvl8m42gKOzHo2ixJWg2WpA= +k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98= k8s.io/metrics v0.26.3/go.mod h1:NNnWARAAz+ZJTs75Z66fJTV7jHcVb3GtrlDszSIr3fE= +k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.1.2/go.mod h1:+qG7ISXqCDVVcyO8hLn12AKVYYUjM7ftlqsqmrhMZE0= sigs.k8s.io/cli-utils v0.33.0/go.mod h1:g/zB9hJ5eUN7zIEBIxrO0CwhXU4YISJ+BkLJzvWwlEs= sigs.k8s.io/kustomize/kustomize/v4 v4.5.7/go.mod h1:VSNKEH9D9d9bLiWEGbS6Xbg/Ih0tgQalmPvntzRxZ/Q= sigs.k8s.io/structured-merge-diff v0.0.0-20190817042607-6149e4549fca h1:6dsH6AYQWbyZmtttJNe8Gq1cXOeS1BdV3eW37zHilAQ= +sigs.k8s.io/structured-merge-diff/v4 v4.2.3/go.mod h1:qjx8mGObPmV2aSZepjQjbmb2ihdVs8cGKBraizNC69E= diff --git a/mockgcp/Makefile b/mockgcp/Makefile index c646f9c9ee..384c1b206c 100644 --- a/mockgcp/Makefile +++ b/mockgcp/Makefile @@ -123,6 +123,10 @@ generate-protos-from-openapi: mkdir -p apis/mockgcp/cloud/bigquery/v2/ cd tools/gapic; go run . --proto-version=2 --proto-package mockgcp.cloud.bigquery.v2 ../../temp/bigquery-v2.json > ../../apis/mockgcp/cloud/bigquery/v2/api.proto + wget -O temp/networkconnectivity-v1.json https://raw.githubusercontent.com/googleapis/google-api-go-client/main/networkconnectivity/v1/networkconnectivity-api.json + mkdir -p apis/mockgcp/cloud/networkconnectivity/v1/ + cd tools/gapic; go run . --proto-package mockgcp.cloud.networkconnectivity.v1 ../../temp/networkconnectivity-v1.json > ../../apis/mockgcp/cloud/networkconnectivity/v1/networkconnectivity.proto + wget -O temp/servicenetworking-api.json https://raw.githubusercontent.com/googleapis/google-api-go-client/main/servicenetworking/v1/servicenetworking-api.json mkdir -p apis/mockgcp/cloud/servicenetworking/v1/ cd tools/gapic; go run . --proto-package mockgcp.cloud.servicenetworking.v1 ../../temp/servicenetworking-api.json > ../../apis/mockgcp/cloud/servicenetworking/v1/servicenetworking.proto diff --git a/mockgcp/apis/mockgcp/cloud/networkconnectivity/v1/networkconnectivity.proto b/mockgcp/apis/mockgcp/cloud/networkconnectivity/v1/networkconnectivity.proto new file mode 100644 index 0000000000..7d3ea38081 --- /dev/null +++ b/mockgcp/apis/mockgcp/cloud/networkconnectivity/v1/networkconnectivity.proto @@ -0,0 +1,1695 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; +package mockgcp.cloud.networkconnectivity.v1; +import "google/api/annotations.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/timestamp.proto"; +option go_package = "cloud.google.com/go/networkconnectivity/apiv1/networkconnectivitypb;networkconnectivitypb"; + +service ProjectsServer { +} + +service ProjectsLocationsServer { + + // Gets information about a location. + rpc GetProjectsLocation(GetProjectsLocationRequest) returns (Location) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*}" + }; + }; + + // Lists information about the supported locations for this service. + rpc ListProjectsLocations(ListProjectsLocationsRequest) returns (ListLocationsResponse) { + option (google.api.http) = { + get: "/v1/{name=projects/*}/locations" + }; + }; +} + +service ProjectsLocationsGlobalServer { +} + +service ProjectsLocationsGlobalHubsServer { + + // Accepts a proposal to attach a Network Connectivity Center spoke to a hub. + rpc AcceptSpokeProjectsLocationsGlobalHub(AcceptSpokeProjectsLocationsGlobalHubRequest) returns (.google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/global/hubs/*}:acceptSpoke" + body: "projects_locations_global_hub" + }; + }; + + // Creates a new Network Connectivity Center hub in the specified project. + rpc CreateProjectsLocationsGlobalHub(CreateProjectsLocationsGlobalHubRequest) returns (.google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/global}/hubs" + body: "projects_locations_global_hub" + }; + }; + + // Deletes a Network Connectivity Center hub. + rpc DeleteProjectsLocationsGlobalHub(DeleteProjectsLocationsGlobalHubRequest) returns (.google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/global/hubs/*}" + }; + }; + + // Gets details about a Network Connectivity Center hub. + rpc GetProjectsLocationsGlobalHub(GetProjectsLocationsGlobalHubRequest) returns (Hub) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/global/hubs/*}" + }; + }; + + // Lists the Network Connectivity Center hubs associated with a given project. + rpc ListProjectsLocationsGlobalHubs(ListProjectsLocationsGlobalHubsRequest) returns (ListHubsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/global}/hubs" + }; + }; + + // 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 ListSpokesProjectsLocationsGlobalHub(ListSpokesProjectsLocationsGlobalHubRequest) returns (ListHubSpokesResponse) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/global/hubs/*}:listSpokes" + }; + }; + + // Updates the description and/or labels of a Network Connectivity Center hub. + rpc PatchProjectsLocationsGlobalHub(PatchProjectsLocationsGlobalHubRequest) returns (.google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{name=projects/*/locations/global/hubs/*}" + body: "projects_locations_global_hub" + }; + }; + + // 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 RejectSpokeProjectsLocationsGlobalHub(RejectSpokeProjectsLocationsGlobalHubRequest) returns (.google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/global/hubs/*}:rejectSpoke" + body: "projects_locations_global_hub" + }; + }; +} + +service ProjectsLocationsGlobalHubsGroupsServer { + + // Gets details about a Network Connectivity Center group. + rpc GetProjectsLocationsGlobalHubsGroup(GetProjectsLocationsGlobalHubsGroupRequest) returns (Group) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/global/hubs/*/groups/*}" + }; + }; + + // Lists groups in a given hub. + rpc ListProjectsLocationsGlobalHubsGroups(ListProjectsLocationsGlobalHubsGroupsRequest) returns (ListGroupsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/global/hubs/*}/groups" + }; + }; + + // Updates the parameters of a Network Connectivity Center group. + rpc PatchProjectsLocationsGlobalHubsGroup(PatchProjectsLocationsGlobalHubsGroupRequest) returns (.google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{name=projects/*/locations/global/hubs/*/groups/*}" + body: "projects_locations_global_hubs_group" + }; + }; +} + +service ProjectsLocationsGlobalHubsRouteTablesServer { + + // Gets details about a Network Connectivity Center route table. + rpc GetProjectsLocationsGlobalHubsRouteTable(GetProjectsLocationsGlobalHubsRouteTableRequest) returns (RouteTable) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/global/hubs/*/routeTables/*}" + }; + }; + + // Lists route tables in a given hub. + rpc ListProjectsLocationsGlobalHubsRouteTables(ListProjectsLocationsGlobalHubsRouteTablesRequest) returns (ListRouteTablesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/global/hubs/*}/routeTables" + }; + }; +} + +service ProjectsLocationsGlobalHubsRouteTablesRoutesServer { + + // Gets details about the specified route. + rpc GetProjectsLocationsGlobalHubsRouteTablesRoute(GetProjectsLocationsGlobalHubsRouteTablesRouteRequest) returns (Route) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/global/hubs/*/routeTables/*/routes/*}" + }; + }; + + // Lists routes in a given route table. + rpc ListProjectsLocationsGlobalHubsRouteTablesRoutes(ListProjectsLocationsGlobalHubsRouteTablesRoutesRequest) returns (ListRoutesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/global/hubs/*/routeTables/*}/routes" + }; + }; +} + +service ProjectsLocationsGlobalPolicyBasedRoutesServer { + + // Creates a new policy-based route in a given project and location. + rpc CreateProjectsLocationsGlobalPolicyBasedRoute(CreateProjectsLocationsGlobalPolicyBasedRouteRequest) returns (.google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/global}/policyBasedRoutes" + body: "projects_locations_global_policy_based_route" + }; + }; + + // Deletes a single policy-based route. + rpc DeleteProjectsLocationsGlobalPolicyBasedRoute(DeleteProjectsLocationsGlobalPolicyBasedRouteRequest) returns (.google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/global/policyBasedRoutes/*}" + }; + }; + + // Gets details of a single policy-based route. + rpc GetProjectsLocationsGlobalPolicyBasedRoute(GetProjectsLocationsGlobalPolicyBasedRouteRequest) returns (PolicyBasedRoute) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/global/policyBasedRoutes/*}" + }; + }; + + // Lists policy-based routes in a given project and location. + rpc ListProjectsLocationsGlobalPolicyBasedRoutes(ListProjectsLocationsGlobalPolicyBasedRoutesRequest) returns (ListPolicyBasedRoutesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/global}/policyBasedRoutes" + }; + }; +} + +service ProjectsLocationsInternalRangesServer { + + // Creates a new internal range in a given project and location. + rpc CreateProjectsLocationsInternalRange(CreateProjectsLocationsInternalRangeRequest) returns (.google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/internalRanges" + body: "projects_locations_internal_range" + }; + }; + + // Deletes a single internal range. + rpc DeleteProjectsLocationsInternalRange(DeleteProjectsLocationsInternalRangeRequest) returns (.google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/internalRanges/*}" + }; + }; + + // Gets details of a single internal range. + rpc GetProjectsLocationsInternalRange(GetProjectsLocationsInternalRangeRequest) returns (InternalRange) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/internalRanges/*}" + }; + }; + + // Lists internal ranges in a given project and location. + rpc ListProjectsLocationsInternalRanges(ListProjectsLocationsInternalRangesRequest) returns (ListInternalRangesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/internalRanges" + }; + }; + + // Updates the parameters of a single internal range. + rpc PatchProjectsLocationsInternalRange(PatchProjectsLocationsInternalRangeRequest) returns (.google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{name=projects/*/locations/*/internalRanges/*}" + body: "projects_locations_internal_range" + }; + }; +} + +service ProjectsLocationsRegionalEndpointsServer { + + // Creates a new RegionalEndpoint in a given project and location. + rpc CreateProjectsLocationsRegionalEndpoint(CreateProjectsLocationsRegionalEndpointRequest) returns (.google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/regionalEndpoints" + body: "projects_locations_regional_endpoint" + }; + }; + + // Deletes a single RegionalEndpoint. + rpc DeleteProjectsLocationsRegionalEndpoint(DeleteProjectsLocationsRegionalEndpointRequest) returns (.google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/regionalEndpoints/*}" + }; + }; + + // Gets details of a single RegionalEndpoint. + rpc GetProjectsLocationsRegionalEndpoint(GetProjectsLocationsRegionalEndpointRequest) returns (RegionalEndpoint) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/regionalEndpoints/*}" + }; + }; + + // Lists RegionalEndpoints in a given project and location. + rpc ListProjectsLocationsRegionalEndpoints(ListProjectsLocationsRegionalEndpointsRequest) returns (ListRegionalEndpointsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/regionalEndpoints" + }; + }; +} + +service ProjectsLocationsServiceClassesServer { + + // Deletes a single ServiceClass. + rpc DeleteProjectsLocationsServiceClasse(DeleteProjectsLocationsServiceClasseRequest) returns (.google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/serviceClasses/*}" + }; + }; + + // Gets details of a single ServiceClass. + rpc GetProjectsLocationsServiceClasse(GetProjectsLocationsServiceClasseRequest) returns (ServiceClass) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/serviceClasses/*}" + }; + }; + + // Lists ServiceClasses in a given project and location. + rpc ListProjectsLocationsServiceClasses(ListProjectsLocationsServiceClassesRequest) returns (ListServiceClassesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/serviceClasses" + }; + }; + + // Updates the parameters of a single ServiceClass. + rpc PatchProjectsLocationsServiceClasse(PatchProjectsLocationsServiceClasseRequest) returns (.google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{name=projects/*/locations/*/serviceClasses/*}" + body: "projects_locations_service_classe" + }; + }; +} + +service ProjectsLocationsServiceConnectionMapsServer { + + // Creates a new ServiceConnectionMap in a given project and location. + rpc CreateProjectsLocationsServiceConnectionMap(CreateProjectsLocationsServiceConnectionMapRequest) returns (.google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/serviceConnectionMaps" + body: "projects_locations_service_connection_map" + }; + }; + + // Deletes a single ServiceConnectionMap. + rpc DeleteProjectsLocationsServiceConnectionMap(DeleteProjectsLocationsServiceConnectionMapRequest) returns (.google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/serviceConnectionMaps/*}" + }; + }; + + // Gets details of a single ServiceConnectionMap. + rpc GetProjectsLocationsServiceConnectionMap(GetProjectsLocationsServiceConnectionMapRequest) returns (ServiceConnectionMap) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/serviceConnectionMaps/*}" + }; + }; + + // Lists ServiceConnectionMaps in a given project and location. + rpc ListProjectsLocationsServiceConnectionMaps(ListProjectsLocationsServiceConnectionMapsRequest) returns (ListServiceConnectionMapsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/serviceConnectionMaps" + }; + }; + + // Updates the parameters of a single ServiceConnectionMap. + rpc PatchProjectsLocationsServiceConnectionMap(PatchProjectsLocationsServiceConnectionMapRequest) returns (.google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{name=projects/*/locations/*/serviceConnectionMaps/*}" + body: "projects_locations_service_connection_map" + }; + }; +} + +service ProjectsLocationsServiceConnectionPoliciesServer { + + // Creates a new ServiceConnectionPolicy in a given project and location. + rpc CreateProjectsLocationsServiceConnectionPolicy(CreateProjectsLocationsServiceConnectionPolicyRequest) returns (.google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/serviceConnectionPolicies" + body: "projects_locations_service_connection_policy" + }; + }; + + // Deletes a single ServiceConnectionPolicy. + rpc DeleteProjectsLocationsServiceConnectionPolicy(DeleteProjectsLocationsServiceConnectionPolicyRequest) returns (.google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/serviceConnectionPolicies/*}" + }; + }; + + // Gets details of a single ServiceConnectionPolicy. + rpc GetProjectsLocationsServiceConnectionPolicy(GetProjectsLocationsServiceConnectionPolicyRequest) returns (ServiceConnectionPolicy) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/serviceConnectionPolicies/*}" + }; + }; + + // Lists ServiceConnectionPolicies in a given project and location. + rpc ListProjectsLocationsServiceConnectionPolicies(ListProjectsLocationsServiceConnectionPoliciesRequest) returns (ListServiceConnectionPoliciesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/serviceConnectionPolicies" + }; + }; + + // Updates the parameters of a single ServiceConnectionPolicy. + rpc PatchProjectsLocationsServiceConnectionPolicy(PatchProjectsLocationsServiceConnectionPolicyRequest) returns (.google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{name=projects/*/locations/*/serviceConnectionPolicies/*}" + body: "projects_locations_service_connection_policy" + }; + }; +} + +service ProjectsLocationsServiceConnectionTokensServer { + + // Creates a new ServiceConnectionToken in a given project and location. + rpc CreateProjectsLocationsServiceConnectionToken(CreateProjectsLocationsServiceConnectionTokenRequest) returns (.google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/serviceConnectionTokens" + body: "projects_locations_service_connection_token" + }; + }; + + // Deletes a single ServiceConnectionToken. + rpc DeleteProjectsLocationsServiceConnectionToken(DeleteProjectsLocationsServiceConnectionTokenRequest) returns (.google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/serviceConnectionTokens/*}" + }; + }; + + // Gets details of a single ServiceConnectionToken. + rpc GetProjectsLocationsServiceConnectionToken(GetProjectsLocationsServiceConnectionTokenRequest) returns (ServiceConnectionToken) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/serviceConnectionTokens/*}" + }; + }; + + // Lists ServiceConnectionTokens in a given project and location. + rpc ListProjectsLocationsServiceConnectionTokens(ListProjectsLocationsServiceConnectionTokensRequest) returns (ListServiceConnectionTokensResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/serviceConnectionTokens" + }; + }; +} + +service ProjectsLocationsSpokesServer { + + // Creates a Network Connectivity Center spoke. + rpc CreateProjectsLocationsSpoke(CreateProjectsLocationsSpokeRequest) returns (.google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/spokes" + body: "projects_locations_spoke" + }; + }; + + // Deletes a Network Connectivity Center spoke. + rpc DeleteProjectsLocationsSpoke(DeleteProjectsLocationsSpokeRequest) returns (.google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/spokes/*}" + }; + }; + + // Gets details about a Network Connectivity Center spoke. + rpc GetProjectsLocationsSpoke(GetProjectsLocationsSpokeRequest) returns (Spoke) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/spokes/*}" + }; + }; + + // Lists the Network Connectivity Center spokes in a specified project and location. + rpc ListProjectsLocationsSpokes(ListProjectsLocationsSpokesRequest) returns (ListSpokesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/spokes" + }; + }; + + // Updates the parameters of a Network Connectivity Center spoke. + rpc PatchProjectsLocationsSpoke(PatchProjectsLocationsSpokeRequest) returns (.google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{name=projects/*/locations/*/spokes/*}" + body: "projects_locations_spoke" + }; + }; +} + +// The request for HubService.AcceptHubSpoke. +message AcceptHubSpokeRequest { + // 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 = 1 [json_name="requestId"]; + // Required. The URI of the spoke to accept into the hub. + string spoke_uri = 2 [json_name="spokeUri"]; +} + +// The response for HubService.AcceptHubSpoke. +message AcceptHubSpokeResponse { + // The spoke that was operated on. + Spoke spoke = 1 [json_name="spoke"]; +} + +// Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs. If there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditLogConfig are exempted. Example Policy with multiple AuditConfigs: { "audit_configs": [ { "service": "allServices", "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" }, { "log_type": "ADMIN_READ" } ] }, { "service": "sampleservice.googleapis.com", "audit_log_configs": [ { "log_type": "DATA_READ" }, { "log_type": "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] } For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts `jose@example.com` from DATA_READ logging, and `aliya@example.com` from DATA_WRITE logging. +message AuditConfig { + // The configuration for logging of each type of permission. + repeated AuditLogConfig audit_log_configs = 1 [json_name="auditLogConfigs"]; + // Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services. + string service = 2 [json_name="service"]; +} + +// Provides the configuration for logging a type of permissions. Example: { "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE" } ] } This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ logging. +message AuditLogConfig { + // Specifies the identities that do not cause logging for this type of permission. Follows the same format of Binding.members. + repeated string exempted_members = 1 [json_name="exemptedMembers"]; + // The log type that this config enables. + string log_type = 2 [json_name="logType"]; +} + +// The auto-accept setting for a group controls whether proposed spokes are automatically attached to the hub. If auto-accept is enabled, the spoke immediately is attached to the hub and becomes part of the group. In this case, the new spoke is in the ACTIVE state. If auto-accept is disabled, the spoke goes to the INACTIVE state, and it must be reviewed and accepted by a hub administrator. +message AutoAccept { + // A list of project ids or project numbers for which you want to enable auto-accept. The auto-accept setting is applied to spokes being created or updated in these projects. + repeated string auto_accept_projects = 1 [json_name="autoAcceptProjects"]; +} + +// Associates `members`, or principals, with a `role`. +message Binding { + // The condition that is associated with this binding. If the condition evaluates to `true`, then this binding applies to the current request. If the condition evaluates to `false`, then this binding does not apply to the current request. However, a different role binding might grant the same role to one or more of the principals in this binding. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + Expr condition = 1 [json_name="condition"]; + // Specifies the principals requesting access for a Google Cloud resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. Does not include identities that come from external identity providers (IdPs) through identity federation. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` . * `serviceAccount:{emailid}`: An email address that represents a Google service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `serviceAccount:{projectid}.svc.id.goog[{namespace}/{kubernetes-sa}]`: An identifier for a [Kubernetes service account](https://cloud.google.com/kubernetes-engine/docs/how-to/kubernetes-service-accounts). For example, `my-project.svc.id.goog[my-namespace/my-kubernetes-sa]`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`. * `principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`: A single identity in a workforce identity pool. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/group/{group_id}`: All workforce identities in a group. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/attribute.{attribute_name}/{attribute_value}`: All workforce identities with a specific attribute value. * `principalSet://iam.googleapis.com/locations/global/workforcePools/{pool_id}/*`: All identities in a workforce identity pool. * `principal://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/subject/{subject_attribute_value}`: A single identity in a workload identity pool. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/group/{group_id}`: A workload identity pool group. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/attribute.{attribute_name}/{attribute_value}`: All identities in a workload identity pool with a certain attribute. * `principalSet://iam.googleapis.com/projects/{project_number}/locations/global/workloadIdentityPools/{pool_id}/*`: All identities in a workload identity pool. * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding. * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding. * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding. * `deleted:principal://iam.googleapis.com/locations/global/workforcePools/{pool_id}/subject/{subject_attribute_value}`: Deleted single identity in a workforce identity pool. For example, `deleted:principal://iam.googleapis.com/locations/global/workforcePools/my-pool-id/subject/my-subject-attribute-value`. + repeated string members = 2 [json_name="members"]; + // Role that is assigned to the list of `members`, or principals. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. For an overview of the IAM roles and permissions, see the [IAM documentation](https://cloud.google.com/iam/docs/roles-overview). For a list of the available pre-defined roles, see [here](https://cloud.google.com/iam/docs/understanding-roles). + string role = 3 [json_name="role"]; +} + +// Allow the producer to specify which consumers can connect to it. +message ConsumerPscConfig { + // Required. The project ID or project number of the consumer project. This project is the one that the consumer uses to interact with the producer instance. From the perspective of a consumer who's created a producer instance, this is the project of the producer instance. Format: 'projects/' Eg. 'projects/consumer-project' or 'projects/1234' + string consumer_instance_project = 1 [json_name="consumerInstanceProject"]; + // This is used in PSC consumer ForwardingRule to control whether the PSC endpoint can be accessed from another region. + bool disable_global_access = 2 [json_name="disableGlobalAccess"]; + // The resource path of the consumer network where PSC connections are allowed to be created in. Note, this network does not need be in the ConsumerPscConfig.project in the case of SharedVPC. Example: projects/{projectNumOrId}/global/networks/{networkId}. + string network = 3 [json_name="network"]; + // Immutable. An immutable identifier for the producer instance. + string producer_instance_id = 4 [json_name="producerInstanceId"]; + // The consumer project where PSC connections are allowed to be created in. + string project = 5 [json_name="project"]; + // Output only. A map to store mapping between customer vip and target service attachment. Only service attachment with producer specified ip addresses are stored here. + map service_attachment_ip_address_map = 6 [json_name="serviceAttachmentIpAddressMap"]; + // Output only. Overall state of PSC Connections management for this consumer psc config. + string state = 7 [json_name="state"]; +} + +// PSC connection details on consumer side. +message ConsumerPscConnection { + // The most recent error during operating this connection. + GoogleRpcStatus error = 1 [json_name="error"]; + // Output only. The error info for the latest error during operating this connection. + GoogleRpcErrorInfo error_info = 2 [json_name="errorInfo"]; + // The error type indicates whether the error is consumer facing, producer facing or system internal. + string error_type = 3 [json_name="errorType"]; + // The URI of the consumer forwarding rule created. Example: projects/{projectNumOrId}/regions/us-east1/networks/{resourceId}. + string forwarding_rule = 4 [json_name="forwardingRule"]; + // The last Compute Engine operation to setup PSC connection. + string gce_operation = 5 [json_name="gceOperation"]; + // The IP literal allocated on the consumer network for the PSC forwarding rule that is created to connect to the producer service attachment in this service connection map. + string ip = 6 [json_name="ip"]; + // The consumer network whose PSC forwarding rule is connected to the service attachments in this service connection map. Note that the network could be on a different project (shared VPC). + string network = 7 [json_name="network"]; + // Immutable. An immutable identifier for the producer instance. + string producer_instance_id = 8 [json_name="producerInstanceId"]; + // The consumer project whose PSC forwarding rule is connected to the service attachments in this service connection map. + string project = 9 [json_name="project"]; + // The PSC connection id of the PSC forwarding rule connected to the service attachments in this service connection map. + string psc_connection_id = 10 [json_name="pscConnectionId"]; + // Output only. The URI of the selected subnetwork selected to allocate IP address for this connection. + string selected_subnetwork = 11 [json_name="selectedSubnetwork"]; + // The URI of a service attachment which is the target of the PSC connection. + string service_attachment_uri = 12 [json_name="serviceAttachmentUri"]; + // The state of the PSC connection. + string state = 13 [json_name="state"]; +} + +// A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } +message Empty { +} + +// Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. Example (Comparison): title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() < 100" Example (Equality): title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email" Example (Logic): title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' && document.type != 'internal'" Example (Data Manipulation): title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)" The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information. +message Expr { + // Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI. + string description = 1 [json_name="description"]; + // Textual representation of an expression in Common Expression Language syntax. + string expression = 2 [json_name="expression"]; + // Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file. + string location = 3 [json_name="location"]; + // Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression. + string title = 4 [json_name="title"]; +} + +// Filter matches L4 traffic. +message Filter { + // Optional. The destination IP range of outgoing packets that this policy-based route applies to. Default is "0.0.0.0/0" if protocol version is IPv4. + string dest_range = 1 [json_name="destRange"]; + // Optional. The IP protocol that this policy-based route applies to. Valid values are 'TCP', 'UDP', and 'ALL'. Default is 'ALL'. + string ip_protocol = 2 [json_name="ipProtocol"]; + // Required. Internet protocol versions this policy-based route applies to. For this version, only IPV4 is supported. IPV6 is supported in preview. + string protocol_version = 3 [json_name="protocolVersion"]; + // Optional. The source IP range of outgoing packets that this policy-based route applies to. Default is "0.0.0.0/0" if protocol version is IPv4. + string src_range = 4 [json_name="srcRange"]; +} + +// The request message for Operations.CancelOperation. +message GoogleLongrunningCancelOperationRequest { +} + +// The response message for Operations.ListOperations. +message GoogleLongrunningListOperationsResponse { + // The standard List next-page token. + string next_page_token = 1 [json_name="nextPageToken"]; + // A list of operations that matches the specified filter in the request. + repeated .google.longrunning.Operation operations = 2 [json_name="operations"]; +} + +// Describes the cause of the error with structured details. Example of an error when contacting the "pubsub.googleapis.com" API when it is not enabled: { "reason": "API_DISABLED" "domain": "googleapis.com" "metadata": { "resource": "projects/123", "service": "pubsub.googleapis.com" } } This response indicates that the pubsub.googleapis.com API is not enabled. Example of an error that is returned when attempting to create a Spanner instance in a region that is out of stock: { "reason": "STOCKOUT" "domain": "spanner.googleapis.com", "metadata": { "availableRegions": "us-central1,us-east2" } } +message GoogleRpcErrorInfo { + // The logical grouping to which the "reason" belongs. The error domain is typically the registered service name of the tool or product that generates the error. Example: "pubsub.googleapis.com". If the error is generated by some common infrastructure, the error domain must be a globally unique value that identifies the infrastructure. For Google API infrastructure, the error domain is "googleapis.com". + string domain = 1 [json_name="domain"]; + // Additional structured details about this error. Keys must match /a-z+/ but should ideally be lowerCamelCase. Also they must be limited to 64 characters in length. When identifying the current value of an exceeded limit, the units should be contained in the key, not the value. For example, rather than {"instanceLimit": "100/request"}, should be returned as, {"instanceLimitPerRequest": "100"}, if the client exceeds the number of instances that can be created in a single (batch) request. + map metadata = 2 [json_name="metadata"]; + // The reason of the error. This is a constant value that identifies the proximate cause of the error. Error reasons are unique within a particular domain of errors. This should be at most 63 characters and match a regular expression of `A-Z+[A-Z0-9]`, which represents UPPER_SNAKE_CASE. + string reason = 3 [json_name="reason"]; +} + +// The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). +message GoogleRpcStatus { + // The status code, which should be an enum value of google.rpc.Code. + int32 code = 1 [json_name="code"]; + // A list of messages that carry the error details. There is a common set of message types for APIs to use. + repeated .google.protobuf.Any details = 2 [json_name="details"]; + // A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client. + string message = 3 [json_name="message"]; +} + +// A group represents a subset of spokes attached to a hub. +message Group { + // Optional. The auto-accept setting for this group. + AutoAccept auto_accept = 1 [json_name="autoAccept"]; + // Output only. The time the group was created. + .google.protobuf.Timestamp create_time = 2 [json_name="createTime"]; + // Optional. The description of the group. + string description = 3 [json_name="description"]; + // 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 [json_name="labels"]; + // 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 = 5 [json_name="name"]; + // Output only. The name of the route table that corresponds to this group. They use the following form: `projects/{project_number}/locations/global/hubs/{hub_id}/routeTables/{route_table_id}` + string route_table = 6 [json_name="routeTable"]; + // Output only. The current lifecycle state of this group. + string state = 7 [json_name="state"]; + // 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 = 8 [json_name="uid"]; + // Output only. The time the group was last updated. + .google.protobuf.Timestamp update_time = 9 [json_name="updateTime"]; +} + +// 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 { + // Output only. The time the hub was created. + .google.protobuf.Timestamp create_time = 1 [json_name="createTime"]; + // An optional description of the hub. + string description = 2 [json_name="description"]; + // Optional. Whether Private Service Connect transitivity is enabled for the hub. If true, Private Service Connect endpoints in VPC spokes attached to the hub are made accessible to other VPC spokes attached to the hub. The default value is false. + bool export_psc = 3 [json_name="exportPsc"]; + // 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 [json_name="labels"]; + // Immutable. The name of the hub. Hub names must be unique. They use the following form: `projects/{project_number}/locations/global/hubs/{hub_id}` + string name = 5 [json_name="name"]; + // Optional. The policy mode of this hub. This field can be either PRESET or CUSTOM. If unspecified, the policy_mode defaults to PRESET. + string policy_mode = 6 [json_name="policyMode"]; + // Optional. The topology implemented in this hub. Currently, this field is only used when policy_mode = PRESET. The available preset topologies are MESH and STAR. If preset_topology is unspecified and policy_mode = PRESET, the preset_topology defaults to MESH. When policy_mode = CUSTOM, the preset_topology is set to PRESET_TOPOLOGY_UNSPECIFIED. + string preset_topology = 7 [json_name="presetTopology"]; + // 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 = 8 [json_name="routeTables"]; + // The VPC networks associated with this hub's spokes. This field is read-only. Network Connectivity Center automatically populates it based on the set of spokes attached to the hub. + repeated RoutingVPC routing_vpcs = 9 [json_name="routingVpcs"]; + // 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 = 10 [json_name="spokeSummary"]; + // Output only. The current lifecycle state of this hub. + string state = 11 [json_name="state"]; + // Output only. The Google-generated UUID for the hub. This value is unique across all hub resources. If a hub is deleted and another with the same name is created, the new hub is assigned a different unique_id. + string unique_id = 12 [json_name="uniqueId"]; + // Output only. The time the hub was last updated. + .google.protobuf.Timestamp update_time = 13 [json_name="updateTime"]; +} + +// InterconnectAttachment that this route applies to. +message InterconnectAttachment { + // Optional. Cloud region to install this policy-based route on interconnect attachment. Use `all` to install it on all interconnect attachments. + string region = 1 [json_name="region"]; +} + +// The internal range resource for IPAM operations within a VPC network. Used to represent a private address range along with behavioral characterstics of that range (its usage and peering behavior). Networking resources can link to this range if they are created as belonging to it. +message InternalRange { + // Time when the internal range was created. + .google.protobuf.Timestamp create_time = 1 [json_name="createTime"]; + // A description of this resource. + string description = 2 [json_name="description"]; + // The IP range that this internal range defines. + string ip_cidr_range = 3 [json_name="ipCidrRange"]; + // User-defined labels. + map labels = 4 [json_name="labels"]; + // Immutable. The name of an internal range. Format: projects/{project}/locations/{location}/internalRanges/{internal_range} See: https://google.aip.dev/122#fields-representing-resource-names + string name = 5 [json_name="name"]; + // The URL or resource ID of the network in which to reserve the internal range. The network cannot be deleted if there are any reserved internal ranges referring to it. Legacy networks are not supported. For example: https://www.googleapis.com/compute/v1/projects/{project}/locations/global/networks/{network} projects/{project}/locations/global/networks/{network} {network} + string network = 6 [json_name="network"]; + // Optional. Types of resources that are allowed to overlap with the current internal range. + repeated string overlaps = 7 [json_name="overlaps"]; + // The type of peering set for this internal range. + string peering = 8 [json_name="peering"]; + // An alternate to ip_cidr_range. Can be set when trying to create a reservation that automatically finds a free range of the given size. If both ip_cidr_range and prefix_length are set, there is an error if the range sizes do not match. Can also be used during updates to change the range size. + int32 prefix_length = 9 [json_name="prefixLength"]; + // Optional. Can be set to narrow down or pick a different address space while searching for a free range. If not set, defaults to the "10.0.0.0/8" address space. This can be used to search in other rfc-1918 address spaces like "172.16.0.0/12" and "192.168.0.0/16" or non-rfc-1918 address spaces used in the VPC. + repeated string target_cidr_range = 10 [json_name="targetCidrRange"]; + // Time when the internal range was updated. + .google.protobuf.Timestamp update_time = 11 [json_name="updateTime"]; + // The type of usage set for this InternalRange. + string usage = 12 [json_name="usage"]; + // Output only. The list of resources that refer to this internal range. Resources that use the internal range for their range allocation are referred to as users of the range. Other resources mark themselves as users while doing so by creating a reference to this internal range. Having a user, based on this reference, prevents deletion of the internal range referred to. Can be empty. + repeated string users = 13 [json_name="users"]; +} + +// A collection of VLAN attachment resources. These resources should be redundant attachments that all advertise the same prefixes to Google Cloud. Alternatively, in active/passive configurations, all attachments should be capable of advertising the same prefixes. +message LinkedInterconnectAttachments { + // Optional. IP ranges allowed to be included during import from hub.(does not control transit connectivity) The only allowed value for now is "ALL_IPV4_RANGES". + repeated string include_import_ranges = 1 [json_name="includeImportRanges"]; + // A value that controls whether site-to-site data transfer is enabled for these resources. Data transfer is available only in [supported locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations). + bool site_to_site_data_transfer = 2 [json_name="siteToSiteDataTransfer"]; + // The URIs of linked interconnect attachment resources + repeated string uris = 3 [json_name="uris"]; + // Output only. The VPC network where these VLAN attachments are located. + string vpc_network = 4 [json_name="vpcNetwork"]; +} + +// A collection of router appliance instances. If you configure multiple router appliance instances to receive data from the same set of sites outside of Google Cloud, we recommend that you associate those instances with the same spoke. +message LinkedRouterApplianceInstances { + // Optional. IP ranges allowed to be included during import from hub.(does not control transit connectivity) The only allowed value for now is "ALL_IPV4_RANGES". + repeated string include_import_ranges = 1 [json_name="includeImportRanges"]; + // The list of router appliance instances. + repeated RouterApplianceInstance instances = 2 [json_name="instances"]; + // A value that controls whether site-to-site data transfer is enabled for these resources. Data transfer is available only in [supported locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations). + bool site_to_site_data_transfer = 3 [json_name="siteToSiteDataTransfer"]; + // Output only. The VPC network where these router appliance instances are located. + string vpc_network = 4 [json_name="vpcNetwork"]; +} + +// An existing VPC network. +message LinkedVpcNetwork { + // Optional. IP ranges encompassing the subnets to be excluded from peering. + repeated string exclude_export_ranges = 1 [json_name="excludeExportRanges"]; + // Optional. IP ranges allowed to be included from peering. + repeated string include_export_ranges = 2 [json_name="includeExportRanges"]; + // Required. The URI of the VPC network resource. + string uri = 3 [json_name="uri"]; +} + +// 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 should be capable of advertising the same prefixes. +message LinkedVpnTunnels { + // Optional. IP ranges allowed to be included during import from hub.(does not control transit connectivity) The only allowed value for now is "ALL_IPV4_RANGES". + repeated string include_import_ranges = 1 [json_name="includeImportRanges"]; + // A value that controls whether site-to-site data transfer is enabled for these resources. Data transfer is available only in [supported locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations). + bool site_to_site_data_transfer = 2 [json_name="siteToSiteDataTransfer"]; + // The URIs of linked VPN tunnel resources. + repeated string uris = 3 [json_name="uris"]; + // Output only. The VPC network where these VPN tunnels are located. + string vpc_network = 4 [json_name="vpcNetwork"]; +} + +// Response for HubService.ListGroups method. +message ListGroupsResponse { + // The requested groups. + repeated Group groups = 1 [json_name="groups"]; + // 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 [json_name="nextPageToken"]; + // Hubs that could not be reached. + repeated string unreachable = 3 [json_name="unreachable"]; +} + +// The response for HubService.ListHubSpokes. +message ListHubSpokesResponse { + // 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 = 1 [json_name="nextPageToken"]; + // The requested spokes. The spoke fields can be partially populated based on the `view` field in the request message. + repeated Spoke spokes = 2 [json_name="spokes"]; + // Locations that could not be reached. + repeated string unreachable = 3 [json_name="unreachable"]; +} + +// Response for HubService.ListHubs method. +message ListHubsResponse { + // The requested hubs. + repeated Hub hubs = 1 [json_name="hubs"]; + // 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 [json_name="nextPageToken"]; + // Locations that could not be reached. + repeated string unreachable = 3 [json_name="unreachable"]; +} + +// Response for InternalRange.ListInternalRanges +message ListInternalRangesResponse { + // Internal ranges to be returned. + repeated InternalRange internal_ranges = 1 [json_name="internalRanges"]; + // 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. + string next_page_token = 2 [json_name="nextPageToken"]; + // Locations that could not be reached. + repeated string unreachable = 3 [json_name="unreachable"]; +} + +// The response message for Locations.ListLocations. +message ListLocationsResponse { + // A list of locations that matches the specified filter in the request. + repeated Location locations = 1 [json_name="locations"]; + // The standard List next-page token. + string next_page_token = 2 [json_name="nextPageToken"]; +} + +// Response for PolicyBasedRouting.ListPolicyBasedRoutes method. +message ListPolicyBasedRoutesResponse { + // 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. + string next_page_token = 1 [json_name="nextPageToken"]; + // Policy-based routes to be returned. + repeated PolicyBasedRoute policy_based_routes = 2 [json_name="policyBasedRoutes"]; + // Locations that could not be reached. + repeated string unreachable = 3 [json_name="unreachable"]; +} + +// Response for ListRegionalEndpoints. +message ListRegionalEndpointsResponse { + // 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. + string next_page_token = 1 [json_name="nextPageToken"]; + // Regional endpoints to be returned. + repeated RegionalEndpoint regional_endpoints = 2 [json_name="regionalEndpoints"]; + // Locations that could not be reached. + repeated string unreachable = 3 [json_name="unreachable"]; +} + +// Response for HubService.ListRouteTables method. +message ListRouteTablesResponse { + // 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 = 1 [json_name="nextPageToken"]; + // The requested route tables. + repeated RouteTable route_tables = 2 [json_name="routeTables"]; + // Hubs that could not be reached. + repeated string unreachable = 3 [json_name="unreachable"]; +} + +// Response for HubService.ListRoutes method. +message ListRoutesResponse { + // 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 = 1 [json_name="nextPageToken"]; + // The requested routes. + repeated Route routes = 2 [json_name="routes"]; + // RouteTables that could not be reached. + repeated string unreachable = 3 [json_name="unreachable"]; +} + +// Response for ListServiceClasses. +message ListServiceClassesResponse { + // 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. + string next_page_token = 1 [json_name="nextPageToken"]; + // ServiceClasses to be returned. + repeated ServiceClass service_classes = 2 [json_name="serviceClasses"]; + // Locations that could not be reached. + repeated string unreachable = 3 [json_name="unreachable"]; +} + +// Response for ListServiceConnectionMaps. +message ListServiceConnectionMapsResponse { + // 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. + string next_page_token = 1 [json_name="nextPageToken"]; + // ServiceConnectionMaps to be returned. + repeated ServiceConnectionMap service_connection_maps = 2 [json_name="serviceConnectionMaps"]; + // Locations that could not be reached. + repeated string unreachable = 3 [json_name="unreachable"]; +} + +// Response for ListServiceConnectionPolicies. +message ListServiceConnectionPoliciesResponse { + // 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. + string next_page_token = 1 [json_name="nextPageToken"]; + // ServiceConnectionPolicies to be returned. + repeated ServiceConnectionPolicy service_connection_policies = 2 [json_name="serviceConnectionPolicies"]; + // Locations that could not be reached. + repeated string unreachable = 3 [json_name="unreachable"]; +} + +// Response for ListServiceConnectionTokens. +message ListServiceConnectionTokensResponse { + // 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. + string next_page_token = 1 [json_name="nextPageToken"]; + // ServiceConnectionTokens to be returned. + repeated ServiceConnectionToken service_connection_tokens = 2 [json_name="serviceConnectionTokens"]; + // Locations that could not be reached. + repeated string unreachable = 3 [json_name="unreachable"]; +} + +// The response for HubService.ListSpokes. +message ListSpokesResponse { + // 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 = 1 [json_name="nextPageToken"]; + // The requested spokes. + repeated Spoke spokes = 2 [json_name="spokes"]; + // Locations that could not be reached. + repeated string unreachable = 3 [json_name="unreachable"]; +} + +// A resource that represents a Google Cloud location. +message Location { + // The friendly name for this location, typically a nearby city name. For example, "Tokyo". + string display_name = 1 [json_name="displayName"]; + // Cross-service attributes for the location. For example {"cloud.googleapis.com/region": "us-east1"} + map labels = 2 [json_name="labels"]; + // The canonical id for this location. For example: `"us-east1"`. + string location_id = 3 [json_name="locationId"]; + // Service-specific metadata. For example the available capacity at the given location. + map metadata = 4 [json_name="metadata"]; + // Resource name for the location, which may vary between implementations. For example: `"projects/example-project/locations/us-east1"` + string name = 5 [json_name="name"]; +} + +// Metadata about locations +message LocationMetadata { + // List of supported features + repeated string location_features = 1 [json_name="locationFeatures"]; +} + +// A route next hop that leads to an interconnect attachment resource. +message NextHopInterconnectAttachment { + // Indicates whether site-to-site data transfer is allowed for this interconnect attachment resource. Data transfer is available only in [supported locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations). + bool site_to_site_data_transfer = 1 [json_name="siteToSiteDataTransfer"]; + // The URI of the interconnect attachment resource. + string uri = 2 [json_name="uri"]; + // The VPC network where this interconnect attachment is located. + string vpc_network = 3 [json_name="vpcNetwork"]; +} + +// A route next hop that leads to a Router appliance instance. +message NextHopRouterApplianceInstance { + // Indicates whether site-to-site data transfer is allowed for this Router appliance instance resource. Data transfer is available only in [supported locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations). + bool site_to_site_data_transfer = 1 [json_name="siteToSiteDataTransfer"]; + // The URI of the Router appliance instance. + string uri = 2 [json_name="uri"]; + // The VPC network where this VM is located. + string vpc_network = 3 [json_name="vpcNetwork"]; +} + +// A route next hop that leads to a VPN tunnel resource. +message NextHopVPNTunnel { + // Indicates whether site-to-site data transfer is allowed for this VPN tunnel resource. Data transfer is available only in [supported locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations). + bool site_to_site_data_transfer = 1 [json_name="siteToSiteDataTransfer"]; + // The URI of the VPN tunnel resource. + string uri = 2 [json_name="uri"]; + // The VPC network where this VPN tunnel is located. + string vpc_network = 3 [json_name="vpcNetwork"]; +} + +message NextHopVpcNetwork { + // The URI of the VPC network resource + string uri = 1 [json_name="uri"]; +} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. API version used to start the operation. + string api_version = 1 [json_name="apiVersion"]; + // Output only. The time the operation was created. + .google.protobuf.Timestamp create_time = 2 [json_name="createTime"]; + // Output only. The time the operation finished running. + .google.protobuf.Timestamp end_time = 3 [json_name="endTime"]; + // 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 of 1, corresponding to `Code.CANCELLED`. + bool requested_cancellation = 4 [json_name="requestedCancellation"]; + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [json_name="statusMessage"]; + // Output only. Server-defined resource path for the target of the operation. + string target = 6 [json_name="target"]; + // Output only. Name of the verb executed by the operation. + string verb = 7 [json_name="verb"]; +} + +// An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. A `Policy` is a collection of `bindings`. A `binding` binds one or more `members`, or principals, to a single `role`. Principals can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role. For some types of Google Cloud resources, a `binding` can also specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** ``` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 } ``` **YAML example:** ``` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3 ``` For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/). +message Policy { + // Specifies cloud audit logging configuration for this policy. + repeated AuditConfig audit_configs = 1 [json_name="auditConfigs"]; + // Associates a list of `members`, or principals, with a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one principal. The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 of these principals can be Google groups. Each occurrence of a principal counts towards these limits. For example, if the `bindings` grant 50 different roles to `user:alice@example.com`, and not to any other principal, then you can add another 1,450 principals to the `bindings` in the `Policy`. + repeated Binding bindings = 2 [json_name="bindings"]; + // `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy. **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. + bytes etag = 3 [json_name="etag"]; + // Specifies the format of the policy. Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected. Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations: * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost. If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset. To learn which resources support conditions in their IAM policies, see the [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + int32 version = 4 [json_name="version"]; +} + +// Policy-based routes route L4 network traffic based on not just destination IP address, but also source IP address, protocol, and more. If a policy-based route conflicts with other types of routes, the policy-based route always takes precedence. +message PolicyBasedRoute { + // Output only. Time when the policy-based route was created. + .google.protobuf.Timestamp create_time = 1 [json_name="createTime"]; + // Optional. An optional description of this resource. Provide this field when you create the resource. + string description = 2 [json_name="description"]; + // Required. The filter to match L4 traffic. + Filter filter = 3 [json_name="filter"]; + // Optional. The interconnect attachments that this policy-based route applies to. + InterconnectAttachment interconnect_attachment = 4 [json_name="interconnectAttachment"]; + // Output only. Type of this resource. Always networkconnectivity#policyBasedRoute for policy-based Route resources. + string kind = 5 [json_name="kind"]; + // User-defined labels. + map labels = 6 [json_name="labels"]; + // Immutable. A unique name of the resource in the form of `projects/{project_number}/locations/global/PolicyBasedRoutes/{policy_based_route_id}` + string name = 7 [json_name="name"]; + // Required. Fully-qualified URL of the network that this route applies to, for example: projects/my-project/global/networks/my-network. + string network = 8 [json_name="network"]; + // Optional. The IP address of a global-access-enabled L4 ILB that is the next hop for matching packets. For this version, only nextHopIlbIp is supported. + string next_hop_ilb_ip = 9 [json_name="nextHopIlbIp"]; + // Optional. Other routes that will be referenced to determine the next hop of the packet. + string next_hop_other_routes = 10 [json_name="nextHopOtherRoutes"]; + // Optional. The priority of this policy-based route. Priority is used to break ties in cases where there are more than one matching policy-based routes found. In cases where multiple policy-based routes are matched, the one with the lowest-numbered priority value wins. The default value is 1000. The priority value must be from 1 to 65535, inclusive. + int32 priority = 11 [json_name="priority"]; + // Output only. Server-defined fully-qualified URL for this resource. + string self_link = 12 [json_name="selfLink"]; + // Output only. Time when the policy-based route was updated. + .google.protobuf.Timestamp update_time = 13 [json_name="updateTime"]; + // Optional. VM instances that this policy-based route applies to. + VirtualMachine virtual_machine = 14 [json_name="virtualMachine"]; + // Output only. If potential misconfigurations are detected for this route, this field will be populated with warning messages. + repeated Warnings warnings = 15 [json_name="warnings"]; +} + +// The PSC configurations on producer side. +message ProducerPscConfig { + // The resource path of a service attachment. Example: projects/{projectNumOrId}/regions/{region}/serviceAttachments/{resourceId}. + string service_attachment_uri = 1 [json_name="serviceAttachmentUri"]; +} + +// Configuration used for Private Service Connect connections. Used when Infrastructure is PSC. +message PscConfig { + // Optional. List of Projects, Folders, or Organizations from where the Producer instance can be within. For example, a network administrator can provide both 'organizations/foo' and 'projects/bar' as allowed_google_producers_resource_hierarchy_levels. This allowlists this network to connect with any Producer instance within the 'foo' organization or the 'bar' project. By default, allowed_google_producers_resource_hierarchy_level is empty. The format for each allowed_google_producers_resource_hierarchy_level is / where is one of 'projects', 'folders', or 'organizations' and is either the ID or the number of the resource type. Format for each allowed_google_producers_resource_hierarchy_level value: 'projects/' or 'folders/' or 'organizations/' Eg. [projects/my-project-id, projects/567, folders/891, organizations/123] + repeated string allowed_google_producers_resource_hierarchy_level = 1 [json_name="allowedGoogleProducersResourceHierarchyLevel"]; + // Optional. Max number of PSC connections for this policy. + int64 limit = 2 [json_name="limit"]; + // Required. ProducerInstanceLocation is used to specify which authorization mechanism to use to determine which projects the Producer instance can be within. + string producer_instance_location = 3 [json_name="producerInstanceLocation"]; + // The resource paths of subnetworks to use for IP address management. Example: projects/{projectNumOrId}/regions/{region}/subnetworks/{resourceId}. + repeated string subnetworks = 4 [json_name="subnetworks"]; +} + +// Information about a specific Private Service Connect connection. +message PscConnection { + // The resource reference of the consumer address. + string consumer_address = 1 [json_name="consumerAddress"]; + // The resource reference of the PSC Forwarding Rule within the consumer VPC. + string consumer_forwarding_rule = 2 [json_name="consumerForwardingRule"]; + // The project where the PSC connection is created. + string consumer_target_project = 3 [json_name="consumerTargetProject"]; + // The most recent error during operating this connection. + GoogleRpcStatus error = 4 [json_name="error"]; + // Output only. The error info for the latest error during operating this connection. + GoogleRpcErrorInfo error_info = 5 [json_name="errorInfo"]; + // The error type indicates whether the error is consumer facing, producer facing or system internal. + string error_type = 6 [json_name="errorType"]; + // The last Compute Engine operation to setup PSC connection. + string gce_operation = 7 [json_name="gceOperation"]; + // Immutable. An immutable identifier for the producer instance. + string producer_instance_id = 8 [json_name="producerInstanceId"]; + // The PSC connection id of the PSC forwarding rule. + string psc_connection_id = 9 [json_name="pscConnectionId"]; + // Output only. The URI of the subnetwork selected to allocate IP address for this connection. + string selected_subnetwork = 10 [json_name="selectedSubnetwork"]; + // State of the PSC Connection + string state = 11 [json_name="state"]; +} + +// The RegionalEndpoint resource. +message RegionalEndpoint { + // Required. The access type of this regional endpoint. This field is reflected in the PSC Forwarding Rule configuration to enable global access. + string access_type = 1 [json_name="accessType"]; + // Optional. The IP Address of the Regional Endpoint. When no address is provided, an IP from the subnetwork is allocated. Use one of the following formats: * IPv4 address as in `10.0.0.1` * Address resource URI as in `projects/{project}/regions/{region}/addresses/{address_name}` + string address = 2 [json_name="address"]; + // Output only. Time when the RegionalEndpoint was created. + .google.protobuf.Timestamp create_time = 3 [json_name="createTime"]; + // Optional. A description of this resource. + string description = 4 [json_name="description"]; + // Output only. The literal IP address of the PSC Forwarding Rule created on behalf of the customer. This field is deprecated. Use address instead. + string ip_address = 5 [json_name="ipAddress"]; + // User-defined labels. + map labels = 6 [json_name="labels"]; + // Output only. The name of a RegionalEndpoint. Format: `projects/{project}/locations/{location}/regionalEndpoints/{regional_endpoint}`. + string name = 7 [json_name="name"]; + // The name of the VPC network for this private regional endpoint. Format: `projects/{project}/global/networks/{network}` + string network = 8 [json_name="network"]; + // Output only. The resource reference of the PSC Forwarding Rule created on behalf of the customer. Format: `//compute.googleapis.com/projects/{project}/regions/{region}/forwardingRules/{forwarding_rule_name}` + string psc_forwarding_rule = 9 [json_name="pscForwardingRule"]; + // The name of the subnetwork from which the IP address will be allocated. Format: `projects/{project}/regions/{region}/subnetworks/{subnetwork}` + string subnetwork = 10 [json_name="subnetwork"]; + // Required. The service endpoint this private regional endpoint connects to. Format: `{apiname}.{region}.p.rep.googleapis.com` Example: "cloudkms.us-central1.p.rep.googleapis.com". + string target_google_api = 11 [json_name="targetGoogleApi"]; + // Output only. Time when the RegionalEndpoint was updated. + .google.protobuf.Timestamp update_time = 12 [json_name="updateTime"]; +} + +// The request for HubService.RejectHubSpoke. +message RejectHubSpokeRequest { + // Optional. Additional information provided by the hub administrator. + string details = 1 [json_name="details"]; + // 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 = 2 [json_name="requestId"]; + // Required. The URI of the spoke to reject from the hub. + string spoke_uri = 3 [json_name="spokeUri"]; +} + +// The response for HubService.RejectHubSpoke. +message RejectHubSpokeResponse { + // The spoke that was operated on. + Spoke spoke = 1 [json_name="spoke"]; +} + +// A route defines a path from VM instances within a spoke to a specific destination resource. Only VPC spokes have routes. +message Route { + // Output only. The time the route was created. + .google.protobuf.Timestamp create_time = 1 [json_name="createTime"]; + // An optional description of the route. + string description = 2 [json_name="description"]; + // The destination IP address range. + string ip_cidr_range = 3 [json_name="ipCidrRange"]; + // 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 [json_name="labels"]; + // Output only. The origin location of the route. Uses the following form: "projects/{project}/locations/{location}" Example: projects/1234/locations/us-central1 + string location = 5 [json_name="location"]; + // 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 = 6 [json_name="name"]; + // Immutable. The next-hop VLAN attachment for packets on this route. + NextHopInterconnectAttachment next_hop_interconnect_attachment = 7 [json_name="nextHopInterconnectAttachment"]; + // Immutable. The next-hop Router appliance instance for packets on this route. + NextHopRouterApplianceInstance next_hop_router_appliance_instance = 8 [json_name="nextHopRouterApplianceInstance"]; + // Immutable. The destination VPC network for packets on this route. + NextHopVpcNetwork next_hop_vpc_network = 9 [json_name="nextHopVpcNetwork"]; + // Immutable. The next-hop VPN tunnel for packets on this route. + NextHopVPNTunnel next_hop_vpn_tunnel = 10 [json_name="nextHopVpnTunnel"]; + // Output only. The priority of this route. Priority is used to break ties in cases where a destination matches more than one route. In these cases the route with the lowest-numbered priority value wins. + int64 priority = 11 [json_name="priority"]; + // Immutable. The spoke that this route leads to. Example: projects/12345/locations/global/spokes/SPOKE + string spoke = 12 [json_name="spoke"]; + // Output only. The current lifecycle state of the route. + string state = 13 [json_name="state"]; + // Output only. The route's type. Its type is determined by the properties of its IP address range. + string type = 14 [json_name="type"]; + // 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 = 15 [json_name="uid"]; + // Output only. The time the route was last updated. + .google.protobuf.Timestamp update_time = 16 [json_name="updateTime"]; +} + +message RouteTable { + // Output only. The time the route table was created. + .google.protobuf.Timestamp create_time = 1 [json_name="createTime"]; + // An optional description of the route table. + string description = 2 [json_name="description"]; + // 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 = 3 [json_name="labels"]; + // 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 = 4 [json_name="name"]; + // Output only. The current lifecycle state of this route table. + string state = 5 [json_name="state"]; + // 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 [json_name="uid"]; + // Output only. The time the route table was last updated. + .google.protobuf.Timestamp update_time = 7 [json_name="updateTime"]; +} + +// 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 interfaces. +message RouterApplianceInstance { + // The IP address on the VM to use for peering. + string ip_address = 1 [json_name="ipAddress"]; + // The URI of the VM. + string virtual_machine = 2 [json_name="virtualMachine"]; +} + +// RoutingVPC contains information about the VPC networks associated with the spokes of a Network Connectivity Center hub. +message RoutingVPC { + // Output only. If true, indicates that this VPC network is currently associated with spokes that use the data transfer feature (spokes where the site_to_site_data_transfer field is set to true). If you create new spokes that use data transfer, they must be associated with this VPC network. At most, one VPC network will have this field set to true. + bool required_for_new_site_to_site_data_transfer_spokes = 1 [json_name="requiredForNewSiteToSiteDataTransferSpokes"]; + // The URI of the VPC network. + string uri = 2 [json_name="uri"]; +} + +// The ServiceClass resource. Next id: 9 +message ServiceClass { + // Output only. Time when the ServiceClass was created. + .google.protobuf.Timestamp create_time = 1 [json_name="createTime"]; + // A description of this resource. + string description = 2 [json_name="description"]; + // Optional. The etag is computed by the server, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding. + string etag = 3 [json_name="etag"]; + // User-defined labels. + map labels = 4 [json_name="labels"]; + // Immutable. The name of a ServiceClass resource. Format: projects/{project}/locations/{location}/serviceClasses/{service_class} See: https://google.aip.dev/122#fields-representing-resource-names + string name = 5 [json_name="name"]; + // Output only. The generated service class name. Use this name to refer to the Service class in Service Connection Maps and Service Connection Policies. + string service_class = 6 [json_name="serviceClass"]; + // Output only. Time when the ServiceClass was updated. + .google.protobuf.Timestamp update_time = 7 [json_name="updateTime"]; +} + +// The ServiceConnectionMap resource. Next id: 15 +message ServiceConnectionMap { + // The PSC configurations on consumer side. + repeated ConsumerPscConfig consumer_psc_configs = 1 [json_name="consumerPscConfigs"]; + // Output only. PSC connection details on consumer side. + repeated ConsumerPscConnection consumer_psc_connections = 2 [json_name="consumerPscConnections"]; + // Output only. Time when the ServiceConnectionMap was created. + .google.protobuf.Timestamp create_time = 3 [json_name="createTime"]; + // A description of this resource. + string description = 4 [json_name="description"]; + // Optional. The etag is computed by the server, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding. + string etag = 5 [json_name="etag"]; + // Output only. The infrastructure used for connections between consumers/producers. + string infrastructure = 6 [json_name="infrastructure"]; + // User-defined labels. + map labels = 7 [json_name="labels"]; + // Immutable. The name of a ServiceConnectionMap. Format: projects/{project}/locations/{location}/serviceConnectionMaps/{service_connection_map} See: https://google.aip.dev/122#fields-representing-resource-names + string name = 8 [json_name="name"]; + // The PSC configurations on producer side. + repeated ProducerPscConfig producer_psc_configs = 9 [json_name="producerPscConfigs"]; + // The service class identifier this ServiceConnectionMap is for. The user of ServiceConnectionMap create API needs to have networkconnecitivty.serviceclasses.use iam permission for the service class. + string service_class = 10 [json_name="serviceClass"]; + // Output only. The service class uri this ServiceConnectionMap is for. + string service_class_uri = 11 [json_name="serviceClassUri"]; + // The token provided by the consumer. This token authenticates that the consumer can create a connecton within the specified project and network. + string token = 12 [json_name="token"]; + // Output only. Time when the ServiceConnectionMap was updated. + .google.protobuf.Timestamp update_time = 13 [json_name="updateTime"]; +} + +// The ServiceConnectionPolicy resource. Next id: 12 +message ServiceConnectionPolicy { + // Output only. Time when the ServiceConnectionMap was created. + .google.protobuf.Timestamp create_time = 1 [json_name="createTime"]; + // A description of this resource. + string description = 2 [json_name="description"]; + // Optional. The etag is computed by the server, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding. + string etag = 3 [json_name="etag"]; + // Output only. The type of underlying resources used to create the connection. + string infrastructure = 4 [json_name="infrastructure"]; + // User-defined labels. + map labels = 5 [json_name="labels"]; + // Immutable. The name of a ServiceConnectionPolicy. Format: projects/{project}/locations/{location}/serviceConnectionPolicies/{service_connection_policy} See: https://google.aip.dev/122#fields-representing-resource-names + string name = 6 [json_name="name"]; + // The resource path of the consumer network. Example: - projects/{projectNumOrId}/global/networks/{resourceId}. + string network = 7 [json_name="network"]; + // Configuration used for Private Service Connect connections. Used when Infrastructure is PSC. + PscConfig psc_config = 8 [json_name="pscConfig"]; + // Output only. [Output only] Information about each Private Service Connect connection. + repeated PscConnection psc_connections = 9 [json_name="pscConnections"]; + // The service class identifier for which this ServiceConnectionPolicy is for. The service class identifier is a unique, symbolic representation of a ServiceClass. It is provided by the Service Producer. Google services have a prefix of gcp. For example, gcp-cloud-sql. 3rd party services do not. For example, test-service-a3dfcx. + string service_class = 10 [json_name="serviceClass"]; + // Output only. Time when the ServiceConnectionMap was updated. + .google.protobuf.Timestamp update_time = 11 [json_name="updateTime"]; +} + +// The ServiceConnectionToken resource. Next id: 10 +message ServiceConnectionToken { + // Output only. Time when the ServiceConnectionToken was created. + .google.protobuf.Timestamp create_time = 1 [json_name="createTime"]; + // A description of this resource. + string description = 2 [json_name="description"]; + // Optional. The etag is computed by the server, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding. + string etag = 3 [json_name="etag"]; + // Output only. The time to which this token is valid. + .google.protobuf.Timestamp expire_time = 4 [json_name="expireTime"]; + // User-defined labels. + map labels = 5 [json_name="labels"]; + // Immutable. The name of a ServiceConnectionToken. Format: projects/{project}/locations/{location}/ServiceConnectionTokens/{service_connection_token} See: https://google.aip.dev/122#fields-representing-resource-names + string name = 6 [json_name="name"]; + // The resource path of the network associated with this token. Example: projects/{projectNumOrId}/global/networks/{resourceId}. + string network = 7 [json_name="network"]; + // Output only. The token generated by Automation. + string token = 8 [json_name="token"]; + // Output only. Time when the ServiceConnectionToken was updated. + .google.protobuf.Timestamp update_time = 9 [json_name="updateTime"]; +} + +// Request message for `SetIamPolicy` method. +message SetIamPolicyRequest { + // REQUIRED: The complete policy to be applied to the `resource`. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Google Cloud services (such as Projects) might reject them. + Policy policy = 1 [json_name="policy"]; + // OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only the fields in the mask will be modified. If no mask is provided, the following default mask is used: `paths: "bindings, etag"` + string update_mask = 2 [json_name="updateMask"]; +} + +// 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: * linked_vpn_tunnels * linked_interconnect_attachments * linked_router_appliance_instances * linked_vpc_network +message Spoke { + // Output only. The time the spoke was created. + .google.protobuf.Timestamp create_time = 1 [json_name="createTime"]; + // An optional description of the spoke. + string description = 2 [json_name="description"]; + // Optional. The name of the group that this spoke is associated with. + string group = 3 [json_name="group"]; + // Immutable. The name of the hub that this spoke is attached to. + string hub = 4 [json_name="hub"]; + // 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 = 5 [json_name="labels"]; + // VLAN attachments that are associated with the spoke. + LinkedInterconnectAttachments linked_interconnect_attachments = 6 [json_name="linkedInterconnectAttachments"]; + // Router appliance instances that are associated with the spoke. + LinkedRouterApplianceInstances linked_router_appliance_instances = 7 [json_name="linkedRouterApplianceInstances"]; + // Optional. VPC network that is associated with the spoke. + LinkedVpcNetwork linked_vpc_network = 8 [json_name="linkedVpcNetwork"]; + // VPN tunnels that are associated with the spoke. + LinkedVpnTunnels linked_vpn_tunnels = 9 [json_name="linkedVpnTunnels"]; + // Immutable. The name of the spoke. Spoke names must be unique. They use the following form: `projects/{project_number}/locations/{region}/spokes/{spoke_id}` + string name = 10 [json_name="name"]; + // Output only. The reasons for current state of the spoke. Only present when the spoke is in the `INACTIVE` state. + repeated StateReason reasons = 11 [json_name="reasons"]; + // Output only. The type of resource associated with the spoke. + string spoke_type = 12 [json_name="spokeType"]; + // Output only. The current lifecycle state of this spoke. + string state = 13 [json_name="state"]; + // 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`. + string unique_id = 14 [json_name="uniqueId"]; + // Output only. The time the spoke was last updated. + .google.protobuf.Timestamp update_time = 15 [json_name="updateTime"]; +} + +// The number of spokes that are in a particular state and associated with a given hub. +message SpokeStateCount { + // Output only. The total number of spokes that are in this state and associated with a given hub. + int64 count = 1 [json_name="count"]; + // Output only. The state of the spokes. + string state = 2 [json_name="state"]; +} + +// The number of spokes in the hub that are inactive for this reason. +message SpokeStateReasonCount { + // Output only. The total number of spokes that are inactive for a particular reason and associated with a given hub. + int64 count = 1 [json_name="count"]; + // Output only. The reason that a spoke is inactive. + string state_reason_code = 2 [json_name="stateReasonCode"]; +} + +// 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 { + // Output only. Counts the number of spokes that are in each state and associated with a given hub. + repeated SpokeStateCount spoke_state_counts = 1 [json_name="spokeStateCounts"]; + // 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 = 2 [json_name="spokeStateReasonCounts"]; + // Output only. Counts the number of spokes of each type that are associated with a specific hub. + repeated SpokeTypeCount spoke_type_counts = 3 [json_name="spokeTypeCounts"]; +} + +// 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 total number of spokes of this type that are associated with the hub. + int64 count = 1 [json_name="count"]; + // Output only. The type of the spokes. + string spoke_type = 2 [json_name="spokeType"]; +} + +// The reason a spoke is inactive. +message StateReason { + // The code associated with this reason. + string code = 1 [json_name="code"]; + // Human-readable details about this reason. + string message = 2 [json_name="message"]; + // Additional information provided by the user in the RejectSpoke call. + string user_details = 3 [json_name="userDetails"]; +} + +// Request message for `TestIamPermissions` method. +message TestIamPermissionsRequest { + // The set of permissions to check for the `resource`. Permissions with wildcards (such as `*` or `storage.*`) are not allowed. For more information see [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + repeated string permissions = 1 [json_name="permissions"]; +} + +// Response message for `TestIamPermissions` method. +message TestIamPermissionsResponse { + // A subset of `TestPermissionsRequest.permissions` that the caller is allowed. + repeated string permissions = 1 [json_name="permissions"]; +} + +// VM instances that this policy-based route applies to. +message VirtualMachine { + // Optional. A list of VM instance tags that this policy-based route applies to. VM instances that have ANY of tags specified here installs this PBR. + repeated string tags = 1 [json_name="tags"]; +} + +// Informational warning message. +message Warnings { + // Output only. A warning code, if applicable. + string code = 1 [json_name="code"]; + // Output only. Metadata about this warning in key: value format. The key should provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement. + map data = 2 [json_name="data"]; + // Output only. A human-readable description of the warning code. + string warning_message = 3 [json_name="warningMessage"]; +} + +message GetProjectsLocationRequest { + string name = 1; +} + +message ListProjectsLocationsRequest { + string filter = 1; + string name = 2; + int32 page_size = 3; + string page_token = 4; +} + +message AcceptSpokeProjectsLocationsGlobalHubRequest { + string name = 1; + AcceptHubSpokeRequest projects_locations_global_hub = 2; +} + +message CreateProjectsLocationsGlobalHubRequest { + string hub_id = 1; + string parent = 2; + string request_id = 3; + Hub projects_locations_global_hub = 4; +} + +message DeleteProjectsLocationsGlobalHubRequest { + string name = 1; + string request_id = 2; +} + +message GetProjectsLocationsGlobalHubRequest { + string name = 1; +} + +message ListProjectsLocationsGlobalHubsRequest { + string filter = 1; + string order_by = 2; + int32 page_size = 3; + string page_token = 4; + string parent = 5; +} + +message ListSpokesProjectsLocationsGlobalHubRequest { + string filter = 1; + string name = 2; + string order_by = 3; + int32 page_size = 4; + string page_token = 5; + string spoke_locations = 6; + string view = 7; +} + +message PatchProjectsLocationsGlobalHubRequest { + string name = 1; + string request_id = 2; + string update_mask = 3; + Hub projects_locations_global_hub = 4; +} + +message RejectSpokeProjectsLocationsGlobalHubRequest { + string name = 1; + RejectHubSpokeRequest projects_locations_global_hub = 2; +} + +message GetProjectsLocationsGlobalHubsGroupRequest { + string name = 1; +} + +message ListProjectsLocationsGlobalHubsGroupsRequest { + string filter = 1; + string order_by = 2; + int32 page_size = 3; + string page_token = 4; + string parent = 5; +} + +message PatchProjectsLocationsGlobalHubsGroupRequest { + string name = 1; + string request_id = 2; + string update_mask = 3; + Group projects_locations_global_hubs_group = 4; +} + +message GetProjectsLocationsGlobalHubsRouteTableRequest { + string name = 1; +} + +message ListProjectsLocationsGlobalHubsRouteTablesRequest { + string filter = 1; + string order_by = 2; + int32 page_size = 3; + string page_token = 4; + string parent = 5; +} + +message GetProjectsLocationsGlobalHubsRouteTablesRouteRequest { + string name = 1; +} + +message ListProjectsLocationsGlobalHubsRouteTablesRoutesRequest { + string filter = 1; + string order_by = 2; + int32 page_size = 3; + string page_token = 4; + string parent = 5; +} + +message CreateProjectsLocationsGlobalPolicyBasedRouteRequest { + string parent = 1; + string policy_based_route_id = 2; + string request_id = 3; + PolicyBasedRoute projects_locations_global_policy_based_route = 4; +} + +message DeleteProjectsLocationsGlobalPolicyBasedRouteRequest { + string name = 1; + string request_id = 2; +} + +message GetProjectsLocationsGlobalPolicyBasedRouteRequest { + string name = 1; +} + +message ListProjectsLocationsGlobalPolicyBasedRoutesRequest { + string filter = 1; + string order_by = 2; + int32 page_size = 3; + string page_token = 4; + string parent = 5; +} + +message CreateProjectsLocationsInternalRangeRequest { + string internal_range_id = 1; + string parent = 2; + string request_id = 3; + InternalRange projects_locations_internal_range = 4; +} + +message DeleteProjectsLocationsInternalRangeRequest { + string name = 1; + string request_id = 2; +} + +message GetProjectsLocationsInternalRangeRequest { + string name = 1; +} + +message ListProjectsLocationsInternalRangesRequest { + string filter = 1; + string order_by = 2; + int32 page_size = 3; + string page_token = 4; + string parent = 5; +} + +message PatchProjectsLocationsInternalRangeRequest { + string name = 1; + string request_id = 2; + string update_mask = 3; + InternalRange projects_locations_internal_range = 4; +} + +message CreateProjectsLocationsRegionalEndpointRequest { + string parent = 1; + string regional_endpoint_id = 2; + string request_id = 3; + RegionalEndpoint projects_locations_regional_endpoint = 4; +} + +message DeleteProjectsLocationsRegionalEndpointRequest { + string name = 1; + string request_id = 2; +} + +message GetProjectsLocationsRegionalEndpointRequest { + string name = 1; +} + +message ListProjectsLocationsRegionalEndpointsRequest { + string filter = 1; + string order_by = 2; + int32 page_size = 3; + string page_token = 4; + string parent = 5; +} + +message DeleteProjectsLocationsServiceClasseRequest { + string etag = 1; + string name = 2; + string request_id = 3; +} + +message GetProjectsLocationsServiceClasseRequest { + string name = 1; +} + +message ListProjectsLocationsServiceClassesRequest { + string filter = 1; + string order_by = 2; + int32 page_size = 3; + string page_token = 4; + string parent = 5; +} + +message PatchProjectsLocationsServiceClasseRequest { + string name = 1; + string request_id = 2; + string update_mask = 3; + ServiceClass projects_locations_service_classe = 4; +} + +message CreateProjectsLocationsServiceConnectionMapRequest { + string parent = 1; + string request_id = 2; + string service_connection_map_id = 3; + ServiceConnectionMap projects_locations_service_connection_map = 4; +} + +message DeleteProjectsLocationsServiceConnectionMapRequest { + string etag = 1; + string name = 2; + string request_id = 3; +} + +message GetProjectsLocationsServiceConnectionMapRequest { + string name = 1; +} + +message ListProjectsLocationsServiceConnectionMapsRequest { + string filter = 1; + string order_by = 2; + int32 page_size = 3; + string page_token = 4; + string parent = 5; +} + +message PatchProjectsLocationsServiceConnectionMapRequest { + string name = 1; + string request_id = 2; + string update_mask = 3; + ServiceConnectionMap projects_locations_service_connection_map = 4; +} + +message CreateProjectsLocationsServiceConnectionPolicyRequest { + string parent = 1; + string request_id = 2; + string service_connection_policy_id = 3; + ServiceConnectionPolicy projects_locations_service_connection_policy = 4; +} + +message DeleteProjectsLocationsServiceConnectionPolicyRequest { + string etag = 1; + string name = 2; + string request_id = 3; +} + +message GetProjectsLocationsServiceConnectionPolicyRequest { + string name = 1; +} + +message ListProjectsLocationsServiceConnectionPoliciesRequest { + string filter = 1; + string order_by = 2; + int32 page_size = 3; + string page_token = 4; + string parent = 5; +} + +message PatchProjectsLocationsServiceConnectionPolicyRequest { + string name = 1; + string request_id = 2; + string update_mask = 3; + ServiceConnectionPolicy projects_locations_service_connection_policy = 4; +} + +message CreateProjectsLocationsServiceConnectionTokenRequest { + string parent = 1; + string request_id = 2; + string service_connection_token_id = 3; + ServiceConnectionToken projects_locations_service_connection_token = 4; +} + +message DeleteProjectsLocationsServiceConnectionTokenRequest { + string etag = 1; + string name = 2; + string request_id = 3; +} + +message GetProjectsLocationsServiceConnectionTokenRequest { + string name = 1; +} + +message ListProjectsLocationsServiceConnectionTokensRequest { + string filter = 1; + string order_by = 2; + int32 page_size = 3; + string page_token = 4; + string parent = 5; +} + +message CreateProjectsLocationsSpokeRequest { + string parent = 1; + string request_id = 2; + string spoke_id = 3; + Spoke projects_locations_spoke = 4; +} + +message DeleteProjectsLocationsSpokeRequest { + string name = 1; + string request_id = 2; +} + +message GetProjectsLocationsSpokeRequest { + string name = 1; +} + +message ListProjectsLocationsSpokesRequest { + string filter = 1; + string order_by = 2; + int32 page_size = 3; + string page_token = 4; + string parent = 5; +} + +message PatchProjectsLocationsSpokeRequest { + string name = 1; + string request_id = 2; + string update_mask = 3; + Spoke projects_locations_spoke = 4; +} diff --git a/mockgcp/go.mod b/mockgcp/go.mod index ff3c58bc56..15a9719724 100644 --- a/mockgcp/go.mod +++ b/mockgcp/go.mod @@ -19,7 +19,7 @@ require ( google.golang.org/protobuf v1.34.2 k8s.io/api v0.27.11 k8s.io/apimachinery v0.27.11 - k8s.io/klog/v2 v2.100.1 + k8s.io/klog/v2 v2.130.1 sigs.k8s.io/controller-runtime v0.15.2 ) diff --git a/mockgcp/go.sum b/mockgcp/go.sum index 5464679c32..ba72d29286 100644 --- a/mockgcp/go.sum +++ b/mockgcp/go.sum @@ -42,7 +42,6 @@ github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2 github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -291,8 +290,7 @@ k8s.io/api v0.27.11 h1:IsGrWbXt7RkE+arc9GLQPYI5AtZkT+feBMorY+Nzx4I= k8s.io/apiextensions-apiserver v0.27.9 h1:z7f95DVIrNkscuV2f/JdZNpjOxpUYeeRYcmrn0Wixas= k8s.io/apimachinery v0.27.11 h1:ivrKMN7JgdtKhay14S5UQlvilV3z6W+wjiSQTzyr5zc= k8s.io/client-go v0.27.11 h1:SZChXsDaN6lB5IYywCpvQs/ZUa5vK2NHkpEwUhoK3fQ= -k8s.io/klog/v2 v2.100.1 h1:7WCHKK6K8fNhTqfBhISHQ97KrnJNFZMcQvKp7gP/tmg= -k8s.io/klog/v2 v2.100.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= +k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f h1:2kWPakN3i/k81b0gvD5C5FJ2kxm1WrQFanWchyKuqGg= k8s.io/utils v0.0.0-20230505201702-9f6742963106 h1:EObNQ3TW2D+WptiYXlApGNLVy0zm/JIBVY9i+M4wpAU= sigs.k8s.io/controller-runtime v0.15.2 h1:9V7b7SDQSJ08IIsJ6CY1CE85Okhp87dyTMNDG0FS7f4= diff --git a/mockgcp/tools/gapic/pkg/protogen/convert.go b/mockgcp/tools/gapic/pkg/protogen/convert.go index a6eab4e064..11822a7070 100644 --- a/mockgcp/tools/gapic/pkg/protogen/convert.go +++ b/mockgcp/tools/gapic/pkg/protogen/convert.go @@ -575,6 +575,8 @@ func (c *OpenAPIConverter) buildServiceFromOpenAPI(pluralName string, resource * proto.SetExtension(serviceMethod.Options, annotations.E_Http, httpRule) + c.SetComment(c.protoPackageName+"."+service.GetName()+"."+serviceMethod.GetName(), method.Description) + service.Method = append(service.Method, serviceMethod) klog.V(4).Infof("%s/%s => %v", singularName, methodName, prototext.Format(serviceMethod)) @@ -609,13 +611,17 @@ func (c *OpenAPIConverter) Convert(ctx context.Context) (*descriptorpb.FileDescr message := c.doc.Schemas[schemaName] if message.Type == "object" { - desc, err := c.buildMessageFromOpenAPI(message) - if err != nil { - return nil, fmt.Errorf("buildMessageFromOpenAPI failed: %w", err) - } - c.fileDescriptor.MessageType = append(c.fileDescriptor.MessageType, desc) + if !c.isWellKnown(message.ID) { + desc, err := c.buildMessageFromOpenAPI(message) + if err != nil { + return nil, fmt.Errorf("buildMessageFromOpenAPI failed: %w", err) + } + c.fileDescriptor.MessageType = append(c.fileDescriptor.MessageType, desc) - klog.V(4).Infof("%s => %+v\n", schemaName, prototext.Format(desc)) + klog.V(4).Infof("%s => %+v\n", schemaName, prototext.Format(desc)) + } else { + klog.Infof("skipping well known message %q", schemaName) + } } else if message.Type == "any" { klog.Warningf("skipping schema with type any: %q", message.ID) } else { @@ -669,7 +675,7 @@ func (c *OpenAPIConverter) resolveMessageType(ref string) string { } switch ref { - case "Operation": + case "Operation", "GoogleLongrunningOperation": c.addImport("google/longrunning/operations.proto") return "google.longrunning.Operation" @@ -678,6 +684,19 @@ func (c *OpenAPIConverter) resolveMessageType(ref string) string { } } +func (c *OpenAPIConverter) isWellKnown(ref string) bool { + if ref == "" { + return false + } + resolved := c.resolveMessageType(ref) + switch resolved { + case "google.longrunning.Operation": + return true + } + + return false +} + func (c *OpenAPIConverter) setPrimitiveType(property *openapi.Property, field *descriptorpb.FieldDescriptorProto) { switch property.Type { diff --git a/mockgcp/tools/gapic/pkg/protogen/render.go b/mockgcp/tools/gapic/pkg/protogen/render.go index 5fcfc34566..12fb54a78d 100644 --- a/mockgcp/tools/gapic/pkg/protogen/render.go +++ b/mockgcp/tools/gapic/pkg/protogen/render.go @@ -184,6 +184,7 @@ func (p *ProtoWriter) renderField(fd protoreflect.FieldDescriptor) { } func (p *ProtoWriter) renderMessage(msg protoreflect.MessageDescriptor) { + p.printf("\n") comment := p.getComment(msg.FullName()) if comment != "" { for _, line := range strings.Split(comment, "\n") { @@ -202,6 +203,14 @@ func (p *ProtoWriter) renderMessage(msg protoreflect.MessageDescriptor) { } func (p *ProtoWriter) renderMethod(md protoreflect.MethodDescriptor) { + p.printf("\n") + comment := p.getComment(md.FullName()) + if comment != "" { + for _, line := range strings.Split(comment, "\n") { + p.printf(" // %s\n", line) + } + } + var b bytes.Buffer b.WriteString(" rpc ") @@ -216,9 +225,9 @@ func (p *ProtoWriter) renderMethod(md protoreflect.MethodDescriptor) { options := md.Options() if options != nil { - b.WriteString("{\n") + b.WriteString(" {\n") proto.RangeExtensions(options, func(xt protoreflect.ExtensionType, v interface{}) bool { - b.WriteString(fmt.Sprintf(" option (%s) = {\n", xt.TypeDescriptor().FullName())) + b.WriteString(fmt.Sprintf(" option (%s) = {\n", xt.TypeDescriptor().FullName())) formatted, err := prototext.MarshalOptions{Multiline: true}.Marshal(v.(proto.Message)) if err != nil { p.errors = append(p.errors, err) @@ -227,14 +236,17 @@ func (p *ProtoWriter) renderMethod(md protoreflect.MethodDescriptor) { if line == "" { continue } - b.WriteString(" ") + // Undo the randomization (deliberately) injected by prototext + line = strings.Replace(line, ": ", ": ", 1) + // Add indent (MarshalOptions.Indent just doesn't seem to work...) + b.WriteString(" ") b.WriteString(line) b.WriteString("\n") } - b.WriteString(" };\n") + b.WriteString(" };\n") return true }) - b.WriteString("}\n") + b.WriteString(" }") } b.WriteString(";\n") @@ -243,6 +255,7 @@ func (p *ProtoWriter) renderMethod(md protoreflect.MethodDescriptor) { } func (p *ProtoWriter) renderService(msg protoreflect.ServiceDescriptor) { + p.printf("\n") p.printf("service %s {\n", msg.Name()) methods := msg.Methods() for i := 0; i < methods.Len(); i++ { diff --git a/pkg/clients/generated/apis/networkconnectivity/v1alpha1/doc.go b/pkg/clients/generated/apis/networkconnectivity/v1alpha1/doc.go new file mode 100644 index 0000000000..b2614b9b4a --- /dev/null +++ b/pkg/clients/generated/apis/networkconnectivity/v1alpha1/doc.go @@ -0,0 +1,38 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// ---------------------------------------------------------------------------- +// +// *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +// +// ---------------------------------------------------------------------------- +// +// This file is automatically generated by Config Connector and manual +// changes will be clobbered when the file is regenerated. +// +// ---------------------------------------------------------------------------- + +// *** DISCLAIMER *** +// Config Connector's go-client for CRDs is currently in ALPHA, which means +// that future versions of the go-client may include breaking changes. +// Please try it out and give us feedback! + +// Package v1alpha1 contains API Schema definitions for the networkconnectivity v1alpha1 API group. +// +k8s:openapi-gen=true +// +k8s:deepcopy-gen=package,register +// +k8s:conversion-gen=github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/pkg/apis/networkconnectivity +// +k8s:defaulter-gen=TypeMeta +// +groupName=networkconnectivity.cnrm.cloud.google.com + +package v1alpha1 diff --git a/pkg/clients/generated/apis/networkconnectivity/v1alpha1/networkconnectivityserviceconnectionpolicy_types.go b/pkg/clients/generated/apis/networkconnectivity/v1alpha1/networkconnectivityserviceconnectionpolicy_types.go new file mode 100644 index 0000000000..391566ff5e --- /dev/null +++ b/pkg/clients/generated/apis/networkconnectivity/v1alpha1/networkconnectivityserviceconnectionpolicy_types.go @@ -0,0 +1,213 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// ---------------------------------------------------------------------------- +// +// *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +// +// ---------------------------------------------------------------------------- +// +// This file is automatically generated by Config Connector and manual +// changes will be clobbered when the file is regenerated. +// +// ---------------------------------------------------------------------------- + +// *** DISCLAIMER *** +// Config Connector's go-client for CRDs is currently in ALPHA, which means +// that future versions of the go-client may include breaking changes. +// Please try it out and give us feedback! + +package v1alpha1 + +import ( + "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/k8s/v1alpha1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +type ServiceconnectionpolicyPscConfig struct { + /* Optional. Max number of PSC connections for this policy. */ + // +optional + Limit *int64 `json:"limit,omitempty"` + + /* Required. ProducerInstanceLocation is used to specify which authorization mechanism to use to determine which projects the Producer instance can be within. */ + // +optional + ProducerInstanceLocation *string `json:"producerInstanceLocation,omitempty"` + + /* The resource paths of subnetworks to use for IP address management. Example: projects/{projectNumOrId}/regions/{region}/subnetworks/{resourceId}. */ + // +optional + SubnetworkRefs []v1alpha1.ResourceRef `json:"subnetworkRefs,omitempty"` +} + +type NetworkConnectivityServiceConnectionPolicySpec struct { + /* A description of this resource. */ + // +optional + Description *string `json:"description,omitempty"` + + /* The resource path of the consumer network. Example: - projects/{projectNumOrId}/global/networks/{resourceId}. */ + // +optional + NetworkRef *v1alpha1.ResourceRef `json:"networkRef,omitempty"` + + /* Configuration used for Private Service Connect connections. Used when Infrastructure is PSC. */ + // +optional + PscConfig *ServiceconnectionpolicyPscConfig `json:"pscConfig,omitempty"` + + /* The NetworkConnectivityServiceConnectionPolicy name. If not given, the metadata.name will be used. */ + // +optional + ResourceID *string `json:"resourceID,omitempty"` + + /* The service class identifier for which this ServiceConnectionPolicy is for. The service class identifier is a unique, symbolic representation of a ServiceClass. It is provided by the Service Producer. Google services have a prefix of gcp. For example, gcp-cloud-sql. 3rd party services do not. For example, test-service-a3dfcx. */ + // +optional + ServiceClass *string `json:"serviceClass,omitempty"` +} + +type ServiceconnectionpolicyErrorInfoStatus struct { + /* The logical grouping to which the "reason" belongs. The error domain is typically the registered service name of the tool or product that generates the error. Example: "pubsub.googleapis.com". If the error is generated by some common infrastructure, the error domain must be a globally unique value that identifies the infrastructure. For Google API infrastructure, the error domain is "googleapis.com". */ + // +optional + Domain *string `json:"domain,omitempty"` + + /* Additional structured details about this error. Keys must match /a-z+/ but should ideally be lowerCamelCase. Also they must be limited to 64 characters in length. When identifying the current value of an exceeded limit, the units should be contained in the key, not the value. For example, rather than {"instanceLimit": "100/request"}, should be returned as, {"instanceLimitPerRequest": "100"}, if the client exceeds the number of instances that can be created in a single (batch) request. */ + // +optional + Metadata map[string]string `json:"metadata,omitempty"` + + /* The reason of the error. This is a constant value that identifies the proximate cause of the error. Error reasons are unique within a particular domain of errors. This should be at most 63 characters and match a regular expression of `A-Z+[A-Z0-9]`, which represents UPPER_SNAKE_CASE. */ + // +optional + Reason *string `json:"reason,omitempty"` +} + +type ServiceconnectionpolicyErrorStatus struct { + /* The status code, which should be an enum value of google.rpc.Code. */ + // +optional + Code *int32 `json:"code,omitempty"` + + /* A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client. */ + // +optional + Message *string `json:"message,omitempty"` +} + +type ServiceconnectionpolicyObservedStateStatus struct { + /* Output only. Time when the ServiceConnectionMap was created. */ + // +optional + CreateTime *string `json:"createTime,omitempty"` + + /* Optional. The etag is computed by the server, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding. */ + // +optional + Etag *string `json:"etag,omitempty"` + + /* Output only. The type of underlying resources used to create the connection. */ + // +optional + Infrastructure *string `json:"infrastructure,omitempty"` + + /* Output only. [Output only] Information about each Private Service Connect connection. */ + // +optional + PscConnections []ServiceconnectionpolicyPscConnectionsStatus `json:"pscConnections,omitempty"` + + /* Output only. Time when the ServiceConnectionMap was updated. */ + // +optional + UpdateTime *string `json:"updateTime,omitempty"` +} + +type ServiceconnectionpolicyPscConnectionsStatus struct { + /* The resource reference of the consumer address. */ + // +optional + ConsumerAddress *string `json:"consumerAddress,omitempty"` + + /* The resource reference of the PSC Forwarding Rule within the consumer VPC. */ + // +optional + ConsumerForwardingRule *string `json:"consumerForwardingRule,omitempty"` + + /* The project where the PSC connection is created. */ + // +optional + ConsumerTargetProject *string `json:"consumerTargetProject,omitempty"` + + /* The most recent error during operating this connection. */ + // +optional + Error *ServiceconnectionpolicyErrorStatus `json:"error,omitempty"` + + /* Output only. The error info for the latest error during operating this connection. */ + // +optional + ErrorInfo *ServiceconnectionpolicyErrorInfoStatus `json:"errorInfo,omitempty"` + + /* The error type indicates whether the error is consumer facing, producer facing or system internal. */ + // +optional + ErrorType *string `json:"errorType,omitempty"` + + /* The last Compute Engine operation to setup PSC connection. */ + // +optional + GceOperation *string `json:"gceOperation,omitempty"` + + /* Immutable. An immutable identifier for the producer instance. */ + // +optional + ProducerInstanceID *string `json:"producerInstanceID,omitempty"` + + /* The PSC connection id of the PSC forwarding rule. */ + // +optional + PscConnectionID *string `json:"pscConnectionID,omitempty"` + + /* Output only. The URI of the subnetwork selected to allocate IP address for this connection. */ + // +optional + SelectedSubnetwork *string `json:"selectedSubnetwork,omitempty"` + + /* State of the PSC Connection */ + // +optional + State *string `json:"state,omitempty"` +} + +type NetworkConnectivityServiceConnectionPolicyStatus struct { + /* Conditions represent the latest available observations of the + NetworkConnectivityServiceConnectionPolicy's current state. */ + Conditions []v1alpha1.Condition `json:"conditions,omitempty"` + /* A unique specifier for the NetworkConnectivityServiceConnectionPolicy resource in GCP. */ + // +optional + ExternalRef *string `json:"externalRef,omitempty"` + + /* ObservedGeneration is the generation of the resource that was most recently observed by the Config Connector controller. If this is equal to metadata.generation, then that means that the current reported status reflects the most recent desired state of the resource. */ + // +optional + ObservedGeneration *int64 `json:"observedGeneration,omitempty"` + + /* ObservedState is the state of the resource as most recently observed in GCP. */ + // +optional + ObservedState *ServiceconnectionpolicyObservedStateStatus `json:"observedState,omitempty"` +} + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +kubebuilder:resource:categories=,shortName= +// +kubebuilder:subresource:status +// +kubebuilder:metadata:labels="cnrm.cloud.google.com/managed-by-kcc=true";"cnrm.cloud.google.com/system=true" +// +kubebuilder:printcolumn:name="Ready",JSONPath=".status.conditions[?(@.type=='Ready')].status",type="string",description="When 'True', the most recent reconcile of the resource succeeded" +// +kubebuilder:printcolumn:name="Status",JSONPath=".status.conditions[?(@.type=='Ready')].reason",type="string",description="The reason for the value in 'Ready'" +// +kubebuilder:printcolumn:name="Status Age",JSONPath=".status.conditions[?(@.type=='Ready')].lastTransitionTime",type="date",description="The last transition time for the value in 'Status'" + +// NetworkConnectivityServiceConnectionPolicy is the Schema for the networkconnectivity API +// +k8s:openapi-gen=true +type NetworkConnectivityServiceConnectionPolicy struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec NetworkConnectivityServiceConnectionPolicySpec `json:"spec,omitempty"` + Status NetworkConnectivityServiceConnectionPolicyStatus `json:"status,omitempty"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// NetworkConnectivityServiceConnectionPolicyList contains a list of NetworkConnectivityServiceConnectionPolicy +type NetworkConnectivityServiceConnectionPolicyList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []NetworkConnectivityServiceConnectionPolicy `json:"items"` +} + +func init() { + SchemeBuilder.Register(&NetworkConnectivityServiceConnectionPolicy{}, &NetworkConnectivityServiceConnectionPolicyList{}) +} diff --git a/pkg/clients/generated/apis/networkconnectivity/v1alpha1/register.go b/pkg/clients/generated/apis/networkconnectivity/v1alpha1/register.go new file mode 100644 index 0000000000..b85c52f806 --- /dev/null +++ b/pkg/clients/generated/apis/networkconnectivity/v1alpha1/register.go @@ -0,0 +1,63 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// ---------------------------------------------------------------------------- +// +// *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +// +// ---------------------------------------------------------------------------- +// +// This file is automatically generated by Config Connector and manual +// changes will be clobbered when the file is regenerated. +// +// ---------------------------------------------------------------------------- + +// *** DISCLAIMER *** +// Config Connector's go-client for CRDs is currently in ALPHA, which means +// that future versions of the go-client may include breaking changes. +// Please try it out and give us feedback! + +// Package v1alpha1 contains API Schema definitions for the networkconnectivity v1alpha1 API group. +// +k8s:openapi-gen=true +// +k8s:deepcopy-gen=package,register +// +k8s:conversion-gen=github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/pkg/apis/networkconnectivity +// +k8s:defaulter-gen=TypeMeta +// +groupName=networkconnectivity.cnrm.cloud.google.com +package v1alpha1 + +import ( + "reflect" + + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +var ( + // SchemeGroupVersion is the group version used to register these objects. + SchemeGroupVersion = schema.GroupVersion{Group: "networkconnectivity.cnrm.cloud.google.com", Version: "v1alpha1"} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme. + SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion} + + // AddToScheme is a global function that registers this API group & version to a scheme + AddToScheme = SchemeBuilder.AddToScheme + + NetworkConnectivityServiceConnectionPolicyGVK = schema.GroupVersionKind{ + Group: SchemeGroupVersion.Group, + Version: SchemeGroupVersion.Version, + Kind: reflect.TypeOf(NetworkConnectivityServiceConnectionPolicy{}).Name(), + } + + networkconnectivityAPIVersion = SchemeGroupVersion.String() +) diff --git a/pkg/clients/generated/apis/networkconnectivity/v1alpha1/zz_generated.deepcopy.go b/pkg/clients/generated/apis/networkconnectivity/v1alpha1/zz_generated.deepcopy.go new file mode 100644 index 0000000000..2286d38c11 --- /dev/null +++ b/pkg/clients/generated/apis/networkconnectivity/v1alpha1/zz_generated.deepcopy.go @@ -0,0 +1,372 @@ +//go:build !ignore_autogenerated +// +build !ignore_autogenerated + +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// *** DISCLAIMER *** +// Config Connector's go-client for CRDs is currently in ALPHA, which means +// that future versions of the go-client may include breaking changes. +// Please try it out and give us feedback! + +// Code generated by deepcopy-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + k8sv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/k8s/v1alpha1" + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkConnectivityServiceConnectionPolicy) DeepCopyInto(out *NetworkConnectivityServiceConnectionPolicy) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkConnectivityServiceConnectionPolicy. +func (in *NetworkConnectivityServiceConnectionPolicy) DeepCopy() *NetworkConnectivityServiceConnectionPolicy { + if in == nil { + return nil + } + out := new(NetworkConnectivityServiceConnectionPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NetworkConnectivityServiceConnectionPolicy) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkConnectivityServiceConnectionPolicyList) DeepCopyInto(out *NetworkConnectivityServiceConnectionPolicyList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]NetworkConnectivityServiceConnectionPolicy, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkConnectivityServiceConnectionPolicyList. +func (in *NetworkConnectivityServiceConnectionPolicyList) DeepCopy() *NetworkConnectivityServiceConnectionPolicyList { + if in == nil { + return nil + } + out := new(NetworkConnectivityServiceConnectionPolicyList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *NetworkConnectivityServiceConnectionPolicyList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkConnectivityServiceConnectionPolicySpec) DeepCopyInto(out *NetworkConnectivityServiceConnectionPolicySpec) { + *out = *in + if in.Description != nil { + in, out := &in.Description, &out.Description + *out = new(string) + **out = **in + } + if in.NetworkRef != nil { + in, out := &in.NetworkRef, &out.NetworkRef + *out = new(k8sv1alpha1.ResourceRef) + **out = **in + } + if in.PscConfig != nil { + in, out := &in.PscConfig, &out.PscConfig + *out = new(ServiceconnectionpolicyPscConfig) + (*in).DeepCopyInto(*out) + } + if in.ResourceID != nil { + in, out := &in.ResourceID, &out.ResourceID + *out = new(string) + **out = **in + } + if in.ServiceClass != nil { + in, out := &in.ServiceClass, &out.ServiceClass + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkConnectivityServiceConnectionPolicySpec. +func (in *NetworkConnectivityServiceConnectionPolicySpec) DeepCopy() *NetworkConnectivityServiceConnectionPolicySpec { + if in == nil { + return nil + } + out := new(NetworkConnectivityServiceConnectionPolicySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkConnectivityServiceConnectionPolicyStatus) DeepCopyInto(out *NetworkConnectivityServiceConnectionPolicyStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]k8sv1alpha1.Condition, len(*in)) + copy(*out, *in) + } + if in.ExternalRef != nil { + in, out := &in.ExternalRef, &out.ExternalRef + *out = new(string) + **out = **in + } + if in.ObservedGeneration != nil { + in, out := &in.ObservedGeneration, &out.ObservedGeneration + *out = new(int64) + **out = **in + } + if in.ObservedState != nil { + in, out := &in.ObservedState, &out.ObservedState + *out = new(ServiceconnectionpolicyObservedStateStatus) + (*in).DeepCopyInto(*out) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkConnectivityServiceConnectionPolicyStatus. +func (in *NetworkConnectivityServiceConnectionPolicyStatus) DeepCopy() *NetworkConnectivityServiceConnectionPolicyStatus { + if in == nil { + return nil + } + out := new(NetworkConnectivityServiceConnectionPolicyStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceconnectionpolicyErrorInfoStatus) DeepCopyInto(out *ServiceconnectionpolicyErrorInfoStatus) { + *out = *in + if in.Domain != nil { + in, out := &in.Domain, &out.Domain + *out = new(string) + **out = **in + } + if in.Metadata != nil { + in, out := &in.Metadata, &out.Metadata + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Reason != nil { + in, out := &in.Reason, &out.Reason + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceconnectionpolicyErrorInfoStatus. +func (in *ServiceconnectionpolicyErrorInfoStatus) DeepCopy() *ServiceconnectionpolicyErrorInfoStatus { + if in == nil { + return nil + } + out := new(ServiceconnectionpolicyErrorInfoStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceconnectionpolicyErrorStatus) DeepCopyInto(out *ServiceconnectionpolicyErrorStatus) { + *out = *in + if in.Code != nil { + in, out := &in.Code, &out.Code + *out = new(int32) + **out = **in + } + if in.Message != nil { + in, out := &in.Message, &out.Message + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceconnectionpolicyErrorStatus. +func (in *ServiceconnectionpolicyErrorStatus) DeepCopy() *ServiceconnectionpolicyErrorStatus { + if in == nil { + return nil + } + out := new(ServiceconnectionpolicyErrorStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceconnectionpolicyObservedStateStatus) DeepCopyInto(out *ServiceconnectionpolicyObservedStateStatus) { + *out = *in + if in.CreateTime != nil { + in, out := &in.CreateTime, &out.CreateTime + *out = new(string) + **out = **in + } + if in.Etag != nil { + in, out := &in.Etag, &out.Etag + *out = new(string) + **out = **in + } + if in.Infrastructure != nil { + in, out := &in.Infrastructure, &out.Infrastructure + *out = new(string) + **out = **in + } + if in.PscConnections != nil { + in, out := &in.PscConnections, &out.PscConnections + *out = make([]ServiceconnectionpolicyPscConnectionsStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.UpdateTime != nil { + in, out := &in.UpdateTime, &out.UpdateTime + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceconnectionpolicyObservedStateStatus. +func (in *ServiceconnectionpolicyObservedStateStatus) DeepCopy() *ServiceconnectionpolicyObservedStateStatus { + if in == nil { + return nil + } + out := new(ServiceconnectionpolicyObservedStateStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceconnectionpolicyPscConfig) DeepCopyInto(out *ServiceconnectionpolicyPscConfig) { + *out = *in + if in.Limit != nil { + in, out := &in.Limit, &out.Limit + *out = new(int64) + **out = **in + } + if in.ProducerInstanceLocation != nil { + in, out := &in.ProducerInstanceLocation, &out.ProducerInstanceLocation + *out = new(string) + **out = **in + } + if in.SubnetworkRefs != nil { + in, out := &in.SubnetworkRefs, &out.SubnetworkRefs + *out = make([]k8sv1alpha1.ResourceRef, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceconnectionpolicyPscConfig. +func (in *ServiceconnectionpolicyPscConfig) DeepCopy() *ServiceconnectionpolicyPscConfig { + if in == nil { + return nil + } + out := new(ServiceconnectionpolicyPscConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ServiceconnectionpolicyPscConnectionsStatus) DeepCopyInto(out *ServiceconnectionpolicyPscConnectionsStatus) { + *out = *in + if in.ConsumerAddress != nil { + in, out := &in.ConsumerAddress, &out.ConsumerAddress + *out = new(string) + **out = **in + } + if in.ConsumerForwardingRule != nil { + in, out := &in.ConsumerForwardingRule, &out.ConsumerForwardingRule + *out = new(string) + **out = **in + } + if in.ConsumerTargetProject != nil { + in, out := &in.ConsumerTargetProject, &out.ConsumerTargetProject + *out = new(string) + **out = **in + } + if in.Error != nil { + in, out := &in.Error, &out.Error + *out = new(ServiceconnectionpolicyErrorStatus) + (*in).DeepCopyInto(*out) + } + if in.ErrorInfo != nil { + in, out := &in.ErrorInfo, &out.ErrorInfo + *out = new(ServiceconnectionpolicyErrorInfoStatus) + (*in).DeepCopyInto(*out) + } + if in.ErrorType != nil { + in, out := &in.ErrorType, &out.ErrorType + *out = new(string) + **out = **in + } + if in.GceOperation != nil { + in, out := &in.GceOperation, &out.GceOperation + *out = new(string) + **out = **in + } + if in.ProducerInstanceID != nil { + in, out := &in.ProducerInstanceID, &out.ProducerInstanceID + *out = new(string) + **out = **in + } + if in.PscConnectionID != nil { + in, out := &in.PscConnectionID, &out.PscConnectionID + *out = new(string) + **out = **in + } + if in.SelectedSubnetwork != nil { + in, out := &in.SelectedSubnetwork, &out.SelectedSubnetwork + *out = new(string) + **out = **in + } + if in.State != nil { + in, out := &in.State, &out.State + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceconnectionpolicyPscConnectionsStatus. +func (in *ServiceconnectionpolicyPscConnectionsStatus) DeepCopy() *ServiceconnectionpolicyPscConnectionsStatus { + if in == nil { + return nil + } + out := new(ServiceconnectionpolicyPscConnectionsStatus) + in.DeepCopyInto(out) + return out +} diff --git a/pkg/clients/generated/client/clientset/versioned/clientset.go b/pkg/clients/generated/client/clientset/versioned/clientset.go index 9616071e5d..75ba0d03ba 100644 --- a/pkg/clients/generated/client/clientset/versioned/clientset.go +++ b/pkg/clients/generated/client/clientset/versioned/clientset.go @@ -102,6 +102,7 @@ import ( memcachev1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/memcache/v1beta1" mlenginev1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/mlengine/v1alpha1" monitoringv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/monitoring/v1beta1" + networkconnectivityv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/networkconnectivity/v1alpha1" networkconnectivityv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/networkconnectivity/v1beta1" networkmanagementv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/networkmanagement/v1alpha1" networksecurityv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/networksecurity/v1beta1" @@ -227,6 +228,7 @@ type Interface interface { MemcacheV1beta1() memcachev1beta1.MemcacheV1beta1Interface MlengineV1alpha1() mlenginev1alpha1.MlengineV1alpha1Interface MonitoringV1beta1() monitoringv1beta1.MonitoringV1beta1Interface + NetworkconnectivityV1alpha1() networkconnectivityv1alpha1.NetworkconnectivityV1alpha1Interface NetworkconnectivityV1beta1() networkconnectivityv1beta1.NetworkconnectivityV1beta1Interface NetworkmanagementV1alpha1() networkmanagementv1alpha1.NetworkmanagementV1alpha1Interface NetworksecurityV1beta1() networksecurityv1beta1.NetworksecurityV1beta1Interface @@ -350,6 +352,7 @@ type Clientset struct { memcacheV1beta1 *memcachev1beta1.MemcacheV1beta1Client mlengineV1alpha1 *mlenginev1alpha1.MlengineV1alpha1Client monitoringV1beta1 *monitoringv1beta1.MonitoringV1beta1Client + networkconnectivityV1alpha1 *networkconnectivityv1alpha1.NetworkconnectivityV1alpha1Client networkconnectivityV1beta1 *networkconnectivityv1beta1.NetworkconnectivityV1beta1Client networkmanagementV1alpha1 *networkmanagementv1alpha1.NetworkmanagementV1alpha1Client networksecurityV1beta1 *networksecurityv1beta1.NetworksecurityV1beta1Client @@ -778,6 +781,11 @@ func (c *Clientset) MonitoringV1beta1() monitoringv1beta1.MonitoringV1beta1Inter return c.monitoringV1beta1 } +// NetworkconnectivityV1alpha1 retrieves the NetworkconnectivityV1alpha1Client +func (c *Clientset) NetworkconnectivityV1alpha1() networkconnectivityv1alpha1.NetworkconnectivityV1alpha1Interface { + return c.networkconnectivityV1alpha1 +} + // NetworkconnectivityV1beta1 retrieves the NetworkconnectivityV1beta1Client func (c *Clientset) NetworkconnectivityV1beta1() networkconnectivityv1beta1.NetworkconnectivityV1beta1Interface { return c.networkconnectivityV1beta1 @@ -1335,6 +1343,10 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*Clientset, if err != nil { return nil, err } + cs.networkconnectivityV1alpha1, err = networkconnectivityv1alpha1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } cs.networkconnectivityV1beta1, err = networkconnectivityv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) if err != nil { return nil, err @@ -1597,6 +1609,7 @@ func New(c rest.Interface) *Clientset { cs.memcacheV1beta1 = memcachev1beta1.New(c) cs.mlengineV1alpha1 = mlenginev1alpha1.New(c) cs.monitoringV1beta1 = monitoringv1beta1.New(c) + cs.networkconnectivityV1alpha1 = networkconnectivityv1alpha1.New(c) cs.networkconnectivityV1beta1 = networkconnectivityv1beta1.New(c) cs.networkmanagementV1alpha1 = networkmanagementv1alpha1.New(c) cs.networksecurityV1beta1 = networksecurityv1beta1.New(c) diff --git a/pkg/clients/generated/client/clientset/versioned/fake/clientset_generated.go b/pkg/clients/generated/client/clientset/versioned/fake/clientset_generated.go index e4aeb0b43f..3e9365db18 100644 --- a/pkg/clients/generated/client/clientset/versioned/fake/clientset_generated.go +++ b/pkg/clients/generated/client/clientset/versioned/fake/clientset_generated.go @@ -177,6 +177,8 @@ import ( fakemlenginev1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/mlengine/v1alpha1/fake" monitoringv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/monitoring/v1beta1" fakemonitoringv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/monitoring/v1beta1/fake" + networkconnectivityv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/networkconnectivity/v1alpha1" + fakenetworkconnectivityv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/networkconnectivity/v1alpha1/fake" networkconnectivityv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/networkconnectivity/v1beta1" fakenetworkconnectivityv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/networkconnectivity/v1beta1/fake" networkmanagementv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/networkmanagement/v1alpha1" @@ -701,6 +703,11 @@ func (c *Clientset) MonitoringV1beta1() monitoringv1beta1.MonitoringV1beta1Inter return &fakemonitoringv1beta1.FakeMonitoringV1beta1{Fake: &c.Fake} } +// NetworkconnectivityV1alpha1 retrieves the NetworkconnectivityV1alpha1Client +func (c *Clientset) NetworkconnectivityV1alpha1() networkconnectivityv1alpha1.NetworkconnectivityV1alpha1Interface { + return &fakenetworkconnectivityv1alpha1.FakeNetworkconnectivityV1alpha1{Fake: &c.Fake} +} + // NetworkconnectivityV1beta1 retrieves the NetworkconnectivityV1beta1Client func (c *Clientset) NetworkconnectivityV1beta1() networkconnectivityv1beta1.NetworkconnectivityV1beta1Interface { return &fakenetworkconnectivityv1beta1.FakeNetworkconnectivityV1beta1{Fake: &c.Fake} diff --git a/pkg/clients/generated/client/clientset/versioned/fake/register.go b/pkg/clients/generated/client/clientset/versioned/fake/register.go index 627ae0171b..8d19c1b96c 100644 --- a/pkg/clients/generated/client/clientset/versioned/fake/register.go +++ b/pkg/clients/generated/client/clientset/versioned/fake/register.go @@ -99,6 +99,7 @@ import ( memcachev1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/memcache/v1beta1" mlenginev1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/mlengine/v1alpha1" monitoringv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/monitoring/v1beta1" + networkconnectivityv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/networkconnectivity/v1alpha1" networkconnectivityv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/networkconnectivity/v1beta1" networkmanagementv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/networkmanagement/v1alpha1" networksecurityv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/networksecurity/v1beta1" @@ -228,6 +229,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{ memcachev1beta1.AddToScheme, mlenginev1alpha1.AddToScheme, monitoringv1beta1.AddToScheme, + networkconnectivityv1alpha1.AddToScheme, networkconnectivityv1beta1.AddToScheme, networkmanagementv1alpha1.AddToScheme, networksecurityv1beta1.AddToScheme, diff --git a/pkg/clients/generated/client/clientset/versioned/scheme/register.go b/pkg/clients/generated/client/clientset/versioned/scheme/register.go index 3ebd795e3f..81f254fc96 100644 --- a/pkg/clients/generated/client/clientset/versioned/scheme/register.go +++ b/pkg/clients/generated/client/clientset/versioned/scheme/register.go @@ -99,6 +99,7 @@ import ( memcachev1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/memcache/v1beta1" mlenginev1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/mlengine/v1alpha1" monitoringv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/monitoring/v1beta1" + networkconnectivityv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/networkconnectivity/v1alpha1" networkconnectivityv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/networkconnectivity/v1beta1" networkmanagementv1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/networkmanagement/v1alpha1" networksecurityv1beta1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/networksecurity/v1beta1" @@ -228,6 +229,7 @@ var localSchemeBuilder = runtime.SchemeBuilder{ memcachev1beta1.AddToScheme, mlenginev1alpha1.AddToScheme, monitoringv1beta1.AddToScheme, + networkconnectivityv1alpha1.AddToScheme, networkconnectivityv1beta1.AddToScheme, networkmanagementv1alpha1.AddToScheme, networksecurityv1beta1.AddToScheme, diff --git a/pkg/clients/generated/client/clientset/versioned/typed/networkconnectivity/v1alpha1/doc.go b/pkg/clients/generated/client/clientset/versioned/typed/networkconnectivity/v1alpha1/doc.go new file mode 100644 index 0000000000..d3dac805d0 --- /dev/null +++ b/pkg/clients/generated/client/clientset/versioned/typed/networkconnectivity/v1alpha1/doc.go @@ -0,0 +1,23 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// *** DISCLAIMER *** +// Config Connector's go-client for CRDs is currently in ALPHA, which means +// that future versions of the go-client may include breaking changes. +// Please try it out and give us feedback! + +// Code generated by client-gen. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1alpha1 diff --git a/pkg/clients/generated/client/clientset/versioned/typed/networkconnectivity/v1alpha1/fake/doc.go b/pkg/clients/generated/client/clientset/versioned/typed/networkconnectivity/v1alpha1/fake/doc.go new file mode 100644 index 0000000000..dfbe79f9af --- /dev/null +++ b/pkg/clients/generated/client/clientset/versioned/typed/networkconnectivity/v1alpha1/fake/doc.go @@ -0,0 +1,23 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// *** DISCLAIMER *** +// Config Connector's go-client for CRDs is currently in ALPHA, which means +// that future versions of the go-client may include breaking changes. +// Please try it out and give us feedback! + +// Code generated by client-gen. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/pkg/clients/generated/client/clientset/versioned/typed/networkconnectivity/v1alpha1/fake/fake_networkconnectivity_client.go b/pkg/clients/generated/client/clientset/versioned/typed/networkconnectivity/v1alpha1/fake/fake_networkconnectivity_client.go new file mode 100644 index 0000000000..d13373b7c0 --- /dev/null +++ b/pkg/clients/generated/client/clientset/versioned/typed/networkconnectivity/v1alpha1/fake/fake_networkconnectivity_client.go @@ -0,0 +1,43 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// *** DISCLAIMER *** +// Config Connector's go-client for CRDs is currently in ALPHA, which means +// that future versions of the go-client may include breaking changes. +// Please try it out and give us feedback! + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/typed/networkconnectivity/v1alpha1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeNetworkconnectivityV1alpha1 struct { + *testing.Fake +} + +func (c *FakeNetworkconnectivityV1alpha1) NetworkConnectivityServiceConnectionPolicies(namespace string) v1alpha1.NetworkConnectivityServiceConnectionPolicyInterface { + return &FakeNetworkConnectivityServiceConnectionPolicies{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeNetworkconnectivityV1alpha1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/pkg/clients/generated/client/clientset/versioned/typed/networkconnectivity/v1alpha1/fake/fake_networkconnectivityserviceconnectionpolicy.go b/pkg/clients/generated/client/clientset/versioned/typed/networkconnectivity/v1alpha1/fake/fake_networkconnectivityserviceconnectionpolicy.go new file mode 100644 index 0000000000..d30f6485b7 --- /dev/null +++ b/pkg/clients/generated/client/clientset/versioned/typed/networkconnectivity/v1alpha1/fake/fake_networkconnectivityserviceconnectionpolicy.go @@ -0,0 +1,144 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// *** DISCLAIMER *** +// Config Connector's go-client for CRDs is currently in ALPHA, which means +// that future versions of the go-client may include breaking changes. +// Please try it out and give us feedback! + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/networkconnectivity/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeNetworkConnectivityServiceConnectionPolicies implements NetworkConnectivityServiceConnectionPolicyInterface +type FakeNetworkConnectivityServiceConnectionPolicies struct { + Fake *FakeNetworkconnectivityV1alpha1 + ns string +} + +var networkconnectivityserviceconnectionpoliciesResource = v1alpha1.SchemeGroupVersion.WithResource("networkconnectivityserviceconnectionpolicies") + +var networkconnectivityserviceconnectionpoliciesKind = v1alpha1.SchemeGroupVersion.WithKind("NetworkConnectivityServiceConnectionPolicy") + +// Get takes name of the networkConnectivityServiceConnectionPolicy, and returns the corresponding networkConnectivityServiceConnectionPolicy object, and an error if there is any. +func (c *FakeNetworkConnectivityServiceConnectionPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.NetworkConnectivityServiceConnectionPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(networkconnectivityserviceconnectionpoliciesResource, c.ns, name), &v1alpha1.NetworkConnectivityServiceConnectionPolicy{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.NetworkConnectivityServiceConnectionPolicy), err +} + +// List takes label and field selectors, and returns the list of NetworkConnectivityServiceConnectionPolicies that match those selectors. +func (c *FakeNetworkConnectivityServiceConnectionPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.NetworkConnectivityServiceConnectionPolicyList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(networkconnectivityserviceconnectionpoliciesResource, networkconnectivityserviceconnectionpoliciesKind, c.ns, opts), &v1alpha1.NetworkConnectivityServiceConnectionPolicyList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.NetworkConnectivityServiceConnectionPolicyList{ListMeta: obj.(*v1alpha1.NetworkConnectivityServiceConnectionPolicyList).ListMeta} + for _, item := range obj.(*v1alpha1.NetworkConnectivityServiceConnectionPolicyList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested networkConnectivityServiceConnectionPolicies. +func (c *FakeNetworkConnectivityServiceConnectionPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(networkconnectivityserviceconnectionpoliciesResource, c.ns, opts)) + +} + +// Create takes the representation of a networkConnectivityServiceConnectionPolicy and creates it. Returns the server's representation of the networkConnectivityServiceConnectionPolicy, and an error, if there is any. +func (c *FakeNetworkConnectivityServiceConnectionPolicies) Create(ctx context.Context, networkConnectivityServiceConnectionPolicy *v1alpha1.NetworkConnectivityServiceConnectionPolicy, opts v1.CreateOptions) (result *v1alpha1.NetworkConnectivityServiceConnectionPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(networkconnectivityserviceconnectionpoliciesResource, c.ns, networkConnectivityServiceConnectionPolicy), &v1alpha1.NetworkConnectivityServiceConnectionPolicy{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.NetworkConnectivityServiceConnectionPolicy), err +} + +// Update takes the representation of a networkConnectivityServiceConnectionPolicy and updates it. Returns the server's representation of the networkConnectivityServiceConnectionPolicy, and an error, if there is any. +func (c *FakeNetworkConnectivityServiceConnectionPolicies) Update(ctx context.Context, networkConnectivityServiceConnectionPolicy *v1alpha1.NetworkConnectivityServiceConnectionPolicy, opts v1.UpdateOptions) (result *v1alpha1.NetworkConnectivityServiceConnectionPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(networkconnectivityserviceconnectionpoliciesResource, c.ns, networkConnectivityServiceConnectionPolicy), &v1alpha1.NetworkConnectivityServiceConnectionPolicy{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.NetworkConnectivityServiceConnectionPolicy), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeNetworkConnectivityServiceConnectionPolicies) UpdateStatus(ctx context.Context, networkConnectivityServiceConnectionPolicy *v1alpha1.NetworkConnectivityServiceConnectionPolicy, opts v1.UpdateOptions) (*v1alpha1.NetworkConnectivityServiceConnectionPolicy, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(networkconnectivityserviceconnectionpoliciesResource, "status", c.ns, networkConnectivityServiceConnectionPolicy), &v1alpha1.NetworkConnectivityServiceConnectionPolicy{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.NetworkConnectivityServiceConnectionPolicy), err +} + +// Delete takes name of the networkConnectivityServiceConnectionPolicy and deletes it. Returns an error if one occurs. +func (c *FakeNetworkConnectivityServiceConnectionPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(networkconnectivityserviceconnectionpoliciesResource, c.ns, name, opts), &v1alpha1.NetworkConnectivityServiceConnectionPolicy{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeNetworkConnectivityServiceConnectionPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(networkconnectivityserviceconnectionpoliciesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha1.NetworkConnectivityServiceConnectionPolicyList{}) + return err +} + +// Patch applies the patch and returns the patched networkConnectivityServiceConnectionPolicy. +func (c *FakeNetworkConnectivityServiceConnectionPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.NetworkConnectivityServiceConnectionPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(networkconnectivityserviceconnectionpoliciesResource, c.ns, name, pt, data, subresources...), &v1alpha1.NetworkConnectivityServiceConnectionPolicy{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.NetworkConnectivityServiceConnectionPolicy), err +} diff --git a/pkg/clients/generated/client/clientset/versioned/typed/networkconnectivity/v1alpha1/generated_expansion.go b/pkg/clients/generated/client/clientset/versioned/typed/networkconnectivity/v1alpha1/generated_expansion.go new file mode 100644 index 0000000000..63b667c1e1 --- /dev/null +++ b/pkg/clients/generated/client/clientset/versioned/typed/networkconnectivity/v1alpha1/generated_expansion.go @@ -0,0 +1,24 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// *** DISCLAIMER *** +// Config Connector's go-client for CRDs is currently in ALPHA, which means +// that future versions of the go-client may include breaking changes. +// Please try it out and give us feedback! + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +type NetworkConnectivityServiceConnectionPolicyExpansion interface{} diff --git a/pkg/clients/generated/client/clientset/versioned/typed/networkconnectivity/v1alpha1/networkconnectivity_client.go b/pkg/clients/generated/client/clientset/versioned/typed/networkconnectivity/v1alpha1/networkconnectivity_client.go new file mode 100644 index 0000000000..cb6c871695 --- /dev/null +++ b/pkg/clients/generated/client/clientset/versioned/typed/networkconnectivity/v1alpha1/networkconnectivity_client.go @@ -0,0 +1,110 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// *** DISCLAIMER *** +// Config Connector's go-client for CRDs is currently in ALPHA, which means +// that future versions of the go-client may include breaking changes. +// Please try it out and give us feedback! + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "net/http" + + v1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/networkconnectivity/v1alpha1" + "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/scheme" + rest "k8s.io/client-go/rest" +) + +type NetworkconnectivityV1alpha1Interface interface { + RESTClient() rest.Interface + NetworkConnectivityServiceConnectionPoliciesGetter +} + +// NetworkconnectivityV1alpha1Client is used to interact with features provided by the networkconnectivity.cnrm.cloud.google.com group. +type NetworkconnectivityV1alpha1Client struct { + restClient rest.Interface +} + +func (c *NetworkconnectivityV1alpha1Client) NetworkConnectivityServiceConnectionPolicies(namespace string) NetworkConnectivityServiceConnectionPolicyInterface { + return newNetworkConnectivityServiceConnectionPolicies(c, namespace) +} + +// NewForConfig creates a new NetworkconnectivityV1alpha1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*NetworkconnectivityV1alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new NetworkconnectivityV1alpha1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*NetworkconnectivityV1alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &NetworkconnectivityV1alpha1Client{client}, nil +} + +// NewForConfigOrDie creates a new NetworkconnectivityV1alpha1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *NetworkconnectivityV1alpha1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new NetworkconnectivityV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *NetworkconnectivityV1alpha1Client { + return &NetworkconnectivityV1alpha1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1alpha1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *NetworkconnectivityV1alpha1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/pkg/clients/generated/client/clientset/versioned/typed/networkconnectivity/v1alpha1/networkconnectivityserviceconnectionpolicy.go b/pkg/clients/generated/client/clientset/versioned/typed/networkconnectivity/v1alpha1/networkconnectivityserviceconnectionpolicy.go new file mode 100644 index 0000000000..d85cc3560f --- /dev/null +++ b/pkg/clients/generated/client/clientset/versioned/typed/networkconnectivity/v1alpha1/networkconnectivityserviceconnectionpolicy.go @@ -0,0 +1,198 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// *** DISCLAIMER *** +// Config Connector's go-client for CRDs is currently in ALPHA, which means +// that future versions of the go-client may include breaking changes. +// Please try it out and give us feedback! + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + "time" + + v1alpha1 "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/apis/networkconnectivity/v1alpha1" + scheme "github.com/GoogleCloudPlatform/k8s-config-connector/pkg/clients/generated/client/clientset/versioned/scheme" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" +) + +// NetworkConnectivityServiceConnectionPoliciesGetter has a method to return a NetworkConnectivityServiceConnectionPolicyInterface. +// A group's client should implement this interface. +type NetworkConnectivityServiceConnectionPoliciesGetter interface { + NetworkConnectivityServiceConnectionPolicies(namespace string) NetworkConnectivityServiceConnectionPolicyInterface +} + +// NetworkConnectivityServiceConnectionPolicyInterface has methods to work with NetworkConnectivityServiceConnectionPolicy resources. +type NetworkConnectivityServiceConnectionPolicyInterface interface { + Create(ctx context.Context, networkConnectivityServiceConnectionPolicy *v1alpha1.NetworkConnectivityServiceConnectionPolicy, opts v1.CreateOptions) (*v1alpha1.NetworkConnectivityServiceConnectionPolicy, error) + Update(ctx context.Context, networkConnectivityServiceConnectionPolicy *v1alpha1.NetworkConnectivityServiceConnectionPolicy, opts v1.UpdateOptions) (*v1alpha1.NetworkConnectivityServiceConnectionPolicy, error) + UpdateStatus(ctx context.Context, networkConnectivityServiceConnectionPolicy *v1alpha1.NetworkConnectivityServiceConnectionPolicy, opts v1.UpdateOptions) (*v1alpha1.NetworkConnectivityServiceConnectionPolicy, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.NetworkConnectivityServiceConnectionPolicy, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.NetworkConnectivityServiceConnectionPolicyList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.NetworkConnectivityServiceConnectionPolicy, err error) + NetworkConnectivityServiceConnectionPolicyExpansion +} + +// networkConnectivityServiceConnectionPolicies implements NetworkConnectivityServiceConnectionPolicyInterface +type networkConnectivityServiceConnectionPolicies struct { + client rest.Interface + ns string +} + +// newNetworkConnectivityServiceConnectionPolicies returns a NetworkConnectivityServiceConnectionPolicies +func newNetworkConnectivityServiceConnectionPolicies(c *NetworkconnectivityV1alpha1Client, namespace string) *networkConnectivityServiceConnectionPolicies { + return &networkConnectivityServiceConnectionPolicies{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the networkConnectivityServiceConnectionPolicy, and returns the corresponding networkConnectivityServiceConnectionPolicy object, and an error if there is any. +func (c *networkConnectivityServiceConnectionPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.NetworkConnectivityServiceConnectionPolicy, err error) { + result = &v1alpha1.NetworkConnectivityServiceConnectionPolicy{} + err = c.client.Get(). + Namespace(c.ns). + Resource("networkconnectivityserviceconnectionpolicies"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of NetworkConnectivityServiceConnectionPolicies that match those selectors. +func (c *networkConnectivityServiceConnectionPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.NetworkConnectivityServiceConnectionPolicyList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.NetworkConnectivityServiceConnectionPolicyList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("networkconnectivityserviceconnectionpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested networkConnectivityServiceConnectionPolicies. +func (c *networkConnectivityServiceConnectionPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("networkconnectivityserviceconnectionpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a networkConnectivityServiceConnectionPolicy and creates it. Returns the server's representation of the networkConnectivityServiceConnectionPolicy, and an error, if there is any. +func (c *networkConnectivityServiceConnectionPolicies) Create(ctx context.Context, networkConnectivityServiceConnectionPolicy *v1alpha1.NetworkConnectivityServiceConnectionPolicy, opts v1.CreateOptions) (result *v1alpha1.NetworkConnectivityServiceConnectionPolicy, err error) { + result = &v1alpha1.NetworkConnectivityServiceConnectionPolicy{} + err = c.client.Post(). + Namespace(c.ns). + Resource("networkconnectivityserviceconnectionpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(networkConnectivityServiceConnectionPolicy). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a networkConnectivityServiceConnectionPolicy and updates it. Returns the server's representation of the networkConnectivityServiceConnectionPolicy, and an error, if there is any. +func (c *networkConnectivityServiceConnectionPolicies) Update(ctx context.Context, networkConnectivityServiceConnectionPolicy *v1alpha1.NetworkConnectivityServiceConnectionPolicy, opts v1.UpdateOptions) (result *v1alpha1.NetworkConnectivityServiceConnectionPolicy, err error) { + result = &v1alpha1.NetworkConnectivityServiceConnectionPolicy{} + err = c.client.Put(). + Namespace(c.ns). + Resource("networkconnectivityserviceconnectionpolicies"). + Name(networkConnectivityServiceConnectionPolicy.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(networkConnectivityServiceConnectionPolicy). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *networkConnectivityServiceConnectionPolicies) UpdateStatus(ctx context.Context, networkConnectivityServiceConnectionPolicy *v1alpha1.NetworkConnectivityServiceConnectionPolicy, opts v1.UpdateOptions) (result *v1alpha1.NetworkConnectivityServiceConnectionPolicy, err error) { + result = &v1alpha1.NetworkConnectivityServiceConnectionPolicy{} + err = c.client.Put(). + Namespace(c.ns). + Resource("networkconnectivityserviceconnectionpolicies"). + Name(networkConnectivityServiceConnectionPolicy.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(networkConnectivityServiceConnectionPolicy). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the networkConnectivityServiceConnectionPolicy and deletes it. Returns an error if one occurs. +func (c *networkConnectivityServiceConnectionPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("networkconnectivityserviceconnectionpolicies"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *networkConnectivityServiceConnectionPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("networkconnectivityserviceconnectionpolicies"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched networkConnectivityServiceConnectionPolicy. +func (c *networkConnectivityServiceConnectionPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.NetworkConnectivityServiceConnectionPolicy, err error) { + result = &v1alpha1.NetworkConnectivityServiceConnectionPolicy{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("networkconnectivityserviceconnectionpolicies"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/tests/apichecks/crds_test.go b/tests/apichecks/crds_test.go index 8fd3cb13cc..404a4c65b3 100644 --- a/tests/apichecks/crds_test.go +++ b/tests/apichecks/crds_test.go @@ -49,7 +49,7 @@ func TestMissingRefs(t *testing.T) { if strings.HasSuffix(fieldPath, "Ref") { return } - if strings.HasSuffix(fieldPath, "Refs[]") { + if strings.HasSuffix(fieldPath, "Refs[]") || strings.HasSuffix(fieldPath, "Refs") { return } if strings.HasSuffix(fieldPath, "Ref.external") {