| 1 |
// Copyright 2025 Google LLC |
| 2 |
// |
| 3 |
// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 |
// you may not use this file except in compliance with the License. |
| 5 |
// You may obtain a copy of the License at |
| 6 |
// |
| 7 |
// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
// |
| 9 |
// Unless required by applicable law or agreed to in writing, software |
| 10 |
// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 |
// See the License for the specific language governing permissions and |
| 13 |
// limitations under the License. |
| 14 |
|
| 15 |
// Code generated by protoc-gen-go-grpc. DO NOT EDIT. |
| 16 |
// versions: |
| 17 |
// - protoc-gen-go-grpc v1.3.0 |
| 18 |
// - protoc v4.25.7 |
| 19 |
// source: google/cloud/alloydb/v1beta/csql_service.proto |
| 20 |
|
| 21 |
package alloydbpb |
| 22 |
|
| 23 |
import ( |
| 24 |
longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" |
| 25 |
context "context" |
| 26 |
grpc "google.golang.org/grpc" |
| 27 |
codes "google.golang.org/grpc/codes" |
| 28 |
status "google.golang.org/grpc/status" |
| 29 |
) |
| 30 |
|
| 31 |
// This is a compile-time assertion to ensure that this generated file |
| 32 |
// is compatible with the grpc package it is being compiled against. |
| 33 |
// Requires gRPC-Go v1.32.0 or later. |
| 34 |
const _ = grpc.SupportPackageIsVersion7 |
| 35 |
|
| 36 |
const ( |
| 37 |
AlloyDBCSQLAdmin_RestoreFromCloudSQL_FullMethodName = "/google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin/RestoreFromCloudSQL" |
| 38 |
) |
| 39 |
|
| 40 |
// AlloyDBCSQLAdminClient is the client API for AlloyDBCSQLAdmin service. |
| 41 |
// |
| 42 |
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. |
| 43 |
type AlloyDBCSQLAdminClient interface { |
| 44 |
// Restores an AlloyDB cluster from a CloudSQL resource. |
| 45 |
RestoreFromCloudSQL(ctx context.Context, in *RestoreFromCloudSQLRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) |
| 46 |
} |
| 47 |
|
| 48 |
type alloyDBCSQLAdminClient struct { |
| 49 |
cc grpc.ClientConnInterface |
| 50 |
} |
| 51 |
|
| 52 |
func NewAlloyDBCSQLAdminClient(cc grpc.ClientConnInterface) AlloyDBCSQLAdminClient { |
| 53 |
return &alloyDBCSQLAdminClient{cc} |
| 54 |
} |
| 55 |
|
| 56 |
func (c *alloyDBCSQLAdminClient) RestoreFromCloudSQL(ctx context.Context, in *RestoreFromCloudSQLRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) { |
| 57 |
out := new(longrunningpb.Operation) |
| 58 |
err := c.cc.Invoke(ctx, AlloyDBCSQLAdmin_RestoreFromCloudSQL_FullMethodName, in, out, opts...) |
| 59 |
if err != nil { |
| 60 |
return nil, err |
| 61 |
} |
| 62 |
return out, nil |
| 63 |
} |
| 64 |
|
| 65 |
// AlloyDBCSQLAdminServer is the server API for AlloyDBCSQLAdmin service. |
| 66 |
// All implementations should embed UnimplementedAlloyDBCSQLAdminServer |
| 67 |
// for forward compatibility |
| 68 |
type AlloyDBCSQLAdminServer interface { |
| 69 |
// Restores an AlloyDB cluster from a CloudSQL resource. |
| 70 |
RestoreFromCloudSQL(context.Context, *RestoreFromCloudSQLRequest) (*longrunningpb.Operation, error) |
| 71 |
} |
| 72 |
|
| 73 |
// UnimplementedAlloyDBCSQLAdminServer should be embedded to have forward compatible implementations. |
| 74 |
type UnimplementedAlloyDBCSQLAdminServer struct { |
| 75 |
} |
| 76 |
|
| 77 |
func (UnimplementedAlloyDBCSQLAdminServer) RestoreFromCloudSQL(context.Context, *RestoreFromCloudSQLRequest) (*longrunningpb.Operation, error) { |
| 78 |
return nil, status.Errorf(codes.Unimplemented, "method RestoreFromCloudSQL not implemented") |
| 79 |
} |
| 80 |
|
| 81 |
// UnsafeAlloyDBCSQLAdminServer may be embedded to opt out of forward compatibility for this service. |
| 82 |
// Use of this interface is not recommended, as added methods to AlloyDBCSQLAdminServer will |
| 83 |
// result in compilation errors. |
| 84 |
type UnsafeAlloyDBCSQLAdminServer interface { |
| 85 |
mustEmbedUnimplementedAlloyDBCSQLAdminServer() |
| 86 |
} |
| 87 |
|
| 88 |
func RegisterAlloyDBCSQLAdminServer(s grpc.ServiceRegistrar, srv AlloyDBCSQLAdminServer) { |
| 89 |
s.RegisterService(&AlloyDBCSQLAdmin_ServiceDesc, srv) |
| 90 |
} |
| 91 |
|
| 92 |
func _AlloyDBCSQLAdmin_RestoreFromCloudSQL_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 93 |
in := new(RestoreFromCloudSQLRequest) |
| 94 |
if err := dec(in); err != nil { |
| 95 |
return nil, err |
| 96 |
} |
| 97 |
if interceptor == nil { |
| 98 |
return srv.(AlloyDBCSQLAdminServer).RestoreFromCloudSQL(ctx, in) |
| 99 |
} |
| 100 |
info := &grpc.UnaryServerInfo{ |
| 101 |
Server: srv, |
| 102 |
FullMethod: AlloyDBCSQLAdmin_RestoreFromCloudSQL_FullMethodName, |
| 103 |
} |
| 104 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 105 |
return srv.(AlloyDBCSQLAdminServer).RestoreFromCloudSQL(ctx, req.(*RestoreFromCloudSQLRequest)) |
| 106 |
} |
| 107 |
return interceptor(ctx, in, info, handler) |
| 108 |
} |
| 109 |
|
| 110 |
// AlloyDBCSQLAdmin_ServiceDesc is the grpc.ServiceDesc for AlloyDBCSQLAdmin service. |
| 111 |
// It's only intended for direct use with grpc.RegisterService, |
| 112 |
// and not to be introspected or modified (even as a copy) |
| 113 |
var AlloyDBCSQLAdmin_ServiceDesc = grpc.ServiceDesc{ |
| 114 |
ServiceName: "google.cloud.alloydb.v1beta.AlloyDBCSQLAdmin", |
| 115 |
HandlerType: (*AlloyDBCSQLAdminServer)(nil), |
| 116 |
Methods: []grpc.MethodDesc{ |
| 117 |
{ |
| 118 |
MethodName: "RestoreFromCloudSQL", |
| 119 |
Handler: _AlloyDBCSQLAdmin_RestoreFromCloudSQL_Handler, |
| 120 |
}, |
| 121 |
}, |
| 122 |
Streams: []grpc.StreamDesc{}, |
| 123 |
Metadata: "google/cloud/alloydb/v1beta/csql_service.proto", |
| 124 |
} |