v1

package
v0.81.2 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

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

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 = 0
	// APIPatchVersion contains patch version of this API
	APIPatchVersion = 2
)

Variables

View Source
var (
	ErrInvalidLengthNotification        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowNotification          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupNotification = fmt.Errorf("proto: unexpected end of group")
)

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"`
	// 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"`
	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 (*ListDeploymentNotificationsRequest) GetReadOnly added in v0.71.4

func (m *ListDeploymentNotificationsRequest) GetReadOnly() bool

func (*ListDeploymentNotificationsRequest) GetUnreadOnly added in v0.71.4

func (m *ListDeploymentNotificationsRequest) GetUnreadOnly() bool

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 (*ListDeploymentNotificationsRequest) Size

func (*ListDeploymentNotificationsRequest) 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 (*ListDeploymentNotificationsRequest) XXX_Size

func (*ListDeploymentNotificationsRequest) XXX_Unmarshal

func (m *ListDeploymentNotificationsRequest) XXX_Unmarshal(b []byte) error

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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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

func (*MarkNotificationRequest) Descriptor added in v0.71.4

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

func (*MarkNotificationRequest) GetNotificationId added in v0.71.4

func (m *MarkNotificationRequest) GetNotificationId() string

func (*MarkNotificationRequest) Marshal added in v0.71.4

func (m *MarkNotificationRequest) Marshal() (dAtA []byte, err error)

func (*MarkNotificationRequest) MarshalTo added in v0.71.4

func (m *MarkNotificationRequest) MarshalTo(dAtA []byte) (int, error)

func (*MarkNotificationRequest) MarshalToSizedBuffer added in v0.71.4

func (m *MarkNotificationRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MarkNotificationRequest) ProtoMessage added in v0.71.4

func (*MarkNotificationRequest) ProtoMessage()

func (*MarkNotificationRequest) Reset added in v0.71.4

func (m *MarkNotificationRequest) Reset()

func (*MarkNotificationRequest) Size added in v0.71.4

func (m *MarkNotificationRequest) Size() (n int)

func (*MarkNotificationRequest) String added in v0.71.4

func (m *MarkNotificationRequest) String() string

func (*MarkNotificationRequest) Unmarshal added in v0.71.4

func (m *MarkNotificationRequest) Unmarshal(dAtA []byte) error

func (*MarkNotificationRequest) XXX_DiscardUnknown added in v0.71.4

func (m *MarkNotificationRequest) XXX_DiscardUnknown()

func (*MarkNotificationRequest) XXX_Marshal added in v0.71.4

func (m *MarkNotificationRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MarkNotificationRequest) XXX_Merge added in v0.71.4

func (m *MarkNotificationRequest) XXX_Merge(src proto.Message)

func (*MarkNotificationRequest) XXX_Size added in v0.71.4

func (m *MarkNotificationRequest) XXX_Size() int

func (*MarkNotificationRequest) XXX_Unmarshal added in v0.71.4

func (m *MarkNotificationRequest) 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"`
	// 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"`
	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) GetIsRead added in v0.71.4

func (m *Notification) GetIsRead() bool

func (*Notification) GetReadAt added in v0.71.4

func (m *Notification) GetReadAt() *Notification_ReadAt

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) MarshalTo

func (m *Notification) MarshalTo(dAtA []byte) (int, 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) MarshalTo

func (m *NotificationList) MarshalTo(dAtA []byte) (int, 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)
	// 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.

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)
	// 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 *types.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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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

func (*Notification_ReadAt) Descriptor added in v0.71.4

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

func (*Notification_ReadAt) GetReadAt added in v0.71.4

func (m *Notification_ReadAt) GetReadAt() *types.Timestamp

func (*Notification_ReadAt) GetReadById added in v0.71.4

func (m *Notification_ReadAt) GetReadById() string

func (*Notification_ReadAt) Marshal added in v0.71.4

func (m *Notification_ReadAt) Marshal() (dAtA []byte, err error)

func (*Notification_ReadAt) MarshalTo added in v0.71.4

func (m *Notification_ReadAt) MarshalTo(dAtA []byte) (int, error)

func (*Notification_ReadAt) MarshalToSizedBuffer added in v0.71.4

func (m *Notification_ReadAt) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Notification_ReadAt) ProtoMessage added in v0.71.4

func (*Notification_ReadAt) ProtoMessage()

func (*Notification_ReadAt) Reset added in v0.71.4

func (m *Notification_ReadAt) Reset()

func (*Notification_ReadAt) Size added in v0.71.4

func (m *Notification_ReadAt) Size() (n int)

func (*Notification_ReadAt) String added in v0.71.4

func (m *Notification_ReadAt) String() string

func (*Notification_ReadAt) Unmarshal added in v0.71.4

func (m *Notification_ReadAt) Unmarshal(dAtA []byte) error

func (*Notification_ReadAt) XXX_DiscardUnknown added in v0.71.4

func (m *Notification_ReadAt) XXX_DiscardUnknown()

func (*Notification_ReadAt) XXX_Marshal added in v0.71.4

func (m *Notification_ReadAt) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Notification_ReadAt) XXX_Merge added in v0.71.4

func (m *Notification_ReadAt) XXX_Merge(src proto.Message)

func (*Notification_ReadAt) XXX_Size added in v0.71.4

func (m *Notification_ReadAt) XXX_Size() int

func (*Notification_ReadAt) XXX_Unmarshal added in v0.71.4

func (m *Notification_ReadAt) XXX_Unmarshal(b []byte) error

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