Debian Codegraph @

shopping/merchant/promotions/apiv1beta/promotionspb/promotions_grpc.pb.go

raw symbols SCIP
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/shopping/merchant/promotions/v1beta/promotions.proto
20
21 package promotionspb
22
23 import (
24 context "context"
25 grpc "google.golang.org/grpc"
26 codes "google.golang.org/grpc/codes"
27 status "google.golang.org/grpc/status"
28 )
29
30 // This is a compile-time assertion to ensure that this generated file
31 // is compatible with the grpc package it is being compiled against.
32 // Requires gRPC-Go v1.32.0 or later.
33 const _ = grpc.SupportPackageIsVersion7
34
35 const (
36 PromotionsService_InsertPromotion_FullMethodName = "/google.shopping.merchant.promotions.v1beta.PromotionsService/InsertPromotion"
37 PromotionsService_GetPromotion_FullMethodName = "/google.shopping.merchant.promotions.v1beta.PromotionsService/GetPromotion"
38 PromotionsService_ListPromotions_FullMethodName = "/google.shopping.merchant.promotions.v1beta.PromotionsService/ListPromotions"
39 )
40
41 // PromotionsServiceClient is the client API for PromotionsService service.
42 //
43 // 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.
44 type PromotionsServiceClient interface {
45 // Inserts a promotion for your Merchant Center account. If the promotion
46 // already exists, then it updates the promotion instead.
47 InsertPromotion(ctx context.Context, in *InsertPromotionRequest, opts ...grpc.CallOption) (*Promotion, error)
48 // Retrieves the promotion from your Merchant Center account.
49 //
50 // After inserting or updating a promotion input, it may take several
51 // minutes before the updated promotion can be retrieved.
52 GetPromotion(ctx context.Context, in *GetPromotionRequest, opts ...grpc.CallOption) (*Promotion, error)
53 // Lists the promotions in your Merchant Center account. The
54 // response might contain fewer items than specified by `pageSize`. Rely on
55 // `pageToken` to determine if there are more items to be requested.
56 //
57 // After inserting or updating a promotion, it may take several minutes before
58 // the updated processed promotion can be retrieved.
59 ListPromotions(ctx context.Context, in *ListPromotionsRequest, opts ...grpc.CallOption) (*ListPromotionsResponse, error)
60 }
61
62 type promotionsServiceClient struct {
63 cc grpc.ClientConnInterface
64 }
65
66 func NewPromotionsServiceClient(cc grpc.ClientConnInterface) PromotionsServiceClient {
67 return &promotionsServiceClient{cc}
68 }
69
70 func (c *promotionsServiceClient) InsertPromotion(ctx context.Context, in *InsertPromotionRequest, opts ...grpc.CallOption) (*Promotion, error) {
71 out := new(Promotion)
72 err := c.cc.Invoke(ctx, PromotionsService_InsertPromotion_FullMethodName, in, out, opts...)
73 if err != nil {
74 return nil, err
75 }
76 return out, nil
77 }
78
79 func (c *promotionsServiceClient) GetPromotion(ctx context.Context, in *GetPromotionRequest, opts ...grpc.CallOption) (*Promotion, error) {
80 out := new(Promotion)
81 err := c.cc.Invoke(ctx, PromotionsService_GetPromotion_FullMethodName, in, out, opts...)
82 if err != nil {
83 return nil, err
84 }
85 return out, nil
86 }
87
88 func (c *promotionsServiceClient) ListPromotions(ctx context.Context, in *ListPromotionsRequest, opts ...grpc.CallOption) (*ListPromotionsResponse, error) {
89 out := new(ListPromotionsResponse)
90 err := c.cc.Invoke(ctx, PromotionsService_ListPromotions_FullMethodName, in, out, opts...)
91 if err != nil {
92 return nil, err
93 }
94 return out, nil
95 }
96
97 // PromotionsServiceServer is the server API for PromotionsService service.
98 // All implementations should embed UnimplementedPromotionsServiceServer
99 // for forward compatibility
100 type PromotionsServiceServer interface {
101 // Inserts a promotion for your Merchant Center account. If the promotion
102 // already exists, then it updates the promotion instead.
103 InsertPromotion(context.Context, *InsertPromotionRequest) (*Promotion, error)
104 // Retrieves the promotion from your Merchant Center account.
105 //
106 // After inserting or updating a promotion input, it may take several
107 // minutes before the updated promotion can be retrieved.
108 GetPromotion(context.Context, *GetPromotionRequest) (*Promotion, error)
109 // Lists the promotions in your Merchant Center account. The
110 // response might contain fewer items than specified by `pageSize`. Rely on
111 // `pageToken` to determine if there are more items to be requested.
112 //
113 // After inserting or updating a promotion, it may take several minutes before
114 // the updated processed promotion can be retrieved.
115 ListPromotions(context.Context, *ListPromotionsRequest) (*ListPromotionsResponse, error)
116 }
117
118 // UnimplementedPromotionsServiceServer should be embedded to have forward compatible implementations.
119 type UnimplementedPromotionsServiceServer struct {
120 }
121
122 func (UnimplementedPromotionsServiceServer) InsertPromotion(context.Context, *InsertPromotionRequest) (*Promotion, error) {
123 return nil, status.Errorf(codes.Unimplemented, "method InsertPromotion not implemented")
124 }
125 func (UnimplementedPromotionsServiceServer) GetPromotion(context.Context, *GetPromotionRequest) (*Promotion, error) {
126 return nil, status.Errorf(codes.Unimplemented, "method GetPromotion not implemented")
127 }
128 func (UnimplementedPromotionsServiceServer) ListPromotions(context.Context, *ListPromotionsRequest) (*ListPromotionsResponse, error) {
129 return nil, status.Errorf(codes.Unimplemented, "method ListPromotions not implemented")
130 }
131
132 // UnsafePromotionsServiceServer may be embedded to opt out of forward compatibility for this service.
133 // Use of this interface is not recommended, as added methods to PromotionsServiceServer will
134 // result in compilation errors.
135 type UnsafePromotionsServiceServer interface {
136 mustEmbedUnimplementedPromotionsServiceServer()
137 }
138
139 func RegisterPromotionsServiceServer(s grpc.ServiceRegistrar, srv PromotionsServiceServer) {
140 s.RegisterService(&PromotionsService_ServiceDesc, srv)
141 }
142
143 func _PromotionsService_InsertPromotion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
144 in := new(InsertPromotionRequest)
145 if err := dec(in); err != nil {
146 return nil, err
147 }
148 if interceptor == nil {
149 return srv.(PromotionsServiceServer).InsertPromotion(ctx, in)
150 }
151 info := &grpc.UnaryServerInfo{
152 Server: srv,
153 FullMethod: PromotionsService_InsertPromotion_FullMethodName,
154 }
155 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
156 return srv.(PromotionsServiceServer).InsertPromotion(ctx, req.(*InsertPromotionRequest))
157 }
158 return interceptor(ctx, in, info, handler)
159 }
160
161 func _PromotionsService_GetPromotion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
162 in := new(GetPromotionRequest)
163 if err := dec(in); err != nil {
164 return nil, err
165 }
166 if interceptor == nil {
167 return srv.(PromotionsServiceServer).GetPromotion(ctx, in)
168 }
169 info := &grpc.UnaryServerInfo{
170 Server: srv,
171 FullMethod: PromotionsService_GetPromotion_FullMethodName,
172 }
173 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
174 return srv.(PromotionsServiceServer).GetPromotion(ctx, req.(*GetPromotionRequest))
175 }
176 return interceptor(ctx, in, info, handler)
177 }
178
179 func _PromotionsService_ListPromotions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
180 in := new(ListPromotionsRequest)
181 if err := dec(in); err != nil {
182 return nil, err
183 }
184 if interceptor == nil {
185 return srv.(PromotionsServiceServer).ListPromotions(ctx, in)
186 }
187 info := &grpc.UnaryServerInfo{
188 Server: srv,
189 FullMethod: PromotionsService_ListPromotions_FullMethodName,
190 }
191 handler := func(ctx context.Context, req interface{}) (interface{}, error) {
192 return srv.(PromotionsServiceServer).ListPromotions(ctx, req.(*ListPromotionsRequest))
193 }
194 return interceptor(ctx, in, info, handler)
195 }
196
197 // PromotionsService_ServiceDesc is the grpc.ServiceDesc for PromotionsService service.
198 // It's only intended for direct use with grpc.RegisterService,
199 // and not to be introspected or modified (even as a copy)
200 var PromotionsService_ServiceDesc = grpc.ServiceDesc{
201 ServiceName: "google.shopping.merchant.promotions.v1beta.PromotionsService",
202 HandlerType: (*PromotionsServiceServer)(nil),
203 Methods: []grpc.MethodDesc{
204 {
205 MethodName: "InsertPromotion",
206 Handler: _PromotionsService_InsertPromotion_Handler,
207 },
208 {
209 MethodName: "GetPromotion",
210 Handler: _PromotionsService_GetPromotion_Handler,
211 },
212 {
213 MethodName: "ListPromotions",
214 Handler: _PromotionsService_ListPromotions_Handler,
215 },
216 },
217 Streams: []grpc.StreamDesc{},
218 Metadata: "google/shopping/merchant/promotions/v1beta/promotions.proto",
219 }