models

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIKey

type APIKey struct {
	Name      string            `json:"name"`
	Role      Role              `json:"role"`
	Type      datastore.KeyType `json:"key_type"`
	ExpiresAt time.Time         `json:"expires_at"`
}

type APIKeyByIDResponse

type APIKeyByIDResponse struct {
	UID       string             `json:"uid"`
	Name      string             `json:"name"`
	Role      auth.Role          `json:"role"`
	Type      datastore.KeyType  `json:"key_type"`
	ExpiresAt primitive.DateTime `json:"expires_at,omitempty"`
	CreatedAt primitive.DateTime `json:"created_at,omitempty"`
	UpdatedAt primitive.DateTime `json:"updated_at,omitempty"`
	DeletedAt primitive.DateTime `json:"deleted_at,omitempty"`
}

type APIKeyResponse

type APIKeyResponse struct {
	APIKey
	Key       string    `json:"key"`
	UID       string    `json:"uid"`
	UserID    string    `json:"user_id,omitempty"`
	CreatedAt time.Time `json:"created_at"`
}

type Application

type Application struct {
	AppName         string `json:"name" bson:"name" valid:"required~please provide your appName"`
	SupportEmail    string `json:"support_email" bson:"support_email" valid:"email~please provide a valid email"`
	IsDisabled      bool   `json:"is_disabled"`
	SlackWebhookURL string `json:"slack_webhook_url" bson:"slack_webhook_url"`
}

type Configuration added in v0.6.0

type Configuration struct {
	IsAnalyticsEnabled *bool                                 `json:"is_analytics_enabled"`
	IsSignupEnabled    *bool                                 `json:"is_signup_enabled"`
	StoragePolicy      *datastore.StoragePolicyConfiguration `json:"storage_policy"`
}

type ConfigurationResponse added in v0.6.0

type ConfigurationResponse struct {
	UID                string                                `json:"uid"`
	IsAnalyticsEnabled bool                                  `json:"is_analytics_enabled"`
	IsSignupEnabled    bool                                  `json:"is_signup_enabled"`
	ApiVersion         string                                `json:"api_version"`
	StoragePolicy      *datastore.StoragePolicyConfiguration `json:"storage_policy"`

	CreatedAt primitive.DateTime `json:"created_at,omitempty"`
	UpdatedAt primitive.DateTime `json:"updated_at,omitempty"`
	DeletedAt primitive.DateTime `json:"deleted_at,omitempty"`
}

type CreateAppApiKey added in v0.7.0

type CreateAppApiKey struct {
	Group      *datastore.Group
	App        *datastore.Application
	Name       string `json:"name"`
	BaseUrl    string
	KeyType    datastore.KeyType `json:"key_type"`
	Expiration int               `json:"expiration"`
}

type CreateGroupResponse added in v0.6.0

type CreateGroupResponse struct {
	APIKey *APIKeyResponse  `json:"api_key"`
	Group  *datastore.Group `json:"group"`
}

type DashboardSummary

type DashboardSummary struct {
	EventsSent   uint64                     `json:"events_sent" bson:"events_sent"`
	Applications int                        `json:"apps" bson:"apps"`
	Period       string                     `json:"period" bson:"period"`
	PeriodData   *[]datastore.EventInterval `json:"event_data,omitempty" bson:"event_data"`
}

type DeliveryAttempt

type DeliveryAttempt struct {
	MessageID  string `json:"msg_id" bson:"msg_id"`
	APIVersion string `json:"api_version" bson:"api_version"`
	IPAddress  string `json:"ip" bson:"ip"`

	Status    string `json:"status" bson:"status"`
	CreatedAt int64  `json:"created_at" bson:"created_at"`

	MessageResponse MessageResponse `json:"response" bson:"response"`
}

type Endpoint

type Endpoint struct {
	URL                string   `json:"url" bson:"url"`
	Description        string   `json:"description" bson:"description"`
	Events             []string `json:"events" bson:"events"`
	AdvancedSignatures *bool    `json:"advanced_signatures" bson:"advanced_signatures"`
	Secret             string   `json:"secret" bson:"secret"`

	HttpTimeout       string                            `json:"http_timeout" bson:"http_timeout"`
	RateLimit         int                               `json:"rate_limit" bson:"rate_limit"`
	RateLimitDuration string                            `json:"rate_limit_duration" bson:"rate_limit_duration"`
	Authentication    *datastore.EndpointAuthentication `json:"authentication"`
}

type Event

type Event struct {
	AppID     string `json:"app_id" bson:"app_id" valid:"required~please provide an app id"`
	EventType string `json:"event_type" bson:"event_type" valid:"required~please provide an event type"`

	// Data is an arbitrary JSON value that gets sent as the body of the
	// webhook to the endpoints
	Data          json.RawMessage   `json:"data" bson:"data" valid:"required~please provide your data"`
	CustomHeaders map[string]string `json:"custom_headers"`
}

type ExpireSecret added in v0.7.2

type ExpireSecret struct {
	Secret     string `json:"secret"`
	Expiration int    `json:"expiration"`
}

type ForgotPassword added in v0.6.0

type ForgotPassword struct {
	Email string `json:"email" valid:"required~please provide an email,email"`
}

type Group

type Group struct {
	Name              string                 `json:"name" bson:"name" valid:"required~please provide a valid name"`
	Type              datastore.GroupType    `json:"type" bson:"type" valid:"required~please provide a valid type,in(incoming|outgoing)"`
	LogoURL           string                 `json:"logo_url" bson:"logo_url" valid:"url~please provide a valid logo url,optional"`
	RateLimit         int                    `json:"rate_limit" bson:"rate_limit" valid:"int~please provide a valid rate limit,optional"`
	RateLimitDuration string                 `json:"rate_limit_duration" bson:"rate_limit_duration" valid:"alphanum~please provide a valid rate limit duration,optional"`
	Config            *datastore.GroupConfig `json:"config"`
}

type IDs

type IDs struct {
	IDs []string `json:"ids"`
}

type LoginUser added in v0.6.0

type LoginUser struct {
	Username string `json:"username" valid:"required~please provide your username"`
	Password string `json:"password" valid:"required~please provide your password"`
}

type LoginUserResponse added in v0.6.0

type LoginUserResponse struct {
	UID       string `json:"uid"`
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name"`
	Email     string `json:"email"`
	Token     Token  `json:"token"`

	CreatedAt primitive.DateTime `json:"created_at,omitempty" bson:"created_at"`
	UpdatedAt primitive.DateTime `json:"updated_at,omitempty" bson:"updated_at"`
	DeletedAt primitive.DateTime `json:"deleted_at,omitempty" bson:"deleted_at"`
}

type MessageResponse

type MessageResponse struct {
	Status int             `json:"status" bson:"status"`
	Data   json.RawMessage `json:"data" bson:"data"`
}

type Organisation added in v0.1.0

type Organisation struct {
	Name string `json:"name" bson:"name" valid:"required~please provide a valid name"`
}

type OrganisationInvite added in v0.6.0

type OrganisationInvite struct {
	InviteeEmail string    `json:"invitee_email" valid:"required~please provide a valid invitee email,email"`
	Role         auth.Role `json:"role" bson:"role"`
}

type PersonalAPIKey added in v0.7.0

type PersonalAPIKey struct {
	Name       string `json:"name"`
	Expiration int    `json:"expiration"`
}

type PortalAPIKeyResponse added in v0.4.10

type PortalAPIKeyResponse struct {
	Key     string    `json:"key"`
	Role    auth.Role `json:"role"`
	Url     string    `json:"url,omitempty"`
	Type    string    `json:"key_type"`
	AppID   string    `json:"app_id,omitempty"`
	GroupID string    `json:"group_id,omitempty"`
}

type RegisterUser added in v0.6.5

type RegisterUser struct {
	FirstName        string `json:"first_name" valid:"required~please provide a first name"`
	LastName         string `json:"last_name" valid:"required~please provide a last name"`
	Email            string `json:"email" valid:"required~please provide an email,email"`
	Password         string `json:"password" valid:"required~please provide a password"`
	OrganisationName string `json:"org_name" valid:"required~please provide an organisation name"`
}

type ResetPassword added in v0.6.0

type ResetPassword struct {
	Password             string `json:"password" valid:"required~please provide the password field"`
	PasswordConfirmation string `json:"password_confirmation" valid:"required~please provide the password confirmation field"`
}

type RetryConfiguration added in v0.7.0

type RetryConfiguration struct {
	Type            datastore.StrategyProvider `json:"type,omitempty" valid:"supported_retry_strategy~please provide a valid retry strategy type"`
	Duration        string                     `json:"duration,omitempty" valid:"duration~please provide a valid time duration"`
	IntervalSeconds uint64                     `json:"interval_seconds" valid:"int~please provide a valid interval seconds"`
	RetryCount      uint64                     `json:"retry_count" valid:"int~please provide a valid retry count"`
}

type Role added in v0.6.0

type Role struct {
	Type  auth.RoleType `json:"type"`
	Group string        `json:"group"`
	App   string        `json:"app,omitempty"`
}

type Source added in v0.6.0

type Source struct {
	Name       string                   `json:"name" valid:"required~please provide a source name"`
	Type       datastore.SourceType     `json:"type" valid:"required~please provide a type,supported_source~unsupported source type"`
	Provider   datastore.SourceProvider `json:"provider"`
	IsDisabled bool                     `json:"is_disabled"`
	Verifier   datastore.VerifierConfig `json:"verifier" valid:"required~please provide a verifier"`
}

type SourceResponse added in v0.6.0

type SourceResponse struct {
	UID            string                    `json:"uid"`
	MaskID         string                    `json:"mask_id"`
	GroupID        string                    `json:"group_id"`
	Name           string                    `json:"name"`
	Type           datastore.SourceType      `json:"type"`
	URL            string                    `json:"url"`
	IsDisabled     bool                      `json:"is_disabled"`
	Verifier       *datastore.VerifierConfig `json:"verifier"`
	Provider       datastore.SourceProvider  `json:"provider"`
	ProviderConfig *datastore.ProviderConfig `json:"provider_config"`

	CreatedAt primitive.DateTime `json:"created_at,omitempty"`
	UpdatedAt primitive.DateTime `json:"updated_at,omitempty"`
	DeletedAt primitive.DateTime `json:"deleted_at,omitempty"`
}

type Subscription added in v0.6.0

type Subscription struct {
	Name       string `json:"name" bson:"name" valid:"required~please provide a valid subscription name"`
	AppID      string `json:"app_id" bson:"app_id" valid:"required~please provide a valid app id"`
	SourceID   string `json:"source_id" bson:"source_id"`
	EndpointID string `json:"endpoint_id" bson:"endpoint_id" valid:"required~please provide a valid endpoint id"`

	AlertConfig     *datastore.AlertConfiguration     `json:"alert_config,omitempty" bson:"alert_config,omitempty"`
	RetryConfig     *RetryConfiguration               `json:"retry_config,omitempty" bson:"retry_config,omitempty"`
	FilterConfig    *datastore.FilterConfiguration    `json:"filter_config,omitempty" bson:"filter_config,omitempty"`
	RateLimitConfig *datastore.RateLimitConfiguration `json:"rate_limit_config,omitempty" bson:"rate_limit_config,omitempty"`
	DisableEndpoint *bool                             `json:"disable_endpoint" bson:"disable_endpoint"`
}

type Token added in v0.6.0

type Token struct {
	AccessToken  string `json:"access_token" valid:"required~please provide an access token"`
	RefreshToken string `json:"refresh_token" valid:"required~please provide a refresh token"`
}

type UpdateApplication added in v0.5.0

type UpdateApplication struct {
	AppName         *string `json:"name" bson:"name" valid:"required~please provide your appName"`
	SupportEmail    *string `json:"support_email" bson:"support_email" valid:"email~please provide a valid email"`
	IsDisabled      *bool   `json:"is_disabled"`
	SlackWebhookURL *string `json:"slack_webhook_url" bson:"slack_webhook_url"`
}

type UpdateGroup added in v0.6.0

type UpdateGroup struct {
	Name              string                 `json:"name" bson:"name" valid:"required~please provide a valid name"`
	LogoURL           string                 `json:"logo_url" bson:"logo_url" valid:"url~please provide a valid logo url,optional"`
	RateLimit         int                    `json:"rate_limit" bson:"rate_limit" valid:"int~please provide a valid rate limit,optional"`
	RateLimitDuration string                 `json:"rate_limit_duration" bson:"rate_limit_duration" valid:"alphanum~please provide a valid rate limit duration,optional"`
	Config            *datastore.GroupConfig `json:"config" valid:"optional"`
}

type UpdateOrganisationMember added in v0.6.0

type UpdateOrganisationMember struct {
	Role auth.Role `json:"role" bson:"role"`
}

type UpdatePassword added in v0.6.0

type UpdatePassword struct {
	CurrentPassword      string `json:"current_password" valid:"required~please provide the current password"`
	Password             string `json:"password" valid:"required~please provide the password field"`
	PasswordConfirmation string `json:"password_confirmation" valid:"required~please provide the password confirmation field"`
}

type UpdateSource added in v0.6.0

type UpdateSource struct {
	Name           *string                  `json:"name" valid:"required~please provide a source name"`
	Type           datastore.SourceType     `json:"type" valid:"required~please provide a type,supported_source~unsupported source type"`
	IsDisabled     *bool                    `json:"is_disabled"`
	ForwardHeaders []string                 `json:"forward_headers"`
	Verifier       datastore.VerifierConfig `json:"verifier" valid:"required~please provide a verifier"`
}

type UpdateSubscription added in v0.6.0

type UpdateSubscription struct {
	Name       string `json:"name,omitempty"`
	AppID      string `json:"app_id,omitempty"`
	SourceID   string `json:"source_id,omitempty"`
	EndpointID string `json:"endpoint_id,omitempty"`

	AlertConfig     *datastore.AlertConfiguration     `json:"alert_config,omitempty"`
	RetryConfig     *RetryConfiguration               `json:"retry_config,omitempty"`
	FilterConfig    *datastore.FilterConfiguration    `json:"filter_config,omitempty"`
	RateLimitConfig *datastore.RateLimitConfiguration `json:"rate_limit_config,omitempty"`
	DisableEndpoint *bool                             `json:"disable_endpoint" bson:"disable_endpoint"`
}

type UpdateUser added in v0.6.0

type UpdateUser struct {
	FirstName string `json:"first_name" valid:"required~please provide a first name"`
	LastName  string `json:"last_name" valid:"required~please provide a last name"`
	Email     string `json:"email" valid:"required~please provide an email,email"`
}

type User added in v0.6.0

type User struct {
	FirstName string    `json:"first_name" valid:"required~please provide a first name"`
	LastName  string    `json:"last_name" valid:"required~please provide a last name"`
	Email     string    `json:"email" valid:"required~please provide an email,email"`
	Password  string    `json:"password" valid:"required~please provide a password"`
	Role      auth.Role `json:"role" bson:"role"`
}

type UserExists added in v0.6.0

type UserExists struct {
	Email string `json:"email" valid:"required~please provide an email,email"`
}

type UserInviteTokenResponse added in v0.6.0

type UserInviteTokenResponse struct {
	Token *datastore.OrganisationInvite `json:"token"`
	User  *datastore.User               `json:"user"`
}

type WebhookRequest

type WebhookRequest struct {
	Event string          `json:"event" bson:"event"`
	Data  json.RawMessage `json:"data" bson:"data"`
}

Jump to

Keyboard shortcuts

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