models

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2023 License: MPL-2.0 Imports: 13 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewListResponse added in v1.1.6

func NewListResponse[T, M any](items []M, fn func(item M) T) []T

NewListResponse is generic function for looping over a slice of type M and returning a slice of type T

Types

type APIKey

type APIKey struct {
	Name      string            `json:"name"`
	Role      Role              `json:"role"`
	Type      datastore.KeyType `json:"key_type"`
	ExpiresAt null.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 null.Time         `json:"expires_at,omitempty"`
	CreatedAt time.Time         `json:"created_at,omitempty"`
	UpdatedAt time.Time         `json:"updated_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 AlertConfiguration added in v1.1.6

type AlertConfiguration struct {
	Count     int    `json:"count"`
	Threshold string `json:"threshold" valid:"duration~please provide a valid time duration"`
}

func (*AlertConfiguration) Transform added in v1.1.6

type ApiKey added in v1.1.6

type ApiKey struct {
	HeaderValue string `json:"header_value" valid:"required"`
	HeaderName  string `json:"header_name" valid:"required"`
}

type BasicAuth added in v1.1.6

type BasicAuth struct {
	UserName string `json:"username" valid:"required" `
	Password string `json:"password" valid:"required"`
}

type Configuration

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

func (*Configuration) Validate added in v1.1.6

func (c *Configuration) Validate() error

type ConfigurationResponse

type ConfigurationResponse struct {
	*datastore.Configuration
	ApiVersion string `json:"api_version"`
}

type CreateEndpoint added in v1.1.6

type CreateEndpoint struct {
	URL                string `json:"url" valid:"required~please provide a url for your endpoint"`
	Secret             string `json:"secret"`
	OwnerID            string `json:"owner_id"`
	Description        string `json:"description"`
	AdvancedSignatures bool   `json:"advanced_signatures"`
	Name               string `json:"name" valid:"required~please provide your endpointName"`
	SupportEmail       string `json:"support_email" valid:"email~please provide a valid email"`
	IsDisabled         bool   `json:"is_disabled"`
	SlackWebhookURL    string `json:"slack_webhook_url"`

	HttpTimeout       string                  `json:"http_timeout"`
	RateLimit         int                     `json:"rate_limit"`
	RateLimitDuration string                  `json:"rate_limit_duration"`
	Authentication    *EndpointAuthentication `json:"authentication"`
	// Deprecated but necessary for backward compatibility
	AppID string
}

func (*CreateEndpoint) Validate added in v1.1.6

func (cE *CreateEndpoint) Validate() error

type CreateEndpointApiKey

type CreateEndpointApiKey struct {
	Project    *datastore.Project
	Endpoint   *datastore.Endpoint
	Name       string `json:"name"`
	BaseUrl    string
	KeyType    datastore.KeyType `json:"key_type"`
	Expiration int               `json:"expiration"`
}

type CreateEvent added in v1.1.6

type CreateEvent struct {
	EndpointID string `json:"endpoint_id"`
	AppID      string `json:"app_id"` // Deprecated but necessary for backward compatibility
	EventType  string `json:"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" valid:"required~please provide your data"`
	CustomHeaders  map[string]string `json:"custom_headers"`
	IdempotencyKey string            `json:"idempotency_key"`
}

func (*CreateEvent) Validate added in v1.1.6

func (e *CreateEvent) Validate() error

type CreateProject added in v1.1.6

type CreateProject struct {
	Name    string         `json:"name" valid:"required~please provide a valid name"`
	Type    string         `json:"type" valid:"required~please provide a valid type,in(incoming|outgoing)"`
	LogoURL string         `json:"logo_url" valid:"url~please provide a valid logo url,optional"`
	Config  *ProjectConfig `json:"config"`
}

func (*CreateProject) Validate added in v1.1.6

func (cP *CreateProject) Validate() error

type CreateProjectResponse

type CreateProjectResponse struct {
	APIKey  *APIKeyResponse  `json:"api_key"`
	Project *ProjectResponse `json:"project"`
}

type CreateSource added in v1.1.6

type CreateSource 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"`
	CustomResponse  CustomResponse           `json:"custom_response"`
	Verifier        VerifierConfig           `json:"verifier"`
	PubSub          PubSubConfig             `json:"pub_sub"`
	IdempotencyKeys []string                 `json:"idempotency_keys"`
	IdempotencyTTL  string                   `json:"idempotency_ttl"`
}

func (*CreateSource) Validate added in v1.1.6

func (cs *CreateSource) Validate() error

type CreateSubscription added in v1.1.6

type CreateSubscription struct {
	Name       string `json:"name" valid:"required~please provide a valid subscription name"`
	SourceID   string `json:"source_id"`
	AppID      string `json:"app_id"` // Deprecated but necessary for backward compatibility
	EndpointID string `json:"endpoint_id" valid:"required~please provide a valid endpoint id"`
	Function   string `json:"function"`

	AlertConfig     *AlertConfiguration     `json:"alert_config,omitempty"`
	RetryConfig     *RetryConfiguration     `json:"retry_config,omitempty"`
	FilterConfig    *FilterConfiguration    `json:"filter_config,omitempty"`
	RateLimitConfig *RateLimitConfiguration `json:"rate_limit_config,omitempty"`
}

func (*CreateSubscription) Validate added in v1.1.6

func (cs *CreateSubscription) Validate() error

type CustomResponse added in v1.1.6

type CustomResponse struct {
	Body        string `json:"body"`
	ContentType string `json:"content_type"`
}

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 DynamicEndpoint added in v1.1.6

type DynamicEndpoint struct {
	URL                string `json:"url" valid:"required~please provide a url for your endpoint"`
	Secret             string `json:"secret"`
	OwnerID            string `json:"owner_id"`
	Description        string `json:"description"`
	AdvancedSignatures bool   `json:"advanced_signatures"`
	Name               string `json:"name"`
	SupportEmail       string `json:"support_email"`
	IsDisabled         bool   `json:"is_disabled"`
	SlackWebhookURL    string `json:"slack_webhook_url"`

	HttpTimeout       string                  `json:"http_timeout"`
	RateLimit         int                     `json:"rate_limit"`
	RateLimitDuration string                  `json:"rate_limit_duration"`
	Authentication    *EndpointAuthentication `json:"authentication"`
	// Deprecated but necessary for backward compatibility
	AppID string
}

func (*DynamicEndpoint) Validate added in v1.1.6

func (dE *DynamicEndpoint) Validate() error

type DynamicEvent added in v1.1.6

type DynamicEvent struct {
	Endpoint     DynamicEndpoint     `json:"endpoint"`
	Subscription DynamicSubscription `json:"subscription"`
	Event        DynamicEventStub    `json:"event"`
}

func (*DynamicEvent) Validate added in v1.1.6

func (de *DynamicEvent) Validate() error

type DynamicEventStub added in v1.1.6

type DynamicEventStub struct {
	ProjectID string `json:"project_id"`
	EventType string `json:"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" valid:"required~please provide your data"`
	CustomHeaders  map[string]string `json:"custom_headers"`
	IdempotencyKey string            `json:"idempotency_key"`
}

func (*DynamicEventStub) Validate added in v1.1.6

func (ds *DynamicEventStub) Validate() error

type DynamicSubscription added in v1.1.6

type DynamicSubscription struct {
	Name            string                  `json:"name"`
	AlertConfig     *AlertConfiguration     `json:"alert_config,omitempty"`
	RetryConfig     *RetryConfiguration     `json:"retry_config,omitempty"`
	FilterConfig    *FilterConfiguration    `json:"filter_config,omitempty"`
	RateLimitConfig *RateLimitConfiguration `json:"rate_limit_config,omitempty"`
}

type EndpointAuthentication added in v1.1.6

type EndpointAuthentication struct {
	Type   datastore.EndpointAuthenticationType `json:"type,omitempty" valid:"optional,in(api_key)~unsupported authentication type"`
	ApiKey *ApiKey                              `json:"api_key"`
}

func (*EndpointAuthentication) Transform added in v1.1.6

type EndpointResponse added in v1.1.6

type EndpointResponse struct {
	*datastore.Endpoint
}

type EventDeliveryResponse added in v1.1.6

type EventDeliveryResponse struct {
	*datastore.EventDelivery
}

type EventResponse added in v1.1.6

type EventResponse struct {
	*datastore.Event
}

type ExpireSecret

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

type FS added in v1.1.6

type FS struct {
	Headers datastore.M `json:"headers"`
	Body    datastore.M `json:"body"`
}

func (*FS) Transform added in v1.1.6

func (fs *FS) Transform() datastore.FilterSchema

type FanoutEvent

type FanoutEvent struct {
	OwnerID   string `json:"owner_id" valid:"required~please provide an owner id"`
	EventType string `json:"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" valid:"required~please provide your data"`
	CustomHeaders  map[string]string `json:"custom_headers"`
	IdempotencyKey string            `json:"idempotency_key"`
}

func (*FanoutEvent) Validate added in v1.1.6

func (fe *FanoutEvent) Validate() error

type FilterConfiguration added in v1.1.6

type FilterConfiguration struct {
	EventTypes pq.StringArray `json:"event_types"`
	Filter     FS             `json:"filter"`
}

func (*FilterConfiguration) Transform added in v1.1.6

type FilterSchema

type FilterSchema struct {
	Headers interface{} `json:"header"`
	Body    interface{} `json:"body"`
}

type ForgotPassword

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

func (*ForgotPassword) Validate added in v1.1.6

func (fp *ForgotPassword) Validate() error

type GooglePubSubConfig added in v1.1.6

type GooglePubSubConfig struct {
	SubscriptionID string `json:"subscription_id"`
	ServiceAccount []byte `json:"service_account"`
	ProjectID      string `json:"project_id"`
}

type HMac added in v1.1.6

type HMac struct {
	Header   string                 `json:"header" valid:"required"`
	Hash     string                 `json:"hash" valid:"supported_hash,required"`
	Secret   string                 `json:"secret" valid:"required"`
	Encoding datastore.EncodingType `json:"encoding" valid:"supported_encoding~please provide a valid encoding type,required"`
}

type IDs

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

type KafkaAuth added in v1.1.6

type KafkaAuth struct {
	Type     string `json:"type"`
	Hash     string `json:"hash"`
	Username string `json:"username"`
	Password string `json:"password"`
	TLS      bool   `json:"tls"`
}

type KafkaPubSubConfig added in v1.1.6

type KafkaPubSubConfig struct {
	Brokers         []string   `json:"brokers"`
	ConsumerGroupID string     `json:"consumer_group_id"`
	TopicName       string     `json:"topic_name"`
	Auth            *KafkaAuth `json:"auth"`
}

type LoginUser

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

func (*LoginUser) Validate added in v1.1.6

func (lu *LoginUser) Validate() error

type LoginUserResponse

type LoginUserResponse struct {
	*datastore.User
	Token Token `json:"token"`
}

type MessageResponse

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

type MetaEventConfiguration added in v1.1.6

type MetaEventConfiguration struct {
	IsEnabled bool           `json:"is_enabled"`
	Type      string         `json:"type" valid:"optional, in(http)~unsupported meta event type"`
	EventType pq.StringArray `json:"event_type"`
	URL       string         `json:"url"`
	Secret    string         `json:"secret"`
}

type MetaEventResponse added in v1.1.6

type MetaEventResponse struct {
	*datastore.MetaEvent
}

type OnPremStorage added in v1.1.6

type OnPremStorage struct {
	Path null.String `json:"path" db:"path"`
}

type Organisation

type Organisation struct {
	Name         string `json:"name" bson:"name"`
	CustomDomain string `json:"custom_domain" bson:"custom_domain"`
}

type OrganisationInvite

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 Pageable added in v1.1.6

type Pageable struct {
	// The number of items to return per page
	PerPage   int                     `json:"perPage" example:"20"`
	Direction datastore.PageDirection `json:"direction"`
	// A pagination cursor to fetch the previous page of a list
	PrevCursor string `json:"prev_page_cursor" example:"01H0JATTVCXZK8FRDX1M1JN3QY"`
	// A pagination cursor to fetch the next page of a list
	NextCursor string `json:"next_page_cursor" example:"01H0JA5MEES38RRK3HTEJC647K"`
}

type PersonalAPIKey

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

type PortalAPIKeyResponse

type PortalAPIKeyResponse struct {
	Key        string    `json:"key"`
	Role       auth.Role `json:"role"`
	Url        string    `json:"url,omitempty"`
	Type       string    `json:"key_type"`
	EndpointID string    `json:"endpoint_id,omitempty"`
	ProjectID  string    `json:"project_id,omitempty"`
}
type PortalLink struct {
	Name              string   `json:"name" valid:"required~please provide the name field"`
	Endpoints         []string `json:"endpoints"`
	OwnerID           string   `json:"owner_id"`
	CanManageEndpoint bool     `json:"can_manage_endpoint"`
}

type PortalLinkResponse

type PortalLinkResponse struct {
	UID               string                     `json:"uid"`
	Name              string                     `json:"name"`
	ProjectID         string                     `json:"project_id"`
	OwnerID           string                     `json:"owner_id"`
	Endpoints         []string                   `json:"endpoints"`
	EndpointCount     int                        `json:"endpoint_count"`
	CanManageEndpoint bool                       `json:"can_manage_endpoint"`
	Token             string                     `json:"token"`
	EndpointsMetadata datastore.EndpointMetadata `json:"endpoints_metadata"`
	URL               string                     `json:"url"`
	CreatedAt         time.Time                  `json:"created_at,omitempty"`
	UpdatedAt         time.Time                  `json:"updated_at,omitempty"`
	DeletedAt         null.Time                  `json:"deleted_at,omitempty"`
}

type ProjectConfig added in v1.1.6

type ProjectConfig struct {
	MaxIngestSize            uint64                        `json:"max_payload_read_size"`
	ReplayAttacks            bool                          `json:"replay_attacks_prevention_enabled"`
	IsRetentionPolicyEnabled bool                          `json:"retention_policy_enabled"`
	AddEventIDTraceHeaders   bool                          `json:"add_event_id_trace_headers"`
	DisableEndpoint          bool                          `json:"disable_endpoint"`
	RetentionPolicy          *RetentionPolicyConfiguration `json:"retention_policy"`
	RateLimit                *RateLimitConfiguration       `json:"ratelimit"`
	Strategy                 *StrategyConfiguration        `json:"strategy"`
	Signature                *SignatureConfiguration       `json:"signature"`
	MetaEvent                *MetaEventConfiguration       `json:"meta_event"`
}

func (*ProjectConfig) Transform added in v1.1.6

func (pc *ProjectConfig) Transform() *datastore.ProjectConfig

type ProjectResponse added in v1.1.6

type ProjectResponse struct {
	*datastore.Project
}

func NewListProjectResponse added in v1.1.6

func NewListProjectResponse(projects []*datastore.Project) []*ProjectResponse

type PubSubConfig added in v1.1.6

type PubSubConfig struct {
	Type    datastore.PubSubType `json:"type"`
	Workers int                  `json:"workers"`
	Sqs     *SQSPubSubConfig     `json:"sqs"`
	Google  *GooglePubSubConfig  `json:"google"`
	Kafka   *KafkaPubSubConfig   `json:"kafka"`
}

func (*PubSubConfig) Transform added in v1.1.6

func (pc *PubSubConfig) Transform() *datastore.PubSubConfig

type QueryBatchReplayEvent added in v1.1.6

type QueryBatchReplayEvent struct {
	// The endpoint ID to filter by
	EndpointID string `json:"endpointId"`
	// The source ID to filter by
	SourceID string `json:"sourceId"`
	SearchParams
}

func (*QueryBatchReplayEvent) Transform added in v1.1.6

type QueryBatchReplayEventResponse added in v1.1.6

type QueryBatchReplayEventResponse struct {
	*datastore.Filter
}

type QueryBatchRetryEventDelivery added in v1.1.6

type QueryBatchRetryEventDelivery struct {
	SubscriptionID string `json:"subscriptionId"`
	// A list of endpoint IDs to filter by
	EndpointIDs []string `json:"endpointId"`
	EventID     string   `json:"eventId"`
	// A list of event delivery statuses to filter by
	Status []string `json:"status"`
}

func (*QueryBatchRetryEventDelivery) Transform added in v1.1.6

type QueryBatchRetryEventDeliveryResponse added in v1.1.6

type QueryBatchRetryEventDeliveryResponse struct {
	*datastore.Filter
}

type QueryCountAffectedEventDeliveries added in v1.1.6

type QueryCountAffectedEventDeliveries struct {
	// A list of endpoint IDs to filter by
	EndpointIDs []string `json:"endpointId"`
	EventID     string   `json:"eventId"`
	// A list of event delivery statuses to filter by
	Status []string `json:"status"`
	SearchParams
}

func (*QueryCountAffectedEventDeliveries) Transform added in v1.1.6

type QueryCountAffectedEventDeliveriesResponse added in v1.1.6

type QueryCountAffectedEventDeliveriesResponse struct {
	*datastore.Filter
}

type QueryCountAffectedEvents added in v1.1.6

type QueryCountAffectedEvents struct {
	SourceID   string `json:"sourceId"`
	EndpointID string `json:"endpointId"`
	SearchParams
}

func (*QueryCountAffectedEvents) Transform added in v1.1.6

type QueryCountAffectedEventsResponse added in v1.1.6

type QueryCountAffectedEventsResponse struct {
	*datastore.Filter
}

type QueryListEndpoint added in v1.1.6

type QueryListEndpoint struct {
	// The name of the endpoint
	Name string `json:"q" example:"endpoint-1"`
	// The owner ID of the endpoint
	OwnerID string `json:"ownerId" example:"01H0JA5MEES38RRK3HTEJC647K"`
	Pageable
}

func (*QueryListEndpoint) Transform added in v1.1.6

type QueryListEndpointResponse added in v1.1.6

type QueryListEndpointResponse struct {
	datastore.Pageable
	*datastore.Filter
}

type QueryListEvent added in v1.1.6

type QueryListEvent struct {
	// Any arbitrary value to filter the events payload
	Query          string `json:"query"`
	SourceID       string `json:"sourceId"`
	IdempotencyKey string `json:"idempotencyKey"`
	SearchParams
	// A list of endpoint ids to filter by
	EndpointIDs []string `json:"endpointId"`
	Pageable
}

func (*QueryListEvent) Transform added in v1.1.6

func (qs *QueryListEvent) Transform(r *http.Request) (*QueryListEventResponse, error)

type QueryListEventDelivery added in v1.1.6

type QueryListEventDelivery struct {
	// A list of endpoint IDs to filter by
	EndpointIDs    []string `json:"endpointId"`
	EventID        string   `json:"eventId"`
	SubscriptionID string   `json:"subscriptionId"`
	IdempotencyKey string   `json:"idempotencyKey"`
	// A list of event delivery statuses to filter by
	Status []string `json:"status"`
	SearchParams
	Pageable
}

func (*QueryListEventDelivery) Transform added in v1.1.6

type QueryListEventDeliveryResponse added in v1.1.6

type QueryListEventDeliveryResponse struct {
	*datastore.Filter
}

type QueryListEventResponse added in v1.1.6

type QueryListEventResponse struct {
	*datastore.Filter
}

type QueryListMetaEvent added in v1.1.6

type QueryListMetaEvent struct {
	SearchParams
	Pageable
}

func (*QueryListMetaEvent) Transform added in v1.1.6

type QueryListMetaEventResponse added in v1.1.6

type QueryListMetaEventResponse struct {
	*datastore.Filter
}

type QueryListSource added in v1.1.6

type QueryListSource struct {
	// The source type e.g. http, pub_sub
	Type string `json:"type" example:"http"`
	// The custom source provider e.g. twitter, shopify
	Provider string `json:"provider" example:"twitter"`
	Pageable
}

func (*QueryListSource) Transform added in v1.1.6

type QueryListSourceResponse added in v1.1.6

type QueryListSourceResponse struct {
	datastore.Pageable
	*datastore.SourceFilter
}

type QueryListSubscription added in v1.1.6

type QueryListSubscription struct {
	// A list of endpointIDs to filter by
	EndpointIDs []string `json:"endpointId"`
	Pageable
}

func (*QueryListSubscription) Transform added in v1.1.6

type QueryListSubscriptionResponse added in v1.1.6

type QueryListSubscriptionResponse struct {
	datastore.Pageable
	*datastore.FilterBy
}

type RateLimitConfiguration added in v1.1.6

type RateLimitConfiguration struct {
	Count    int    `json:"count"`
	Duration uint64 `json:"duration"`
}

func (*RateLimitConfiguration) Transform added in v1.1.6

type RegisterUser

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"`
}

func (*RegisterUser) Validate added in v1.1.6

func (ru *RegisterUser) Validate() error

type ResetPassword

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"`
}

func (*ResetPassword) Validate added in v1.1.6

func (rp *ResetPassword) Validate() error

type RetentionPolicyConfiguration added in v1.1.6

type RetentionPolicyConfiguration struct {
	Policy       string `json:"policy" valid:"duration~please provide a valid retention policy time duration"`
	SearchPolicy string `json:"search_policy" db:"search_policy"`
}

type RetryConfiguration

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"`
}

func (*RetryConfiguration) Transform added in v1.1.6

type Role

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

type S3Storage added in v1.1.6

type S3Storage struct {
	Bucket       null.String `json:"bucket" valid:"required~please provide a bucket name"`
	AccessKey    null.String `json:"access_key,omitempty" valid:"required~please provide an access key"`
	SecretKey    null.String `json:"secret_key,omitempty" valid:"required~please provide a secret key"`
	Region       null.String `json:"region,omitempty"`
	SessionToken null.String `json:"session_token"`
	Endpoint     null.String `json:"endpoint,omitempty"`
}

type SQSPubSubConfig added in v1.1.6

type SQSPubSubConfig struct {
	AccessKeyID   string `json:"access_key_id"`
	SecretKey     string `json:"secret_key"`
	DefaultRegion string `json:"default_region"`
	QueueName     string `json:"queue_name"`
}

type SearchParams added in v1.1.6

type SearchParams struct {
	// The start date
	StartDate string `json:"startDate" example:"2006-01-02T15:04:05"`
	// The end date
	EndDate string `json:"endDate" example:"2008-05-02T15:04:05"`
}

type SignatureConfiguration added in v1.1.6

type SignatureConfiguration struct {
	Header   config.SignatureHeaderProvider `json:"header,omitempty" valid:"required~please provide a valid signature header"`
	Versions []SignatureVersion             `json:"versions"`
}

type SignatureVersion added in v1.1.6

type SignatureVersion struct {
	UID       string    `json:"uid" db:"id"`
	Hash      string    `json:"hash,omitempty" valid:"required~please provide a valid hash,supported_hash~unsupported hash type"`
	Encoding  string    `json:"encoding" valid:"required~please provide a valid signature header"`
	CreatedAt time.Time `json:"created_at,omitempty"`
}

type SourceResponse

type SourceResponse struct {
	*datastore.Source
}

type StoragePolicyConfiguration added in v1.1.6

type StoragePolicyConfiguration struct {
	Type   datastore.StorageType `json:"type,omitempty" valid:"supported_storage~please provide a valid storage type,required"`
	S3     *S3Storage            `json:"s3"`
	OnPrem *OnPremStorage        `json:"on_prem"`
}

func (*StoragePolicyConfiguration) Transform added in v1.1.6

type StrategyConfiguration added in v1.1.6

type StrategyConfiguration struct {
	Type       string `json:"type" valid:"optional~please provide a valid strategy type, in(linear|exponential)~unsupported strategy type"`
	Duration   uint64 `json:"duration" valid:"optional~please provide a valid duration in seconds,int"`
	RetryCount uint64 `json:"retry_count" valid:"optional~please provide a valid retry count,int"`
}

type SubscriptionFunctionResponse added in v1.1.6

type SubscriptionFunctionResponse struct {
	Payload interface{} `json:"payload"`
	Log     []string    `json:"log"`
}

type SubscriptionResponse added in v1.1.6

type SubscriptionResponse struct {
	*datastore.Subscription
}

type TestFilter

type TestFilter struct {
	Request FilterSchema `json:"request"`
	Schema  FilterSchema `json:"schema"`
}

type TestWebhookFunction added in v1.1.6

type TestWebhookFunction struct {
	Payload  map[string]interface{} `json:"payload"`
	Function string                 `json:"function"`
}

type Token

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"`
}

func (*Token) Validate added in v1.1.6

func (t *Token) Validate() error

type UpdateCustomResponse added in v1.1.6

type UpdateCustomResponse struct {
	Body        *string `json:"body"`
	ContentType *string `json:"content_type"`
}

type UpdateEndpoint

type UpdateEndpoint struct {
	URL                string  `json:"url" valid:"required~please provide a url for your endpoint"`
	Secret             string  `json:"secret"`
	OwnerID            string  `json:"owner_id"`
	Description        string  `json:"description"`
	AdvancedSignatures *bool   `json:"advanced_signatures"`
	Name               *string `json:"name" valid:"required~please provide your endpointName"`
	SupportEmail       *string `json:"support_email" valid:"email~please provide a valid email"`
	IsDisabled         *bool   `json:"is_disabled"`
	SlackWebhookURL    *string `json:"slack_webhook_url"`

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

func (*UpdateEndpoint) Validate added in v1.1.6

func (uE *UpdateEndpoint) Validate() error

type UpdateOrganisationMember

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

type UpdatePassword

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"`
}

func (*UpdatePassword) Validate added in v1.1.6

func (u *UpdatePassword) Validate() error

type UpdateProject

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

func (*UpdateProject) Validate added in v1.1.6

func (uP *UpdateProject) Validate() error

type UpdateSource

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"`
	CustomResponse  UpdateCustomResponse `json:"custom_response"`
	Verifier        VerifierConfig       `json:"verifier"`
	PubSub          *PubSubConfig        `json:"pub_sub"`
	IdempotencyKeys []string             `json:"idempotency_keys"`
	IdempotencyTTL  string               `json:"idempotency_ttl"`
}

func (*UpdateSource) Validate added in v1.1.6

func (us *UpdateSource) Validate() error

type UpdateSubscription

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"`
	Function   string `json:"function"`

	AlertConfig     *AlertConfiguration     `json:"alert_config,omitempty"`
	RetryConfig     *RetryConfiguration     `json:"retry_config,omitempty"`
	FilterConfig    *FilterConfiguration    `json:"filter_config,omitempty"`
	RateLimitConfig *RateLimitConfiguration `json:"rate_limit_config,omitempty"`
}

func (*UpdateSubscription) Validate added in v1.1.6

func (us *UpdateSubscription) Validate() error

type UpdateUser

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"`
}

func (*UpdateUser) Validate added in v1.1.6

func (u *UpdateUser) Validate() error

type User

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

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

func (*UserExists) Validate added in v1.1.6

func (ue *UserExists) Validate() error

type UserInviteTokenResponse

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

type UserResponse added in v1.1.6

type UserResponse struct {
	*datastore.User
}

type VerifierConfig added in v1.1.6

type VerifierConfig struct {
	Type      datastore.VerifierType `json:"type,omitempty" valid:"supported_verifier~please provide a valid verifier type"`
	HMac      *HMac                  `json:"hmac"`
	BasicAuth *BasicAuth             `json:"basic_auth"`
	ApiKey    *ApiKey                `json:"api_key"`
}

func (*VerifierConfig) Transform added in v1.1.6

func (vc *VerifierConfig) Transform() *datastore.VerifierConfig

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