fraudsdkgo

package module
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

README

fraud-sdk-go

Fraud SDK for Go

Documentation

Index

Examples

Constants

View Source
const (
	DefaultEndpointValue string = "https://account-api.datadome.co"
	DefaultTimeoutValue  int    = 1500
)

Variables

View Source
var (
	ErrKeyMissing        = errors.New("FraudAPIKey must be defined")
	ErrRequestTimeout    = errors.New("request to Account Protect API timeout")
	ErrWrongTimeoutValue = errors.New("Timeout must be a positive integer")
)

Functions

This section is empty.

Types

type AccountUpdateEvent added in v1.1.0

type AccountUpdateEvent struct {
	Account        string
	Action         Action
	Authentication *Authentication
	Session        *Session
	User           *User
}

AccountUpdateEvent is used to store the fields for a AccountUpdate event.

func NewAccountUpdateEvent added in v1.1.0

func NewAccountUpdateEvent(account string, options ...AccountUpdateOption) *AccountUpdateEvent

NewAccountUpdateEvent instantiates a new AccountUpdateEvent that implements the Event interface.

func (*AccountUpdateEvent) Collect added in v1.1.0

func (e *AccountUpdateEvent) Collect(c *Client, r *http.Request, module *Module, header *Header) (*ErrorResponsePayload, error)

Collect is used to construct the AccountUpdateRequestPayload based on the information stored in the AccountUpdateEvent structure and performs the enrichment request to the Account Protect API. An error may be returned in case of error when performing the request.

func (*AccountUpdateEvent) Validate added in v1.1.0

func (e *AccountUpdateEvent) Validate(c *Client, r *http.Request, module *Module, header *Header) (*ResponsePayload, error)

Validate is used to construct the AccountUpdateRequestPayload based on the information stored in the NewAccountUpdateEvent structure and performs the validation request to the Account Protect API. An error may be returned in case of error when performing the request.

type AccountUpdateOption added in v1.1.0

type AccountUpdateOption func(*AccountUpdateEvent)

AccountUpdateOption describes the functional option signature to customize the AccountUpdateEvent behavior.

func AccountUpdateWithAuthentication added in v1.2.0

func AccountUpdateWithAuthentication(authentication Authentication) AccountUpdateOption

AccountUpdateWithAuthentication is a functional option to set the Authentication field.

Example
authenticationMode := Password
authenticationSocialProvider := Google
authenticationType := Social
authentication := Authentication{
	Mode:           &authenticationMode,
	SocialProvider: &authenticationSocialProvider,
	Type:           &authenticationType,
}
event := NewAccountUpdateEvent("test-account", AccountUpdateWithAuthentication(authentication))

fmt.Println(*event.Authentication.Mode)
fmt.Println(*event.Authentication.SocialProvider)
fmt.Println(*event.Authentication.Type)
Output:
password
google
social

func AccountUpdateWithSession added in v1.1.0

func AccountUpdateWithSession(session Session) AccountUpdateOption

AccountUpdateWithSession is a functional option to set the Session field.

Example
sessionID := "123456"
session := Session{
	ID: &sessionID,
}
event := NewAccountUpdateEvent("test-account", AccountUpdateWithSession(session))

fmt.Println(*event.Session.ID)
Output:
123456

func AccountUpdateWithUser added in v1.1.0

func AccountUpdateWithUser(user User) AccountUpdateOption

AccountUpdateWithUser is a functional option to set the User field.

Example
user := User{}
user.ID = "123456"
event := NewAccountUpdateEvent("test-account", AccountUpdateWithUser(user))

fmt.Println(event.User.ID)
Output:
123456

type AccountUpdateRequestPayload added in v1.1.0

type AccountUpdateRequestPayload struct {
	CommonRequestPayload
	Authentication *Authentication `json:"authentication,omitempty"`
	Session        *Session        `json:"session,omitempty"`
	User           *User           `json:"user,omitempty"`
}

AccountUpdateRequestPayload describes the expected fields of the payload to be sent to the Account Protect API for a AccountUpdateEvent.

type Action

type Action string

Action describes the available actions that can be protected.

const (
	AccountUpdate  Action = "account-update"
	Login          Action = "login"
	Registration   Action = "registration"
	PasswordUpdate Action = "password-update"
)

type Address

type Address struct {
	City        *string `json:"city,omitempty"`
	CountryCode *string `json:"countryCode,omitempty"`
	Line1       *string `json:"line1,omitempty"`
	Line2       *string `json:"line2,omitempty"`
	Name        *string `json:"name,omitempty"`
	RegionCode  *string `json:"regionCode,omitempty"`
	ZipCode     *string `json:"zipCode,omitempty"`
}

Address is used to store the address information of a user.

type AllowedRequestPayload

AllowedRequestPayload describes the allowed request payloads to perform a request to the Account Protect API.

type ApiFields

type ApiFields string

ApiFields describes the fields expected for the AllowedRequestPayload

const (
	Accept                 ApiFields = "Accept"
	AcceptCharset          ApiFields = "AcceptCharset"
	AcceptEncoding         ApiFields = "AcceptEncoding"
	AcceptLanguage         ApiFields = "AcceptLanguage"
	ClientID               ApiFields = "ClientID"
	Connection             ApiFields = "Connection"
	ContentType            ApiFields = "ContentType"
	From                   ApiFields = "From"
	Host                   ApiFields = "Host"
	Origin                 ApiFields = "Origin"
	Referer                ApiFields = "Referer"
	Request                ApiFields = "Request"
	SecCHDeviceMemory      ApiFields = "SecCHDeviceMemory"
	SecCHUA                ApiFields = "SecCHUA"
	SecCHUAArch            ApiFields = "SecCHUAArch"
	SecCHUAFullVersionList ApiFields = "SecCHUAFullVersionList"
	SecCHUAMobile          ApiFields = "SecCHUAMobile"
	SecCHUAModel           ApiFields = "SecCHUAModel"
	SecCHUAPlatform        ApiFields = "SecCHUAPlatform"
	ServerHostname         ApiFields = "ServerHostname"
	UserAgent              ApiFields = "UserAgent"
	XForwardedForIP        ApiFields = "XForwardedForIP"
	XRealIP                ApiFields = "XRealIP"
)

type Authentication added in v1.1.0

type Authentication struct {
	Mode           *AuthenticationMode           `json:"mode,omitempty"`
	SocialProvider *AuthenticationSocialProvider `json:"socialProvider,omitempty"`
	Type           *AuthenticationType           `json:"type,omitempty"`
}

Authentication is used to describe the user's authentication informations.

type AuthenticationMode added in v1.1.0

type AuthenticationMode string

AuthenticationMode describes the possible mode of authentication.

const (
	OtherAuthenticationMode AuthenticationMode = "other"
	Biometric               AuthenticationMode = "biometric"
	Mail                    AuthenticationMode = "mail"
	MFA                     AuthenticationMode = "mfa"
	OTP                     AuthenticationMode = "otp"
	Password                AuthenticationMode = "password"
)

type AuthenticationSocialProvider added in v1.1.0

type AuthenticationSocialProvider string

AuthenticationSocialProvider desribes the possible social provider used for the authentication.

const (
	OtherAuthenticationSocialProvider AuthenticationSocialProvider = "other"
	Amazon                            AuthenticationSocialProvider = "amazon"
	Apple                             AuthenticationSocialProvider = "apple"
	Facebook                          AuthenticationSocialProvider = "facebook"
	Github                            AuthenticationSocialProvider = "github"
	Google                            AuthenticationSocialProvider = "google"
	Linkedin                          AuthenticationSocialProvider = "linkedin"
	Microsoft                         AuthenticationSocialProvider = "microsoft"
	Twitter                           AuthenticationSocialProvider = "twitter"
	Yahoo                             AuthenticationSocialProvider = "yahoo"
)

type AuthenticationType added in v1.1.0

type AuthenticationType string

AuthenticationType describes the possible type of authentication.

const (
	OtherAuthenticationType AuthenticationType = "other"
	Local                   AuthenticationType = "local"
	Social                  AuthenticationType = "social"
)

type Client

type Client struct {
	Endpoint    string
	FraudAPIKey string
	Timeout     int
	// contains filtered or unexported fields
}

Client is used to interact with the DataDome's Account Protect API. This structure contains all the informations specified through the ClientOption's functions.

func NewClient

func NewClient(fraudApiKey string, options ...ClientOption) (*Client, error)

NewClient instantiates a new DataDome Client to perform calls to the Account Protect API. The fields may be customized through ClientOption functions. It returns an error in case of bad inputs in the options.

func (*Client) Collect

func (c *Client) Collect(r *http.Request, event Event) (*ErrorResponsePayload, error)

Collect performs an enrichment request to the DataDome's Account Protect API. This function extracts the information of the incoming request to enrich our detection models.

func (*Client) CollectWithRequestMetadata added in v1.1.0

func (c *Client) CollectWithRequestMetadata(r *http.Request, event Event, requestMetadata *RequestMetadata) (*ErrorResponsePayload, error)

CollectWithRequestMetadata performs an enrichment request to the DataDome's Account Protect API. This function is similar to the [Collect] function but allows the override of the Header.

If a field of the RequestMetadata structure is not specified, it will extracts the information from the incoming request.

func (*Client) Validate

func (c *Client) Validate(r *http.Request, event Event) (*ResponsePayload, error)

Validate performs a validation request to the DataDome's Account Protect API. This function extracts the information from the incoming request to construct the Header structure and returns the recommendation from the API.

func (*Client) ValidateWithRequestMetadata added in v1.1.0

func (c *Client) ValidateWithRequestMetadata(r *http.Request, event Event, requestMetadata *RequestMetadata) (*ResponsePayload, error)

ValidateWithRequestMetadata performs a validation request to the DataDome's Account Protect API. This function is similar to the [Validate] function but allows the override of the Header.

If a field of the RequestMetadata structure is not specified, it will extracts the information from the incoming request.

type ClientOption

type ClientOption func(*Client)

ClientOption describes the functional option signature to customize the Client behavior.

func ClientWithEndpoint

func ClientWithEndpoint(endpoint string) ClientOption

ClientWithEndpoint is a functional option to set the endpoint of the Account Protect API.

Example
c, _ := NewClient("your-api-key", ClientWithEndpoint("account-api.example.org"))

fmt.Println(c.Endpoint)
Output:
https://account-api.example.org

func ClientWithTimeout

func ClientWithTimeout(timeout int) ClientOption

ClientWithTimeout is a functional option to set the HTTP Client timeout in milliseconds.

Example
c, _ := NewClient("your-api-key", ClientWithTimeout(300))

fmt.Println(c.Timeout)
Output:
300

type CommonRequestPayload added in v1.1.0

type CommonRequestPayload struct {
	Account string `json:"account"`
	Header  Header `json:"header"`
	Module  Module `json:"module"`
}

CommonRequestPayload describes the common fields for the event's request payloads.

type ErrorInfo

type ErrorInfo struct {
	Field string `json:"field,omitempty"`
	Error string `json:"error,omitempty"`
}

ErrorInfo is used to provide more precision about the error returned by the Account Protect API.

type ErrorResponsePayload

type ErrorResponsePayload struct {
	Message *string     `json:"message,omitempty"`
	Errors  []ErrorInfo `json:"errors,omitempty"`
}

ErrorResponsePayload is used for error response returned by the Account Protect API.

type Event

type Event interface {
	Validate(c *Client, r *http.Request, module *Module, header *Header) (*ResponsePayload, error)
	Collect(c *Client, r *http.Request, module *Module, header *Header) (*ErrorResponsePayload, error)
}

Event describes the methods that need to be implemented to create a new event type.

type Header struct {
	Accept                 string  `json:"accept"`
	AcceptCharset          string  `json:"acceptCharset"`
	AcceptEncoding         string  `json:"acceptEncoding"`
	AcceptLanguage         string  `json:"acceptLanguage"`
	Addr                   string  `json:"addr"`
	ClientID               string  `json:"clientID"`
	Connection             string  `json:"connection"`
	ContentType            string  `json:"contentType"`
	From                   string  `json:"from"`
	Host                   string  `json:"host"`
	Method                 string  `json:"method"`
	Referer                string  `json:"referer"`
	Request                string  `json:"request"`
	Origin                 string  `json:"origin"`
	Port                   int     `json:"port"`
	Protocol               string  `json:"protocol"`
	SecCHUA                *string `json:"secCHUA,omitempty"`
	SecCHUAMobile          *string `json:"secCHUAMobile,omitempty"`
	SecCHUAPlatform        *string `json:"secCHUAPlatform,omitempty"`
	SecCHUAArch            *string `json:"secCHUAArch,omitempty"`
	SecCHUAFullVersionList *string `json:"secCHUAFullVersionList,omitempty"`
	SecCHUAModel           *string `json:"secCHUAModel,omitempty"`
	SecCHDeviceMemory      *string `json:"secCHDeviceMemory,omitempty"`
	ServerHostname         string  `json:"serverHostname"`
	UserAgent              string  `json:"userAgent"`
	XForwardedForIP        string  `json:"xForwardedForIp"`
	XRealIP                string  `json:"xRealIp"`
}

Header is used to store the information from the incoming request.

type Location

type Location struct {
	City        *string `json:"city,omitempty"`
	Country     *string `json:"country,omitempty"`
	CountryCode *string `json:"countryCode,omitempty"`
}

Location is used to describe the user's location.

type LoginEvent

type LoginEvent struct {
	Account        string
	Action         Action
	Status         LoginStatus
	User           *User
	Session        *Session
	Authentication *Authentication
}

LoginEvent is used to store the fields for a Login event.

func NewLoginEvent

func NewLoginEvent(account string, status LoginStatus, options ...LoginOption) *LoginEvent

NewLoginEvent instantiates a new LoginEvent that implements the Event interface.

func (*LoginEvent) Collect

func (e *LoginEvent) Collect(c *Client, r *http.Request, module *Module, header *Header) (*ErrorResponsePayload, error)

Collect is used to construct the LoginRequestPayload based on the information stored in the LoginEvent structure and performs the enrichment request to the Account Protect API. An error may be returned in case of error when performing the request.

func (*LoginEvent) Validate

func (e *LoginEvent) Validate(c *Client, r *http.Request, module *Module, header *Header) (*ResponsePayload, error)

Validate is used to construct the LoginRequestPayload based on the information stored in the LoginEvent structure and performs the validation request to the Account Protect API. An error may be returned in case of error when performing the request.

type LoginOption added in v1.1.0

type LoginOption func(*LoginEvent)

LoginOption describes the functional option signature to customize the LoginEvent behavior.

func LoginWithAuthentication added in v1.1.0

func LoginWithAuthentication(authentication Authentication) LoginOption

LoginWithAuthentication is a functional option to set the Authentication field.

Example
authenticationMode := OtherAuthenticationMode
authenticationSocialProvider := OtherAuthenticationSocialProvider
authenticationType := OtherAuthenticationType
authentication := Authentication{
	Mode:           &authenticationMode,
	SocialProvider: &authenticationSocialProvider,
	Type:           &authenticationType,
}
event := NewLoginEvent("test-account", Failed, LoginWithAuthentication(authentication))

fmt.Println(*event.Authentication.Mode)
Output:
other

func LoginWithSession added in v1.1.0

func LoginWithSession(session Session) LoginOption

LoginWithSession is a functional option to set the Session field.

Example
sessionID := "123456"
session := Session{
	ID: &sessionID,
}
event := NewLoginEvent("test-account", Failed, LoginWithSession(session))

fmt.Println(*event.Session.ID)
Output:
123456

func LoginWithUser added in v1.1.0

func LoginWithUser(user User) LoginOption

LoginWithUser is a functional option to set the User field.

Example
user := User{
	ID: "123456",
}
event := NewLoginEvent("test-account", Failed, LoginWithUser(user))

fmt.Println(event.User.ID)
Output:
123456

type LoginRequestPayload

type LoginRequestPayload struct {
	CommonRequestPayload
	Status         LoginStatus     `json:"status"`
	User           *User           `json:"user,omitempty"`
	Session        *Session        `json:"session,omitempty"`
	Authentication *Authentication `json:"authentication,omitempty"`
}

LoginRequestPayload describes the expected fields of the payload to be sent to the Account Protect API for a LoginEvent.

type LoginStatus added in v1.1.0

type LoginStatus string

LoginStatus describes the possible status of an action.

const (
	Failed    LoginStatus = "failed"
	Succeeded LoginStatus = "succeeded"
)

type Module

type Module struct {
	RequestTimeMicros int64  `json:"requestTimeMicros"`
	Name              string `json:"name"`
	Version           string `json:"version"`
}

Module is used to store the information about the module that send the AllowedRequestPayload.

type Operation

type Operation string

Operation describes the available operations related to fraud protection that can be performed.

const (
	ValidateOperation Operation = "validate"
	CollectOperation  Operation = "collect"
)

type PasswordUpdateEvent added in v1.1.0

type PasswordUpdateEvent struct {
	Account string
	Action  Action
	Reason  PasswordUpdateReason
	Status  PasswordUpdateStatus
	Session *Session
	User    User
}

PasswordUpdateEvent is used to store the fields for a PasswordUpdate event.

func NewPasswordUpdateEvent added in v1.1.0

func NewPasswordUpdateEvent(account string, user User, reason PasswordUpdateReason, status PasswordUpdateStatus, options ...PasswordUpdateOption) *PasswordUpdateEvent

NewPasswordUpdateEvent instantiates a new AccountUpdateEvent that implements the Event interface.

func (*PasswordUpdateEvent) Collect added in v1.1.0

func (e *PasswordUpdateEvent) Collect(c *Client, r *http.Request, module *Module, header *Header) (*ErrorResponsePayload, error)

Collect is used to construct the PasswordUpdateRequestPayload based on the information stored in the PasswordUpdateEvent structure and performs the enrichment request to the Account Protect API. An error may be returned in case of error when performing the request.

func (*PasswordUpdateEvent) Validate added in v1.1.0

func (e *PasswordUpdateEvent) Validate(c *Client, r *http.Request, module *Module, header *Header) (*ResponsePayload, error)

Validate is used to construct the PasswordUpdateRequestPayload based on the information stored in the PasswordUpdateEvent structure and performs the validation request to the Account Protect API. An error may be returned in case of error when performing the request.

type PasswordUpdateOption added in v1.1.0

type PasswordUpdateOption func(*PasswordUpdateEvent)

PasswordUpdateOption describes the functional option signature to customize the PasswordUpdateEvent behavior.

func PasswordUpdateWithSession added in v1.1.0

func PasswordUpdateWithSession(session Session) PasswordUpdateOption

PasswordUpdateWithSession is a functional option to set the Session field.

Example
sessionID := "123456"
session := Session{
	ID: &sessionID,
}
event := NewPasswordUpdateEvent("test-account", User{ID: "123456"}, ForcedReset, PasswordUpdateAttempted, PasswordUpdateWithSession(session))

fmt.Println(*event.Session.ID)
Output:
123456

type PasswordUpdateReason added in v1.1.0

type PasswordUpdateReason string

PasswordUpdateReason describes the possible reasons for updating a password.

const (
	ForcedReset    PasswordUpdateReason = "forcedReset"
	ForgotPassword PasswordUpdateReason = "forgotPassword"
	UserUpdate     PasswordUpdateReason = "userUpdate"
)

type PasswordUpdateRequestPayload added in v1.1.0

type PasswordUpdateRequestPayload struct {
	CommonRequestPayload
	Reason  PasswordUpdateReason `json:"reason"`
	Session *Session             `json:"session,omitempty"`
	Status  PasswordUpdateStatus `json:"status"`
	User    User                 `json:"user"`
}

PasswordUpdateRequestPayload describes the expected fields of the payload to be sent to the Account Protect API for a PasswordUpdateEvent.

type PasswordUpdateStatus added in v1.1.0

type PasswordUpdateStatus string

PasswordUpdateReason describes the possible status when updating a password.

const (
	PasswordUpdateAttempted   PasswordUpdateStatus = "attempted"
	PasswordUpdateFailed      PasswordUpdateStatus = "failed"
	PasswordUpdateSucceeded   PasswordUpdateStatus = "succeeded"
	PasswordUpdateLinkExpired PasswordUpdateStatus = "linkExpired"
)

type RegistrationEvent

type RegistrationEvent struct {
	Account        string
	Action         Action
	Authentication *Authentication
	Session        *Session
	User           User
}

RegistrationEvent is used to store the fields for a Registration event.

func NewRegistrationEvent

func NewRegistrationEvent(account string, user User, options ...RegistrationEventOption) *RegistrationEvent

NewRegistrationEvent instantiates a new RegistrationEvent that implements the Event interface.

func (*RegistrationEvent) Collect

func (e *RegistrationEvent) Collect(c *Client, r *http.Request, module *Module, header *Header) (*ErrorResponsePayload, error)

Collect is used to construct the RegistrationRequestPayload based on the information stored in the RegistrationEvent structure and performs the enrichment request to the Account Protect API. An error may be returned in case of error when performing the request.

func (*RegistrationEvent) Validate

func (e *RegistrationEvent) Validate(c *Client, r *http.Request, module *Module, header *Header) (*ResponsePayload, error)

Validate is used to construct the RegistrationRequestPayload based on the information stored in the RegistrationEvent structure and performs the validation request to the Account Protect API. An error may be returned in case of error when performing the request.

type RegistrationEventOption

type RegistrationEventOption func(*RegistrationEvent)

RegistrationEventOption describes the functional option signature to customize the RegistrationEvent behavior.

func RegistrationWithAuthentication added in v1.2.0

func RegistrationWithAuthentication(authentication Authentication) RegistrationEventOption

RegistrationWithAuthentication is a functional option to set the Authentication field.

Example
authenticationMode := Password
authenticationSocialProvider := Google
authenticationType := Social
authentication := Authentication{
	Mode:           &authenticationMode,
	SocialProvider: &authenticationSocialProvider,
	Type:           &authenticationType,
}

event := NewRegistrationEvent("test-account", User{}, RegistrationWithAuthentication(authentication))

fmt.Println(*event.Authentication.Mode)
fmt.Println(*event.Authentication.SocialProvider)
fmt.Println(*event.Authentication.Type)
Output:
password
google
social

func RegistrationWithSession

func RegistrationWithSession(session Session) RegistrationEventOption

RegistrationWithSession is a functional option to set the Session field.

Example
sessionID := "123456"
session := Session{
	ID: &sessionID,
}
event := NewRegistrationEvent("test-account", User{}, RegistrationWithSession(session))

fmt.Println(*event.Session.ID)
Output:
123456

type RegistrationRequestPayload

type RegistrationRequestPayload struct {
	CommonRequestPayload
	Authentication *Authentication `json:"authentication,omitempty"`
	Session        *Session        `json:"session,omitempty"`
	User           User            `json:"user"`
}

RegistrationRequestPayload describes the expected fields of the payload to be sent to the Account Protect API for a RegistrationEvent.

type RequestMetadata added in v1.1.0

type RequestMetadata struct {
	Accept                 *string
	AcceptCharset          *string
	AcceptEncoding         *string
	AcceptLanguage         *string
	Addr                   *string
	ClientID               *string
	Connection             *string
	ContentType            *string
	From                   *string
	Host                   *string
	Method                 *string
	Referer                *string
	Request                *string
	Origin                 *string
	Port                   *int
	Protocol               *string
	SecCHUA                *string
	SecCHUAMobile          *string
	SecCHUAPlatform        *string
	SecCHUAArch            *string
	SecCHUAFullVersionList *string
	SecCHUAModel           *string
	SecCHDeviceMemory      *string
	ServerHostname         *string
	UserAgent              *string
	XForwardedForIP        *string
	XRealIP                *string
}

RequestMetadata is used to specify the fields of the Header structure that need to be override.

type ResponseAction

type ResponseAction string

ResponseAction describes the possible recommendations from the Account Protect API.

const (
	Deny      ResponseAction = "deny"
	Review    ResponseAction = "review"
	Challenge ResponseAction = "challenge"
	Allow     ResponseAction = "allow"
)

type ResponsePayload

type ResponsePayload struct {
	SuccessResponsePayload
	ErrorResponsePayload
}

ResponsePayload describes the fields that can be returned from the Account Protect API.

type ResponseStatus

type ResponseStatus string

ResponseStatus describes the possible status outcome.

const (
	OK      ResponseStatus = "ok"
	Failure ResponseStatus = "failure"
	Timeout ResponseStatus = "timeout"
)

type Session

type Session struct {
	ID        *string `json:"id,omitempty"`
	CreatedAt *string `json:"createdAt,omitempty"`
}

Session is used to store the information about the user's session.

type SuccessResponsePayload

type SuccessResponsePayload struct {
	Action   ResponseAction `json:"action"`
	Status   ResponseStatus
	Reasons  []string  `json:"reasons,omitempty"`
	EventID  *string   `json:"eventId,omitempty"`
	IP       *string   `json:"ip,omitempty"`
	Location *Location `json:"location,omitempty"`
	Score    *int      `json:"score,omitempty"`
}

SuccessResponsePayload is used for success response returned by the Account Protect API.

type User

type User struct {
	ID                   string    `json:"id"`
	Address              *Address  `json:"address,omitempty"`
	CreatedAt            *string   `json:"createdAt,omitempty"`
	DisplayName          *string   `json:"displayName,omitempty"`
	Description          *string   `json:"description,omitempty"`
	Email                *string   `json:"email,omitempty"`
	ExternalURLs         *[]string `json:"externalUrls,omitempty"`
	FirstName            *string   `json:"firstName,omitempty"`
	LastName             *string   `json:"lastName,omitempty"`
	PaymentMethodUpdated *bool     `json:"paymentMethodUpdated,omitempty"`
	Phone                *string   `json:"phone,omitempty"`
	PictureURLs          *[]string `json:"pictureUrls,omitempty"`
	Title                *string   `json:"title,omitempty"`
}

User is used to store the information of a user.

Jump to

Keyboard shortcuts

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