Documentation
¶
Overview ¶
Package openapi provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version (devel) DO NOT EDIT.
Index ¶
- type CustomNotifications
- type EmailSubscription
- type Notification
- type NotificationMessage
- type NotificationMethodSupports
- type NotificationPreferences
- type NotificationType
- type PushDeviceID
- type PushInfo
- type PushSubscription
- type UserUpdateNotificationPreferencesJSONBody
- type UserUpdateNotificationPreferencesJSONRequestBody
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CustomNotifications ¶
type CustomNotifications map[string]NotificationMessage
CustomNotifications Custom notifications that the user can override with. The object keys are the notification types.
type EmailSubscription ¶
type EmailSubscription struct {
// Address The email address to send the notification to. This email address will appear in the `To` field of the email.
Address openapi_types.Email `json:"address"`
// Name The name of the user to send the email to. This name will be used with the email address in the `To` field.
Name *string `json:"name,omitempty"`
}
EmailSubscription defines model for EmailSubscription.
type Notification ¶
type Notification struct {
// Type The type of notification:
// - `welcome_message` is sent to welcome the user. Realistically, it is
// used as a test message.
// - `reminder_message` is sent to remind the user of their hormone dose.
// - `account_notice_message` is sent to notify the user that they need
// to check their account.
// - `web_push_expiring_message` is sent to notify the user that their
// web push subscription is expiring.
// - `test_message` is sent to test your notification settings.
Type NotificationType `json:"type"`
// Message The message of the notification.
Message NotificationMessage `json:"message"`
// Username The username of the user to send the notification to.
Username string `json:"username"`
}
Notification defines model for Notification.
type NotificationMessage ¶
type NotificationMessage struct {
// Title The title of the notification.
Title string `json:"title"`
// Message The message of the notification.
Message string `json:"message"`
}
NotificationMessage The message of the notification. This is derived from the notification type but can be overridden by the user.
type NotificationMethodSupports ¶
type NotificationMethodSupports = []string
NotificationMethodSupports A list of notification methods that the server supports.
type NotificationPreferences ¶
type NotificationPreferences struct {
CustomNotifications CustomNotifications `json:"customNotifications,omitempty"`
NotificationConfigs struct {
Email *[]EmailSubscription `json:"email,omitempty"`
WebPush *[]PushSubscription `json:"webPush,omitempty"`
} `json:"notificationConfigs"`
}
NotificationPreferences The user's notification preferences. Each key is a notification type and the value is the notification configuration for that type. It may be nil if the server does not support a particular notification type.
type NotificationType ¶
type NotificationType string
NotificationType The type of notification:
- `welcome_message` is sent to welcome the user. Realistically, it is used as a test message.
- `reminder_message` is sent to remind the user of their hormone dose.
- `account_notice_message` is sent to notify the user that they need to check their account.
- `web_push_expiring_message` is sent to notify the user that their web push subscription is expiring.
- `test_message` is sent to test your notification settings.
const ( AccountNoticeMessage NotificationType = "account_notice_message" ReminderMessage NotificationType = "reminder_message" TestMessage NotificationType = "test_message" WebPushExpiringMessage NotificationType = "web_push_expiring_message" WelcomeMessage NotificationType = "welcome_message" )
Defines values for NotificationType.
func (NotificationType) Valid ¶
func (e NotificationType) Valid() bool
Valid indicates whether the value is a known member of the NotificationType enum.
type PushDeviceID ¶
type PushDeviceID = string
PushDeviceID A short ID associated with the device that the push subscription is for This is used to identify the device when updating its push subscription later on. Realistically, this will be handled as an opaque random string generated on the device side, so the server has no way to correlate it with any fingerprinting. The recommended way to generate this string in JavaScript is: ```js crypto.randomUUID().slice(0, 8) ```
type PushInfo ¶
type PushInfo struct {
// ApplicationServerKey A Base64-encoded string or ArrayBuffer containing an ECDSA P-256 public key that the push server will use to authenticate your application server. If specified, all messages from your application server must use the VAPID authentication scheme, and include a JWT signed with the corresponding private key. This key IS NOT the same ECDH key that you use to encrypt the data. For more information, see "Using VAPID with WebPush".
ApplicationServerKey string `json:"applicationServerKey"`
}
PushInfo This is returned by the server and contains information that the client would need to subscribe to push notifications.
type PushSubscription ¶
type PushSubscription struct {
// DeviceID A short ID associated with the device that the push subscription is for This is used to identify the device when updating its push subscription later on.
// Realistically, this will be handled as an opaque random string generated on the device side, so the server has no way to correlate it with any fingerprinting.
// The recommended way to generate this string in JavaScript is:
// “`js crypto.randomUUID().slice(0, 8) “`
DeviceID PushDeviceID `json:"deviceID"`
// Endpoint The endpoint to send the notification to.
Endpoint string `json:"endpoint"`
// ExpirationTime The time at which the subscription expires. This is the time when the subscription will be automatically deleted by the browser.
ExpirationTime time.Time `json:"expirationTime,omitempty"`
// Keys The VAPID keys to encrypt the push notification.
Keys struct {
// P256Dh An Elliptic curve Diffie–Hellman public key on the P-256 curve (that is, the NIST secp256r1 elliptic curve). The resulting key is an uncompressed point in ANSI X9.62 format.
P256Dh string `json:"p256dh"`
// Auth An authentication secret, as described in Message Encryption for Web Push.
Auth string `json:"auth"`
} `json:"keys"`
}
PushSubscription The configuration for a push notification subscription. This is the object that is returned by calling PushSubscription.toJSON(). More information can be found at: https://developer.mozilla.org/en-US/docs/Web/API/PushSubscription/toJSON
type UserUpdateNotificationPreferencesJSONBody ¶
type UserUpdateNotificationPreferencesJSONBody struct {
// UnderscoreCurrent The current notification preferences. This is used to determine whether the notification method update is still valid.
// This field is very much optional and is only used to guard against race conditions.
// TODO: Implement this field.
UnderscoreCurrent *NotificationPreferences `json:"_current,omitempty"`
CustomNotifications CustomNotifications `json:"customNotifications,omitempty"`
NotificationConfigs struct {
Email *[]EmailSubscription `json:"email,omitempty"`
WebPush *[]PushSubscription `json:"webPush,omitempty"`
} `json:"notificationConfigs"`
}
UserUpdateNotificationPreferencesJSONBody defines parameters for UserUpdateNotificationPreferences.
type UserUpdateNotificationPreferencesJSONRequestBody ¶
type UserUpdateNotificationPreferencesJSONRequestBody UserUpdateNotificationPreferencesJSONBody
UserUpdateNotificationPreferencesJSONRequestBody defines body for UserUpdateNotificationPreferences for application/json ContentType.