| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 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 |
|
| 31 |
|
| 32 |
|
| 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 |
|
| 42 |
|
| 43 |
|
| 44 |
type PromotionsServiceClient interface { |
| 45 |
|
| 46 |
|
| 47 |
InsertPromotion(ctx context.Context, in *InsertPromotionRequest, opts ...grpc.CallOption) (*Promotion, error) |
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
GetPromotion(ctx context.Context, in *GetPromotionRequest, opts ...grpc.CallOption) (*Promotion, error) |
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 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 |
|
| 98 |
|
| 99 |
|
| 100 |
type PromotionsServiceServer interface { |
| 101 |
|
| 102 |
|
| 103 |
InsertPromotion(context.Context, *InsertPromotionRequest) (*Promotion, error) |
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
GetPromotion(context.Context, *GetPromotionRequest) (*Promotion, error) |
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
ListPromotions(context.Context, *ListPromotionsRequest) (*ListPromotionsResponse, error) |
| 116 |
} |
| 117 |
|
| 118 |
|
| 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 |
|
| 133 |
|
| 134 |
|
| 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 |
|
| 198 |
|
| 199 |
|
| 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 |
} |