Documentation ¶
Overview ¶
Package notification/v1 contains the API of notifications.
Package v1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterNotificationServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterNotificationServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NotificationServiceClient) error
- func RegisterNotificationServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterNotificationServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server NotificationServiceServer) error
- func RegisterNotificationServiceServer(s *grpc.Server, srv NotificationServiceServer)
- type ListDeploymentNotificationsRequest
- func (*ListDeploymentNotificationsRequest) Descriptor() ([]byte, []int)
- func (m *ListDeploymentNotificationsRequest) GetDeploymentId() string
- func (m *ListDeploymentNotificationsRequest) GetOptions() *v1.ListOptions
- func (m *ListDeploymentNotificationsRequest) Marshal() (dAtA []byte, err error)
- func (m *ListDeploymentNotificationsRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *ListDeploymentNotificationsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ListDeploymentNotificationsRequest) ProtoMessage()
- func (m *ListDeploymentNotificationsRequest) Reset()
- func (m *ListDeploymentNotificationsRequest) Size() (n int)
- func (m *ListDeploymentNotificationsRequest) String() string
- func (m *ListDeploymentNotificationsRequest) Unmarshal(dAtA []byte) error
- func (m *ListDeploymentNotificationsRequest) XXX_DiscardUnknown()
- func (m *ListDeploymentNotificationsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ListDeploymentNotificationsRequest) XXX_Merge(src proto.Message)
- func (m *ListDeploymentNotificationsRequest) XXX_Size() int
- func (m *ListDeploymentNotificationsRequest) XXX_Unmarshal(b []byte) error
- type Notification
- func (*Notification) Descriptor() ([]byte, []int)
- func (m *Notification) GetContent() []*NotificationContent
- func (m *Notification) GetCreatedAt() *types.Timestamp
- func (m *Notification) GetId() string
- func (m *Notification) GetRecipients() []string
- func (m *Notification) GetTitle() string
- func (m *Notification) GetType() string
- func (m *Notification) Marshal() (dAtA []byte, err error)
- func (m *Notification) MarshalTo(dAtA []byte) (int, error)
- func (m *Notification) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Notification) ProtoMessage()
- func (m *Notification) Reset()
- func (m *Notification) Size() (n int)
- func (m *Notification) String() string
- func (m *Notification) Unmarshal(dAtA []byte) error
- func (m *Notification) XXX_DiscardUnknown()
- func (m *Notification) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Notification) XXX_Merge(src proto.Message)
- func (m *Notification) XXX_Size() int
- func (m *Notification) XXX_Unmarshal(b []byte) error
- type NotificationContent
- func (*NotificationContent) Descriptor() ([]byte, []int)
- func (m *NotificationContent) GetContent() string
- func (m *NotificationContent) GetContentType() string
- func (m *NotificationContent) Marshal() (dAtA []byte, err error)
- func (m *NotificationContent) MarshalTo(dAtA []byte) (int, error)
- func (m *NotificationContent) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*NotificationContent) ProtoMessage()
- func (m *NotificationContent) Reset()
- func (m *NotificationContent) Size() (n int)
- func (m *NotificationContent) String() string
- func (m *NotificationContent) Unmarshal(dAtA []byte) error
- func (m *NotificationContent) XXX_DiscardUnknown()
- func (m *NotificationContent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *NotificationContent) XXX_Merge(src proto.Message)
- func (m *NotificationContent) XXX_Size() int
- func (m *NotificationContent) XXX_Unmarshal(b []byte) error
- type NotificationList
- func (*NotificationList) Descriptor() ([]byte, []int)
- func (m *NotificationList) GetItems() []*Notification
- func (m *NotificationList) Marshal() (dAtA []byte, err error)
- func (m *NotificationList) MarshalTo(dAtA []byte) (int, error)
- func (m *NotificationList) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*NotificationList) ProtoMessage()
- func (m *NotificationList) Reset()
- func (m *NotificationList) Size() (n int)
- func (m *NotificationList) String() string
- func (m *NotificationList) Unmarshal(dAtA []byte) error
- func (m *NotificationList) XXX_DiscardUnknown()
- func (m *NotificationList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *NotificationList) XXX_Merge(src proto.Message)
- func (m *NotificationList) XXX_Size() int
- func (m *NotificationList) XXX_Unmarshal(b []byte) error
- type NotificationServiceClient
- type NotificationServiceServer
- type UnimplementedNotificationServiceServer
Constants ¶
const ( NotificationTypeEmail = "email" NotificationTypeSMS = "sms" )
const ( // APIID contains identifier of this API APIID = "notifications/v1" // APIMajorVersion contains major version of this API APIMajorVersion = 0 // APIMinorVersion contains minor version of this API APIMinorVersion = 1 // APIPatchVersion contains patch version of this API APIPatchVersion = 0 )
const (
// PermissionDeploymentNotificationList is required to list deployment's Notifications
PermissionDeploymentNotificationList = "notification.deployment-notification.list"
)
Variables ¶
var ( ErrInvalidLengthNotification = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowNotification = fmt.Errorf("proto: integer overflow") )
Functions ¶
func RegisterNotificationServiceHandler ¶
func RegisterNotificationServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterNotificationServiceHandler registers the http handlers for service NotificationService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterNotificationServiceHandlerClient ¶
func RegisterNotificationServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client NotificationServiceClient) error
RegisterNotificationServiceHandlerClient registers the http handlers for service NotificationService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "NotificationServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "NotificationServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "NotificationServiceClient" to call the correct interceptors.
func RegisterNotificationServiceHandlerFromEndpoint ¶
func RegisterNotificationServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterNotificationServiceHandlerFromEndpoint is same as RegisterNotificationServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterNotificationServiceHandlerServer ¶
func RegisterNotificationServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server NotificationServiceServer) error
RegisterNotificationServiceHandlerServer registers the http handlers for service NotificationService to "mux". UnaryRPC :call NotificationServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
func RegisterNotificationServiceServer ¶
func RegisterNotificationServiceServer(s *grpc.Server, srv NotificationServiceServer)
Types ¶
type ListDeploymentNotificationsRequest ¶
type ListDeploymentNotificationsRequest struct { // Identifier of the deployment to get a list of notifications for. DeploymentId string `protobuf:"bytes,1,opt,name=deployment_id,json=deploymentId,proto3" json:"deployment_id,omitempty"` // Common listing options. // context_id is a don't care. Options *v1.ListOptions `protobuf:"bytes,2,opt,name=options,proto3" json:"options,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
ListDeploymentNotificationsRequest is used to request a list of Notifications for given deployment.
func (*ListDeploymentNotificationsRequest) Descriptor ¶
func (*ListDeploymentNotificationsRequest) Descriptor() ([]byte, []int)
func (*ListDeploymentNotificationsRequest) GetDeploymentId ¶
func (m *ListDeploymentNotificationsRequest) GetDeploymentId() string
func (*ListDeploymentNotificationsRequest) GetOptions ¶
func (m *ListDeploymentNotificationsRequest) GetOptions() *v1.ListOptions
func (*ListDeploymentNotificationsRequest) Marshal ¶
func (m *ListDeploymentNotificationsRequest) Marshal() (dAtA []byte, err error)
func (*ListDeploymentNotificationsRequest) MarshalTo ¶
func (m *ListDeploymentNotificationsRequest) MarshalTo(dAtA []byte) (int, error)
func (*ListDeploymentNotificationsRequest) MarshalToSizedBuffer ¶
func (m *ListDeploymentNotificationsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ListDeploymentNotificationsRequest) ProtoMessage ¶
func (*ListDeploymentNotificationsRequest) ProtoMessage()
func (*ListDeploymentNotificationsRequest) Reset ¶
func (m *ListDeploymentNotificationsRequest) Reset()
func (*ListDeploymentNotificationsRequest) Size ¶
func (m *ListDeploymentNotificationsRequest) Size() (n int)
func (*ListDeploymentNotificationsRequest) String ¶
func (m *ListDeploymentNotificationsRequest) String() string
func (*ListDeploymentNotificationsRequest) Unmarshal ¶
func (m *ListDeploymentNotificationsRequest) Unmarshal(dAtA []byte) error
func (*ListDeploymentNotificationsRequest) XXX_DiscardUnknown ¶
func (m *ListDeploymentNotificationsRequest) XXX_DiscardUnknown()
func (*ListDeploymentNotificationsRequest) XXX_Marshal ¶
func (m *ListDeploymentNotificationsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ListDeploymentNotificationsRequest) XXX_Merge ¶
func (m *ListDeploymentNotificationsRequest) XXX_Merge(src proto.Message)
func (*ListDeploymentNotificationsRequest) XXX_Size ¶
func (m *ListDeploymentNotificationsRequest) XXX_Size() int
func (*ListDeploymentNotificationsRequest) XXX_Unmarshal ¶
func (m *ListDeploymentNotificationsRequest) XXX_Unmarshal(b []byte) error
type Notification ¶
type Notification struct { // System identifier of the notification Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // Type of notification. // Will be one of following value: "email", "sms". Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` // The creation timestamp of the prepaid deployment. CreatedAt *types.Timestamp `protobuf:"bytes,3,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // Title of notification. Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` // Recipients of notification. // email addresses, phone numbers etc Recipients []string `protobuf:"bytes,5,rep,name=recipients,proto3" json:"recipients,omitempty"` // Content of notification. Content []*NotificationContent `protobuf:"bytes,6,rep,name=content,proto3" json:"content,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
Notification contains all attributes of a notification. All fields in this message are read-only.
func (*Notification) Descriptor ¶
func (*Notification) Descriptor() ([]byte, []int)
func (*Notification) GetContent ¶
func (m *Notification) GetContent() []*NotificationContent
func (*Notification) GetCreatedAt ¶
func (m *Notification) GetCreatedAt() *types.Timestamp
func (*Notification) GetId ¶
func (m *Notification) GetId() string
func (*Notification) GetRecipients ¶
func (m *Notification) GetRecipients() []string
func (*Notification) GetTitle ¶
func (m *Notification) GetTitle() string
func (*Notification) GetType ¶
func (m *Notification) GetType() string
func (*Notification) Marshal ¶
func (m *Notification) Marshal() (dAtA []byte, err error)
func (*Notification) MarshalToSizedBuffer ¶
func (m *Notification) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*Notification) ProtoMessage ¶
func (*Notification) ProtoMessage()
func (*Notification) Reset ¶
func (m *Notification) Reset()
func (*Notification) Size ¶
func (m *Notification) Size() (n int)
func (*Notification) String ¶
func (m *Notification) String() string
func (*Notification) Unmarshal ¶
func (m *Notification) Unmarshal(dAtA []byte) error
func (*Notification) XXX_DiscardUnknown ¶
func (m *Notification) XXX_DiscardUnknown()
func (*Notification) XXX_Marshal ¶
func (m *Notification) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Notification) XXX_Merge ¶
func (m *Notification) XXX_Merge(src proto.Message)
func (*Notification) XXX_Size ¶
func (m *Notification) XXX_Size() int
func (*Notification) XXX_Unmarshal ¶
func (m *Notification) XXX_Unmarshal(b []byte) error
type NotificationContent ¶
type NotificationContent struct { // MIME Type of notification. ContentType string `protobuf:"bytes,1,opt,name=content_type,json=contentType,proto3" json:"content_type,omitempty"` // Content of notification. Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
NotificationContent holds content and it's mime type. All fields in this message are read-only.
func (*NotificationContent) Descriptor ¶
func (*NotificationContent) Descriptor() ([]byte, []int)
func (*NotificationContent) GetContent ¶
func (m *NotificationContent) GetContent() string
func (*NotificationContent) GetContentType ¶
func (m *NotificationContent) GetContentType() string
func (*NotificationContent) Marshal ¶
func (m *NotificationContent) Marshal() (dAtA []byte, err error)
func (*NotificationContent) MarshalTo ¶
func (m *NotificationContent) MarshalTo(dAtA []byte) (int, error)
func (*NotificationContent) MarshalToSizedBuffer ¶
func (m *NotificationContent) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*NotificationContent) ProtoMessage ¶
func (*NotificationContent) ProtoMessage()
func (*NotificationContent) Reset ¶
func (m *NotificationContent) Reset()
func (*NotificationContent) Size ¶
func (m *NotificationContent) Size() (n int)
func (*NotificationContent) String ¶
func (m *NotificationContent) String() string
func (*NotificationContent) Unmarshal ¶
func (m *NotificationContent) Unmarshal(dAtA []byte) error
func (*NotificationContent) XXX_DiscardUnknown ¶
func (m *NotificationContent) XXX_DiscardUnknown()
func (*NotificationContent) XXX_Marshal ¶
func (m *NotificationContent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*NotificationContent) XXX_Merge ¶
func (m *NotificationContent) XXX_Merge(src proto.Message)
func (*NotificationContent) XXX_Size ¶
func (m *NotificationContent) XXX_Size() int
func (*NotificationContent) XXX_Unmarshal ¶
func (m *NotificationContent) XXX_Unmarshal(b []byte) error
type NotificationList ¶
type NotificationList struct { // Notification items. Items []*Notification `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
NotificationList contains a list of Notification items.
func (*NotificationList) Descriptor ¶
func (*NotificationList) Descriptor() ([]byte, []int)
func (*NotificationList) GetItems ¶
func (m *NotificationList) GetItems() []*Notification
func (*NotificationList) Marshal ¶
func (m *NotificationList) Marshal() (dAtA []byte, err error)
func (*NotificationList) MarshalToSizedBuffer ¶
func (m *NotificationList) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*NotificationList) ProtoMessage ¶
func (*NotificationList) ProtoMessage()
func (*NotificationList) Reset ¶
func (m *NotificationList) Reset()
func (*NotificationList) Size ¶
func (m *NotificationList) Size() (n int)
func (*NotificationList) String ¶
func (m *NotificationList) String() string
func (*NotificationList) Unmarshal ¶
func (m *NotificationList) Unmarshal(dAtA []byte) error
func (*NotificationList) XXX_DiscardUnknown ¶
func (m *NotificationList) XXX_DiscardUnknown()
func (*NotificationList) XXX_Marshal ¶
func (m *NotificationList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*NotificationList) XXX_Merge ¶
func (m *NotificationList) XXX_Merge(src proto.Message)
func (*NotificationList) XXX_Size ¶
func (m *NotificationList) XXX_Size() int
func (*NotificationList) XXX_Unmarshal ¶
func (m *NotificationList) XXX_Unmarshal(b []byte) error
type NotificationServiceClient ¶
type NotificationServiceClient interface { // Get the current API version of this service. // Required permissions: // - None GetAPIVersion(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*v1.Version, error) // Fetch all notifications related to given deployment. // Required permissions: // - notification.deployment-notification.list on the deployment identified by given deployment_id ListDeploymentNotifications(ctx context.Context, in *ListDeploymentNotificationsRequest, opts ...grpc.CallOption) (*NotificationList, error) }
NotificationServiceClient is the client API for NotificationService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewNotificationServiceClient ¶
func NewNotificationServiceClient(cc *grpc.ClientConn) NotificationServiceClient
type NotificationServiceServer ¶
type NotificationServiceServer interface { // Get the current API version of this service. // Required permissions: // - None GetAPIVersion(context.Context, *v1.Empty) (*v1.Version, error) // Fetch all notifications related to given deployment. // Required permissions: // - notification.deployment-notification.list on the deployment identified by given deployment_id ListDeploymentNotifications(context.Context, *ListDeploymentNotificationsRequest) (*NotificationList, error) }
NotificationServiceServer is the server API for NotificationService service.
type UnimplementedNotificationServiceServer ¶
type UnimplementedNotificationServiceServer struct { }
UnimplementedNotificationServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedNotificationServiceServer) GetAPIVersion ¶
func (*UnimplementedNotificationServiceServer) ListDeploymentNotifications ¶
func (*UnimplementedNotificationServiceServer) ListDeploymentNotifications(ctx context.Context, req *ListDeploymentNotificationsRequest) (*NotificationList, error)