v1

package
v0.89.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package v1 contains the API of notifications.

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (

	// PermissionDeploymentNotificationList is required to list deployment's Notifications
	PermissionDeploymentNotificationList = "notification.deployment-notification.list"
	// PermissionNotificationMarkAsRead is required to mark notification as read
	PermissionNotificationMarkAsRead = "notification.deployment-notification.mark-as-read"
	// PermissionNotificationMarkAsUnread is required to mark notification as unread
	PermissionNotificationMarkAsUnread = "notification.deployment-notification.mark-as-unread"
)
View Source
const (
	NotificationTypeEmail = "email"
	NotificationTypeSMS   = "sms"
)
View Source
const (
	// APIID contains identifier of this API
	APIID = "notification/v1"
	// APIMajorVersion contains major version of this API
	APIMajorVersion = 1
	// APIMinorVersion contains minor version of this API
	APIMinorVersion = 1
	// APIPatchVersion contains patch version of this API
	APIPatchVersion = 0
)

Variables

View Source
var File_notification_proto protoreflect.FileDescriptor

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. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterNotificationServiceHandlerFromEndpoint instead.

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"`
	// Get only read notifications
	ReadOnly bool `protobuf:"varint,3,opt,name=read_only,json=readOnly,proto3" json:"read_only,omitempty"`
	// Get only unread notifications
	UnreadOnly bool `protobuf:"varint,4,opt,name=unread_only,json=unreadOnly,proto3" json:"unread_only,omitempty"`
	// contains filtered or unexported fields
}

ListDeploymentNotificationsRequest is used to request a list of Notifications for given deployment.

func (*ListDeploymentNotificationsRequest) Descriptor deprecated

func (*ListDeploymentNotificationsRequest) Descriptor() ([]byte, []int)

Deprecated: Use ListDeploymentNotificationsRequest.ProtoReflect.Descriptor instead.

func (*ListDeploymentNotificationsRequest) GetDeploymentId

func (x *ListDeploymentNotificationsRequest) GetDeploymentId() string

func (*ListDeploymentNotificationsRequest) GetOptions

func (*ListDeploymentNotificationsRequest) GetReadOnly added in v0.71.4

func (x *ListDeploymentNotificationsRequest) GetReadOnly() bool

func (*ListDeploymentNotificationsRequest) GetUnreadOnly added in v0.71.4

func (x *ListDeploymentNotificationsRequest) GetUnreadOnly() bool

func (*ListDeploymentNotificationsRequest) ProtoMessage

func (*ListDeploymentNotificationsRequest) ProtoMessage()

func (*ListDeploymentNotificationsRequest) ProtoReflect added in v0.89.0

func (*ListDeploymentNotificationsRequest) Reset

func (*ListDeploymentNotificationsRequest) String

type MarkNotificationRequest added in v0.71.4

type MarkNotificationRequest struct {

	// Identifier of notification that has to be marked
	NotificationId string `protobuf:"bytes,1,opt,name=notification_id,json=notificationId,proto3" json:"notification_id,omitempty"`
	// contains filtered or unexported fields
}

MarkNotificationRequest is used to mark notifications for given deployment as Read/Unread

func (*MarkNotificationRequest) Descriptor deprecated added in v0.71.4

func (*MarkNotificationRequest) Descriptor() ([]byte, []int)

Deprecated: Use MarkNotificationRequest.ProtoReflect.Descriptor instead.

func (*MarkNotificationRequest) GetNotificationId added in v0.71.4

func (x *MarkNotificationRequest) GetNotificationId() string

func (*MarkNotificationRequest) ProtoMessage added in v0.71.4

func (*MarkNotificationRequest) ProtoMessage()

func (*MarkNotificationRequest) ProtoReflect added in v0.89.0

func (x *MarkNotificationRequest) ProtoReflect() protoreflect.Message

func (*MarkNotificationRequest) Reset added in v0.71.4

func (x *MarkNotificationRequest) Reset()

func (*MarkNotificationRequest) String added in v0.71.4

func (x *MarkNotificationRequest) String() string

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 *timestamppb.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"`
	// If the message is not marked as read this field is empty
	ReadAt *Notification_ReadAt `protobuf:"bytes,7,opt,name=read_at,json=readAt,proto3" json:"read_at,omitempty"`
	// If set this message was marked as read
	IsRead bool `protobuf:"varint,8,opt,name=is_read,json=isRead,proto3" json:"is_read,omitempty"`
	// contains filtered or unexported fields
}

Notification contains all attributes of a notification. All fields in this message are read-only.

func (*Notification) Descriptor deprecated

func (*Notification) Descriptor() ([]byte, []int)

Deprecated: Use Notification.ProtoReflect.Descriptor instead.

func (*Notification) GetContent

func (x *Notification) GetContent() []*NotificationContent

func (*Notification) GetCreatedAt

func (x *Notification) GetCreatedAt() *timestamppb.Timestamp

func (*Notification) GetId

func (x *Notification) GetId() string

func (*Notification) GetIsRead added in v0.71.4

func (x *Notification) GetIsRead() bool

func (*Notification) GetReadAt added in v0.71.4

func (x *Notification) GetReadAt() *Notification_ReadAt

func (*Notification) GetRecipients

func (x *Notification) GetRecipients() []string

func (*Notification) GetTitle

func (x *Notification) GetTitle() string

func (*Notification) GetType

func (x *Notification) GetType() string

func (*Notification) ProtoMessage

func (*Notification) ProtoMessage()

func (*Notification) ProtoReflect added in v0.89.0

func (x *Notification) ProtoReflect() protoreflect.Message

func (*Notification) Reset

func (x *Notification) Reset()

func (*Notification) String

func (x *Notification) String() string

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"`
	// contains filtered or unexported fields
}

NotificationContent holds content and it's mime type. All fields in this message are read-only.

func (*NotificationContent) Descriptor deprecated

func (*NotificationContent) Descriptor() ([]byte, []int)

Deprecated: Use NotificationContent.ProtoReflect.Descriptor instead.

func (*NotificationContent) GetContent

func (x *NotificationContent) GetContent() string

func (*NotificationContent) GetContentType

func (x *NotificationContent) GetContentType() string

func (*NotificationContent) ProtoMessage

func (*NotificationContent) ProtoMessage()

func (*NotificationContent) ProtoReflect added in v0.89.0

func (x *NotificationContent) ProtoReflect() protoreflect.Message

func (*NotificationContent) Reset

func (x *NotificationContent) Reset()

func (*NotificationContent) String

func (x *NotificationContent) String() string

type NotificationList

type NotificationList struct {

	// Notification items.
	Items []*Notification `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
	// contains filtered or unexported fields
}

NotificationList contains a list of Notification items.

func (*NotificationList) Descriptor deprecated

func (*NotificationList) Descriptor() ([]byte, []int)

Deprecated: Use NotificationList.ProtoReflect.Descriptor instead.

func (*NotificationList) GetItems

func (x *NotificationList) GetItems() []*Notification

func (*NotificationList) ProtoMessage

func (*NotificationList) ProtoMessage()

func (*NotificationList) ProtoReflect added in v0.89.0

func (x *NotificationList) ProtoReflect() protoreflect.Message

func (*NotificationList) Reset

func (x *NotificationList) Reset()

func (*NotificationList) String

func (x *NotificationList) String() string

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)
	// Mark notification related to given deployment as read.
	// Required permissions:
	// - notification.deployment-notification.mark-as-read on the deployment associated with the notification identified by notification_id
	MarkNotificationAsRead(ctx context.Context, in *MarkNotificationRequest, opts ...grpc.CallOption) (*v1.Empty, error)
	// Mark notification related to given deployment as unread.
	// Required permissions:
	// - notification.deployment-notification.mark-as-unread on the deployment associated with the notification identified by notification_id
	MarkNotificationAsUnread(ctx context.Context, in *MarkNotificationRequest, opts ...grpc.CallOption) (*v1.Empty, 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.

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)
	// Mark notification related to given deployment as read.
	// Required permissions:
	// - notification.deployment-notification.mark-as-read on the deployment associated with the notification identified by notification_id
	MarkNotificationAsRead(context.Context, *MarkNotificationRequest) (*v1.Empty, error)
	// Mark notification related to given deployment as unread.
	// Required permissions:
	// - notification.deployment-notification.mark-as-unread on the deployment associated with the notification identified by notification_id
	MarkNotificationAsUnread(context.Context, *MarkNotificationRequest) (*v1.Empty, error)
}

NotificationServiceServer is the server API for NotificationService service.

type Notification_ReadAt added in v0.71.4

type Notification_ReadAt struct {

	// When the notification was marked as read
	ReadAt *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=read_at,json=readAt,proto3" json:"read_at,omitempty"`
	// Identifier of user who marked message as read
	ReadById string `protobuf:"bytes,2,opt,name=read_by_id,json=readById,proto3" json:"read_by_id,omitempty"`
	// contains filtered or unexported fields
}

Details about notification read. All fields in this message are read-only.

func (*Notification_ReadAt) Descriptor deprecated added in v0.71.4

func (*Notification_ReadAt) Descriptor() ([]byte, []int)

Deprecated: Use Notification_ReadAt.ProtoReflect.Descriptor instead.

func (*Notification_ReadAt) GetReadAt added in v0.71.4

func (x *Notification_ReadAt) GetReadAt() *timestamppb.Timestamp

func (*Notification_ReadAt) GetReadById added in v0.71.4

func (x *Notification_ReadAt) GetReadById() string

func (*Notification_ReadAt) ProtoMessage added in v0.71.4

func (*Notification_ReadAt) ProtoMessage()

func (*Notification_ReadAt) ProtoReflect added in v0.89.0

func (x *Notification_ReadAt) ProtoReflect() protoreflect.Message

func (*Notification_ReadAt) Reset added in v0.71.4

func (x *Notification_ReadAt) Reset()

func (*Notification_ReadAt) String added in v0.71.4

func (x *Notification_ReadAt) String() string

type UnimplementedNotificationServiceServer

type UnimplementedNotificationServiceServer struct {
}

UnimplementedNotificationServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedNotificationServiceServer) GetAPIVersion

func (*UnimplementedNotificationServiceServer) ListDeploymentNotifications

func (*UnimplementedNotificationServiceServer) MarkNotificationAsRead added in v0.71.4

func (*UnimplementedNotificationServiceServer) MarkNotificationAsUnread added in v0.71.4

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL