| 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/notifications/v1beta/notificationsapi.proto |
| 20 |
|
| 21 |
package notificationspb |
| 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 |
emptypb "google.golang.org/protobuf/types/known/emptypb" |
| 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 |
NotificationsApiService_GetNotificationSubscription_FullMethodName = "/google.shopping.merchant.notifications.v1beta.NotificationsApiService/GetNotificationSubscription" |
| 38 |
NotificationsApiService_CreateNotificationSubscription_FullMethodName = "/google.shopping.merchant.notifications.v1beta.NotificationsApiService/CreateNotificationSubscription" |
| 39 |
NotificationsApiService_UpdateNotificationSubscription_FullMethodName = "/google.shopping.merchant.notifications.v1beta.NotificationsApiService/UpdateNotificationSubscription" |
| 40 |
NotificationsApiService_DeleteNotificationSubscription_FullMethodName = "/google.shopping.merchant.notifications.v1beta.NotificationsApiService/DeleteNotificationSubscription" |
| 41 |
NotificationsApiService_ListNotificationSubscriptions_FullMethodName = "/google.shopping.merchant.notifications.v1beta.NotificationsApiService/ListNotificationSubscriptions" |
| 42 |
) |
| 43 |
|
| 44 |
// NotificationsApiServiceClient is the client API for NotificationsApiService service. |
| 45 |
// |
| 46 |
// 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. |
| 47 |
type NotificationsApiServiceClient interface { |
| 48 |
// Gets notification subscriptions for an account. |
| 49 |
GetNotificationSubscription(ctx context.Context, in *GetNotificationSubscriptionRequest, opts ...grpc.CallOption) (*NotificationSubscription, error) |
| 50 |
// Creates a notification subscription for a merchant. We will allow the |
| 51 |
// following types of notification subscriptions to exist together (per |
| 52 |
// merchant as a subscriber per event type): |
| 53 |
// 1. Subscription for all managed accounts + subscription for self |
| 54 |
// 2. Multiple "partial" subscriptions for managed accounts + subscription |
| 55 |
// for self |
| 56 |
// |
| 57 |
// we will not allow (per merchant as a subscriber per event type): |
| 58 |
// 1. multiple self subscriptions. |
| 59 |
// 2. multiple "all managed accounts" subscriptions. |
| 60 |
// 3. all and partial subscriptions at the same time. |
| 61 |
// 4. multiple partial subscriptions for the same target account |
| 62 |
CreateNotificationSubscription(ctx context.Context, in *CreateNotificationSubscriptionRequest, opts ...grpc.CallOption) (*NotificationSubscription, error) |
| 63 |
// Updates an existing notification subscription for a merchant. |
| 64 |
UpdateNotificationSubscription(ctx context.Context, in *UpdateNotificationSubscriptionRequest, opts ...grpc.CallOption) (*NotificationSubscription, error) |
| 65 |
// Deletes a notification subscription for a merchant. |
| 66 |
DeleteNotificationSubscription(ctx context.Context, in *DeleteNotificationSubscriptionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) |
| 67 |
// Gets all the notification subscriptions for a merchant. |
| 68 |
ListNotificationSubscriptions(ctx context.Context, in *ListNotificationSubscriptionsRequest, opts ...grpc.CallOption) (*ListNotificationSubscriptionsResponse, error) |
| 69 |
} |
| 70 |
|
| 71 |
type notificationsApiServiceClient struct { |
| 72 |
cc grpc.ClientConnInterface |
| 73 |
} |
| 74 |
|
| 75 |
func NewNotificationsApiServiceClient(cc grpc.ClientConnInterface) NotificationsApiServiceClient { |
| 76 |
return ¬ificationsApiServiceClient{cc} |
| 77 |
} |
| 78 |
|
| 79 |
func (c *notificationsApiServiceClient) GetNotificationSubscription(ctx context.Context, in *GetNotificationSubscriptionRequest, opts ...grpc.CallOption) (*NotificationSubscription, error) { |
| 80 |
out := new(NotificationSubscription) |
| 81 |
err := c.cc.Invoke(ctx, NotificationsApiService_GetNotificationSubscription_FullMethodName, in, out, opts...) |
| 82 |
if err != nil { |
| 83 |
return nil, err |
| 84 |
} |
| 85 |
return out, nil |
| 86 |
} |
| 87 |
|
| 88 |
func (c *notificationsApiServiceClient) CreateNotificationSubscription(ctx context.Context, in *CreateNotificationSubscriptionRequest, opts ...grpc.CallOption) (*NotificationSubscription, error) { |
| 89 |
out := new(NotificationSubscription) |
| 90 |
err := c.cc.Invoke(ctx, NotificationsApiService_CreateNotificationSubscription_FullMethodName, in, out, opts...) |
| 91 |
if err != nil { |
| 92 |
return nil, err |
| 93 |
} |
| 94 |
return out, nil |
| 95 |
} |
| 96 |
|
| 97 |
func (c *notificationsApiServiceClient) UpdateNotificationSubscription(ctx context.Context, in *UpdateNotificationSubscriptionRequest, opts ...grpc.CallOption) (*NotificationSubscription, error) { |
| 98 |
out := new(NotificationSubscription) |
| 99 |
err := c.cc.Invoke(ctx, NotificationsApiService_UpdateNotificationSubscription_FullMethodName, in, out, opts...) |
| 100 |
if err != nil { |
| 101 |
return nil, err |
| 102 |
} |
| 103 |
return out, nil |
| 104 |
} |
| 105 |
|
| 106 |
func (c *notificationsApiServiceClient) DeleteNotificationSubscription(ctx context.Context, in *DeleteNotificationSubscriptionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { |
| 107 |
out := new(emptypb.Empty) |
| 108 |
err := c.cc.Invoke(ctx, NotificationsApiService_DeleteNotificationSubscription_FullMethodName, in, out, opts...) |
| 109 |
if err != nil { |
| 110 |
return nil, err |
| 111 |
} |
| 112 |
return out, nil |
| 113 |
} |
| 114 |
|
| 115 |
func (c *notificationsApiServiceClient) ListNotificationSubscriptions(ctx context.Context, in *ListNotificationSubscriptionsRequest, opts ...grpc.CallOption) (*ListNotificationSubscriptionsResponse, error) { |
| 116 |
out := new(ListNotificationSubscriptionsResponse) |
| 117 |
err := c.cc.Invoke(ctx, NotificationsApiService_ListNotificationSubscriptions_FullMethodName, in, out, opts...) |
| 118 |
if err != nil { |
| 119 |
return nil, err |
| 120 |
} |
| 121 |
return out, nil |
| 122 |
} |
| 123 |
|
| 124 |
// NotificationsApiServiceServer is the server API for NotificationsApiService service. |
| 125 |
// All implementations should embed UnimplementedNotificationsApiServiceServer |
| 126 |
// for forward compatibility |
| 127 |
type NotificationsApiServiceServer interface { |
| 128 |
// Gets notification subscriptions for an account. |
| 129 |
GetNotificationSubscription(context.Context, *GetNotificationSubscriptionRequest) (*NotificationSubscription, error) |
| 130 |
// Creates a notification subscription for a merchant. We will allow the |
| 131 |
// following types of notification subscriptions to exist together (per |
| 132 |
// merchant as a subscriber per event type): |
| 133 |
// 1. Subscription for all managed accounts + subscription for self |
| 134 |
// 2. Multiple "partial" subscriptions for managed accounts + subscription |
| 135 |
// for self |
| 136 |
// |
| 137 |
// we will not allow (per merchant as a subscriber per event type): |
| 138 |
// 1. multiple self subscriptions. |
| 139 |
// 2. multiple "all managed accounts" subscriptions. |
| 140 |
// 3. all and partial subscriptions at the same time. |
| 141 |
// 4. multiple partial subscriptions for the same target account |
| 142 |
CreateNotificationSubscription(context.Context, *CreateNotificationSubscriptionRequest) (*NotificationSubscription, error) |
| 143 |
// Updates an existing notification subscription for a merchant. |
| 144 |
UpdateNotificationSubscription(context.Context, *UpdateNotificationSubscriptionRequest) (*NotificationSubscription, error) |
| 145 |
// Deletes a notification subscription for a merchant. |
| 146 |
DeleteNotificationSubscription(context.Context, *DeleteNotificationSubscriptionRequest) (*emptypb.Empty, error) |
| 147 |
// Gets all the notification subscriptions for a merchant. |
| 148 |
ListNotificationSubscriptions(context.Context, *ListNotificationSubscriptionsRequest) (*ListNotificationSubscriptionsResponse, error) |
| 149 |
} |
| 150 |
|
| 151 |
// UnimplementedNotificationsApiServiceServer should be embedded to have forward compatible implementations. |
| 152 |
type UnimplementedNotificationsApiServiceServer struct { |
| 153 |
} |
| 154 |
|
| 155 |
func (UnimplementedNotificationsApiServiceServer) GetNotificationSubscription(context.Context, *GetNotificationSubscriptionRequest) (*NotificationSubscription, error) { |
| 156 |
return nil, status.Errorf(codes.Unimplemented, "method GetNotificationSubscription not implemented") |
| 157 |
} |
| 158 |
func (UnimplementedNotificationsApiServiceServer) CreateNotificationSubscription(context.Context, *CreateNotificationSubscriptionRequest) (*NotificationSubscription, error) { |
| 159 |
return nil, status.Errorf(codes.Unimplemented, "method CreateNotificationSubscription not implemented") |
| 160 |
} |
| 161 |
func (UnimplementedNotificationsApiServiceServer) UpdateNotificationSubscription(context.Context, *UpdateNotificationSubscriptionRequest) (*NotificationSubscription, error) { |
| 162 |
return nil, status.Errorf(codes.Unimplemented, "method UpdateNotificationSubscription not implemented") |
| 163 |
} |
| 164 |
func (UnimplementedNotificationsApiServiceServer) DeleteNotificationSubscription(context.Context, *DeleteNotificationSubscriptionRequest) (*emptypb.Empty, error) { |
| 165 |
return nil, status.Errorf(codes.Unimplemented, "method DeleteNotificationSubscription not implemented") |
| 166 |
} |
| 167 |
func (UnimplementedNotificationsApiServiceServer) ListNotificationSubscriptions(context.Context, *ListNotificationSubscriptionsRequest) (*ListNotificationSubscriptionsResponse, error) { |
| 168 |
return nil, status.Errorf(codes.Unimplemented, "method ListNotificationSubscriptions not implemented") |
| 169 |
} |
| 170 |
|
| 171 |
// UnsafeNotificationsApiServiceServer may be embedded to opt out of forward compatibility for this service. |
| 172 |
// Use of this interface is not recommended, as added methods to NotificationsApiServiceServer will |
| 173 |
// result in compilation errors. |
| 174 |
type UnsafeNotificationsApiServiceServer interface { |
| 175 |
mustEmbedUnimplementedNotificationsApiServiceServer() |
| 176 |
} |
| 177 |
|
| 178 |
func RegisterNotificationsApiServiceServer(s grpc.ServiceRegistrar, srv NotificationsApiServiceServer) { |
| 179 |
s.RegisterService(&NotificationsApiService_ServiceDesc, srv) |
| 180 |
} |
| 181 |
|
| 182 |
func _NotificationsApiService_GetNotificationSubscription_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 183 |
in := new(GetNotificationSubscriptionRequest) |
| 184 |
if err := dec(in); err != nil { |
| 185 |
return nil, err |
| 186 |
} |
| 187 |
if interceptor == nil { |
| 188 |
return srv.(NotificationsApiServiceServer).GetNotificationSubscription(ctx, in) |
| 189 |
} |
| 190 |
info := &grpc.UnaryServerInfo{ |
| 191 |
Server: srv, |
| 192 |
FullMethod: NotificationsApiService_GetNotificationSubscription_FullMethodName, |
| 193 |
} |
| 194 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 195 |
return srv.(NotificationsApiServiceServer).GetNotificationSubscription(ctx, req.(*GetNotificationSubscriptionRequest)) |
| 196 |
} |
| 197 |
return interceptor(ctx, in, info, handler) |
| 198 |
} |
| 199 |
|
| 200 |
func _NotificationsApiService_CreateNotificationSubscription_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 201 |
in := new(CreateNotificationSubscriptionRequest) |
| 202 |
if err := dec(in); err != nil { |
| 203 |
return nil, err |
| 204 |
} |
| 205 |
if interceptor == nil { |
| 206 |
return srv.(NotificationsApiServiceServer).CreateNotificationSubscription(ctx, in) |
| 207 |
} |
| 208 |
info := &grpc.UnaryServerInfo{ |
| 209 |
Server: srv, |
| 210 |
FullMethod: NotificationsApiService_CreateNotificationSubscription_FullMethodName, |
| 211 |
} |
| 212 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 213 |
return srv.(NotificationsApiServiceServer).CreateNotificationSubscription(ctx, req.(*CreateNotificationSubscriptionRequest)) |
| 214 |
} |
| 215 |
return interceptor(ctx, in, info, handler) |
| 216 |
} |
| 217 |
|
| 218 |
func _NotificationsApiService_UpdateNotificationSubscription_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 219 |
in := new(UpdateNotificationSubscriptionRequest) |
| 220 |
if err := dec(in); err != nil { |
| 221 |
return nil, err |
| 222 |
} |
| 223 |
if interceptor == nil { |
| 224 |
return srv.(NotificationsApiServiceServer).UpdateNotificationSubscription(ctx, in) |
| 225 |
} |
| 226 |
info := &grpc.UnaryServerInfo{ |
| 227 |
Server: srv, |
| 228 |
FullMethod: NotificationsApiService_UpdateNotificationSubscription_FullMethodName, |
| 229 |
} |
| 230 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 231 |
return srv.(NotificationsApiServiceServer).UpdateNotificationSubscription(ctx, req.(*UpdateNotificationSubscriptionRequest)) |
| 232 |
} |
| 233 |
return interceptor(ctx, in, info, handler) |
| 234 |
} |
| 235 |
|
| 236 |
func _NotificationsApiService_DeleteNotificationSubscription_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 237 |
in := new(DeleteNotificationSubscriptionRequest) |
| 238 |
if err := dec(in); err != nil { |
| 239 |
return nil, err |
| 240 |
} |
| 241 |
if interceptor == nil { |
| 242 |
return srv.(NotificationsApiServiceServer).DeleteNotificationSubscription(ctx, in) |
| 243 |
} |
| 244 |
info := &grpc.UnaryServerInfo{ |
| 245 |
Server: srv, |
| 246 |
FullMethod: NotificationsApiService_DeleteNotificationSubscription_FullMethodName, |
| 247 |
} |
| 248 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 249 |
return srv.(NotificationsApiServiceServer).DeleteNotificationSubscription(ctx, req.(*DeleteNotificationSubscriptionRequest)) |
| 250 |
} |
| 251 |
return interceptor(ctx, in, info, handler) |
| 252 |
} |
| 253 |
|
| 254 |
func _NotificationsApiService_ListNotificationSubscriptions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 255 |
in := new(ListNotificationSubscriptionsRequest) |
| 256 |
if err := dec(in); err != nil { |
| 257 |
return nil, err |
| 258 |
} |
| 259 |
if interceptor == nil { |
| 260 |
return srv.(NotificationsApiServiceServer).ListNotificationSubscriptions(ctx, in) |
| 261 |
} |
| 262 |
info := &grpc.UnaryServerInfo{ |
| 263 |
Server: srv, |
| 264 |
FullMethod: NotificationsApiService_ListNotificationSubscriptions_FullMethodName, |
| 265 |
} |
| 266 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 267 |
return srv.(NotificationsApiServiceServer).ListNotificationSubscriptions(ctx, req.(*ListNotificationSubscriptionsRequest)) |
| 268 |
} |
| 269 |
return interceptor(ctx, in, info, handler) |
| 270 |
} |
| 271 |
|
| 272 |
// NotificationsApiService_ServiceDesc is the grpc.ServiceDesc for NotificationsApiService service. |
| 273 |
// It's only intended for direct use with grpc.RegisterService, |
| 274 |
// and not to be introspected or modified (even as a copy) |
| 275 |
var NotificationsApiService_ServiceDesc = grpc.ServiceDesc{ |
| 276 |
ServiceName: "google.shopping.merchant.notifications.v1beta.NotificationsApiService", |
| 277 |
HandlerType: (*NotificationsApiServiceServer)(nil), |
| 278 |
Methods: []grpc.MethodDesc{ |
| 279 |
{ |
| 280 |
MethodName: "GetNotificationSubscription", |
| 281 |
Handler: _NotificationsApiService_GetNotificationSubscription_Handler, |
| 282 |
}, |
| 283 |
{ |
| 284 |
MethodName: "CreateNotificationSubscription", |
| 285 |
Handler: _NotificationsApiService_CreateNotificationSubscription_Handler, |
| 286 |
}, |
| 287 |
{ |
| 288 |
MethodName: "UpdateNotificationSubscription", |
| 289 |
Handler: _NotificationsApiService_UpdateNotificationSubscription_Handler, |
| 290 |
}, |
| 291 |
{ |
| 292 |
MethodName: "DeleteNotificationSubscription", |
| 293 |
Handler: _NotificationsApiService_DeleteNotificationSubscription_Handler, |
| 294 |
}, |
| 295 |
{ |
| 296 |
MethodName: "ListNotificationSubscriptions", |
| 297 |
Handler: _NotificationsApiService_ListNotificationSubscriptions_Handler, |
| 298 |
}, |
| 299 |
}, |
| 300 |
Streams: []grpc.StreamDesc{}, |
| 301 |
Metadata: "google/shopping/merchant/notifications/v1beta/notificationsapi.proto", |
| 302 |
} |