Documentation
¶
Index ¶
- func Bool(value bool) param.Field[bool]
- func DefaultClientOptions() []option.RequestOption
- func F[T any](value T) param.Field[T]
- func FileParam(reader io.Reader, filename string, contentType string) param.Field[io.Reader]
- func Float(value float64) param.Field[float64]
- func Int(value int64) param.Field[int64]
- func Null[T any]() param.Field[T]
- func Raw[T any](value any) param.Field[T]
- func String(value string) param.Field[string]
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params interface{}, res interface{}, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params interface{}, ...) error
- func (r *Client) Get(ctx context.Context, path string, params interface{}, res interface{}, ...) error
- func (r *Client) Patch(ctx context.Context, path string, params interface{}, res interface{}, ...) error
- func (r *Client) Post(ctx context.Context, path string, params interface{}, res interface{}, ...) error
- func (r *Client) Put(ctx context.Context, path string, params interface{}, res interface{}, ...) error
- type Error
- type LookupLookupParams
- type LookupLookupParamsType
- type LookupLookupResponse
- type LookupLookupResponseFlag
- type LookupLookupResponseLineType
- type LookupLookupResponseNetworkInfo
- type LookupLookupResponseOriginalNetworkInfo
- type LookupService
- type TransactionalSendParams
- type TransactionalSendResponse
- type TransactionalService
- type VerificationCheckParams
- type VerificationCheckParamsTarget
- type VerificationCheckParamsTargetType
- type VerificationCheckResponse
- type VerificationCheckResponseMetadata
- type VerificationCheckResponseStatus
- type VerificationNewParams
- type VerificationNewParamsMetadata
- type VerificationNewParamsOptions
- type VerificationNewParamsOptionsAppRealm
- type VerificationNewParamsOptionsAppRealmPlatform
- type VerificationNewParamsOptionsMethod
- type VerificationNewParamsOptionsPreferredChannel
- type VerificationNewParamsSignals
- type VerificationNewParamsSignalsDevicePlatform
- type VerificationNewParamsTarget
- type VerificationNewParamsTargetType
- type VerificationNewResponse
- type VerificationNewResponseChannel
- type VerificationNewResponseMetadata
- type VerificationNewResponseMethod
- type VerificationNewResponseReason
- type VerificationNewResponseSilent
- type VerificationNewResponseStatus
- type VerificationService
- type WatchPredictParams
- type WatchPredictParamsMetadata
- type WatchPredictParamsSignals
- type WatchPredictParamsSignalsDevicePlatform
- type WatchPredictParamsTarget
- type WatchPredictParamsTargetType
- type WatchPredictResponse
- type WatchPredictResponsePrediction
- type WatchSendEventsParams
- type WatchSendEventsParamsEvent
- type WatchSendEventsParamsEventsConfidence
- type WatchSendEventsParamsEventsTarget
- type WatchSendEventsParamsEventsTargetType
- type WatchSendEventsResponse
- type WatchSendEventsResponseStatus
- type WatchSendFeedbacksParams
- type WatchSendFeedbacksParamsFeedback
- type WatchSendFeedbacksParamsFeedbacksMetadata
- type WatchSendFeedbacksParamsFeedbacksSignals
- type WatchSendFeedbacksParamsFeedbacksSignalsDevicePlatform
- type WatchSendFeedbacksParamsFeedbacksTarget
- type WatchSendFeedbacksParamsFeedbacksTargetType
- type WatchSendFeedbacksParamsFeedbacksType
- type WatchSendFeedbacksResponse
- type WatchSendFeedbacksResponseStatus
- type WatchService
- func (r *WatchService) Predict(ctx context.Context, body WatchPredictParams, opts ...option.RequestOption) (res *WatchPredictResponse, err error)
- func (r *WatchService) SendEvents(ctx context.Context, body WatchSendEventsParams, opts ...option.RequestOption) (res *WatchSendEventsResponse, err error)
- func (r *WatchService) SendFeedbacks(ctx context.Context, body WatchSendFeedbacksParams, ...) (res *WatchSendFeedbacksResponse, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶ added in v0.3.0
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (API_TOKEN, PRELUDE_BASE_URL). This should be used to initialize new clients.
func F ¶
F is a param field helper used to initialize a param.Field generic struct. This helps specify null, zero values, and overrides, as well as normal values. You can read more about this in our README.
func Int ¶
Int is a param field helper which helps specify integers. This is particularly helpful when specifying integer constants for fields.
func Raw ¶
Raw is a param field helper for specifying values for fields when the type you are looking to send is different from the type that is specified in the SDK. For example, if the type of the field is an integer, but you want to send a float, you could do that by setting the corresponding field with Raw[int](0.5).
Types ¶
type Client ¶
type Client struct { Options []option.RequestOption Lookup *LookupService Transactional *TransactionalService Verification *VerificationService Watch *WatchService }
Client creates a struct with services and top level methods that help with interacting with the Prelude API. You should not instantiate this client directly, and instead use the NewClient method instead.
func NewClient ¶
func NewClient(opts ...option.RequestOption) (r *Client)
NewClient generates a new client with the default option read from the environment (API_TOKEN, PRELUDE_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.
func (*Client) Delete ¶
func (r *Client) Delete(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error
Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Execute ¶
func (r *Client) Execute(ctx context.Context, method string, path string, params interface{}, res interface{}, opts ...option.RequestOption) error
Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.
If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.
The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.
If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.
Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.
The response body will be deserialized into the res variable, depending on its type:
- A pointer to a *http.Response is populated by the raw response.
- A pointer to a byte array will be populated with the contents of the request body.
- A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
- A nil value will not read the response body.
For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.
func (*Client) Get ¶
func (r *Client) Get(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error
Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Patch ¶
func (r *Client) Patch(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error
Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Post ¶
func (r *Client) Post(ctx context.Context, path string, params interface{}, res interface{}, opts ...option.RequestOption) error
Post makes a POST request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
type LookupLookupParams ¶ added in v0.3.0
type LookupLookupParams struct { // Optional features. Possible values are: // // - `cnam` - Retrieve CNAM (Caller ID Name) along with other information. Contact // us if you need to use this functionality. Type param.Field[[]LookupLookupParamsType] `query:"type"` }
func (LookupLookupParams) URLQuery ¶ added in v0.3.0
func (r LookupLookupParams) URLQuery() (v url.Values)
URLQuery serializes LookupLookupParams's query parameters as `url.Values`.
type LookupLookupParamsType ¶ added in v0.3.0
type LookupLookupParamsType string
const (
LookupLookupParamsTypeCnam LookupLookupParamsType = "cnam"
)
func (LookupLookupParamsType) IsKnown ¶ added in v0.3.0
func (r LookupLookupParamsType) IsKnown() bool
type LookupLookupResponse ¶ added in v0.3.0
type LookupLookupResponse struct { // The CNAM (Caller ID Name) associated with the phone number. Contact us if you // need to use this functionality. Once enabled, put `cnam` option to `type` query // parameter. CallerName string `json:"caller_name"` // The country code of the phone number. CountryCode string `json:"country_code"` // A list of flags associated with the phone number. // // - `ported` - Indicates the phone number has been transferred from one carrier to // another. // - `temporary` - Indicates the phone number is likely a temporary or virtual // number, often used for verification services or burner phones. Flags []LookupLookupResponseFlag `json:"flags"` // The type of phone line. // // - `calling_cards` - Numbers that are associated with providers of pre-paid // domestic and international calling cards. // - `fixed_line` - Landline phone numbers. // - `isp` - Numbers reserved for Internet Service Providers. // - `local_rate` - Numbers that can be assigned non-geographically. // - `mobile` - Mobile phone numbers. // - `other` - Other types of services. // - `pager` - Number ranges specifically allocated to paging devices. // - `payphone` - Allocated numbers for payphone kiosks in some countries. // - `premium_rate` - Landline numbers where the calling party pays more than // standard. // - `satellite` - Satellite phone numbers. // - `service` - Automated applications. // - `shared_cost` - Specific landline ranges where the cost of making the call is // shared between the calling and called party. // - `short_codes_commercial` - Short codes are memorable, easy-to-use numbers, // like the UK's NHS 111, often sold to businesses. Not available in all // countries. // - `toll_free` - Number where the called party pays for the cost of the call not // the calling party. // - `universal_access` - Number ranges reserved for Universal Access initiatives. // - `unknown` - Unknown phone number type. // - `vpn` - Numbers are used exclusively within a private telecommunications // network, connecting the operator's terminals internally and not accessible via // the public telephone network. // - `voice_mail` - A specific category of Interactive Voice Response (IVR) // services. // - `voip` - Specific ranges for providers of VoIP services to allow incoming // calls from the regular telephony network. LineType LookupLookupResponseLineType `json:"line_type"` // The current carrier information. NetworkInfo LookupLookupResponseNetworkInfo `json:"network_info"` // The original carrier information. OriginalNetworkInfo LookupLookupResponseOriginalNetworkInfo `json:"original_network_info"` // The phone number. PhoneNumber string `json:"phone_number"` JSON lookupLookupResponseJSON `json:"-"` }
func (*LookupLookupResponse) UnmarshalJSON ¶ added in v0.3.0
func (r *LookupLookupResponse) UnmarshalJSON(data []byte) (err error)
type LookupLookupResponseFlag ¶ added in v0.3.0
type LookupLookupResponseFlag string
const ( LookupLookupResponseFlagPorted LookupLookupResponseFlag = "ported" LookupLookupResponseFlagTemporary LookupLookupResponseFlag = "temporary" )
func (LookupLookupResponseFlag) IsKnown ¶ added in v0.3.0
func (r LookupLookupResponseFlag) IsKnown() bool
type LookupLookupResponseLineType ¶ added in v0.3.0
type LookupLookupResponseLineType string
The type of phone line.
- `calling_cards` - Numbers that are associated with providers of pre-paid domestic and international calling cards.
- `fixed_line` - Landline phone numbers.
- `isp` - Numbers reserved for Internet Service Providers.
- `local_rate` - Numbers that can be assigned non-geographically.
- `mobile` - Mobile phone numbers.
- `other` - Other types of services.
- `pager` - Number ranges specifically allocated to paging devices.
- `payphone` - Allocated numbers for payphone kiosks in some countries.
- `premium_rate` - Landline numbers where the calling party pays more than standard.
- `satellite` - Satellite phone numbers.
- `service` - Automated applications.
- `shared_cost` - Specific landline ranges where the cost of making the call is shared between the calling and called party.
- `short_codes_commercial` - Short codes are memorable, easy-to-use numbers, like the UK's NHS 111, often sold to businesses. Not available in all countries.
- `toll_free` - Number where the called party pays for the cost of the call not the calling party.
- `universal_access` - Number ranges reserved for Universal Access initiatives.
- `unknown` - Unknown phone number type.
- `vpn` - Numbers are used exclusively within a private telecommunications network, connecting the operator's terminals internally and not accessible via the public telephone network.
- `voice_mail` - A specific category of Interactive Voice Response (IVR) services.
- `voip` - Specific ranges for providers of VoIP services to allow incoming calls from the regular telephony network.
const ( LookupLookupResponseLineTypeCallingCards LookupLookupResponseLineType = "calling_cards" LookupLookupResponseLineTypeFixedLine LookupLookupResponseLineType = "fixed_line" LookupLookupResponseLineTypeIsp LookupLookupResponseLineType = "isp" LookupLookupResponseLineTypeLocalRate LookupLookupResponseLineType = "local_rate" LookupLookupResponseLineTypeMobile LookupLookupResponseLineType = "mobile" LookupLookupResponseLineTypeOther LookupLookupResponseLineType = "other" LookupLookupResponseLineTypePager LookupLookupResponseLineType = "pager" LookupLookupResponseLineTypePayphone LookupLookupResponseLineType = "payphone" LookupLookupResponseLineTypePremiumRate LookupLookupResponseLineType = "premium_rate" LookupLookupResponseLineTypeSatellite LookupLookupResponseLineType = "satellite" LookupLookupResponseLineTypeService LookupLookupResponseLineType = "service" LookupLookupResponseLineTypeShortCodesCommercial LookupLookupResponseLineType = "short_codes_commercial" LookupLookupResponseLineTypeTollFree LookupLookupResponseLineType = "toll_free" LookupLookupResponseLineTypeUniversalAccess LookupLookupResponseLineType = "universal_access" LookupLookupResponseLineTypeUnknown LookupLookupResponseLineType = "unknown" LookupLookupResponseLineTypeVpn LookupLookupResponseLineType = "vpn" LookupLookupResponseLineTypeVoiceMail LookupLookupResponseLineType = "voice_mail" LookupLookupResponseLineTypeVoip LookupLookupResponseLineType = "voip" )
func (LookupLookupResponseLineType) IsKnown ¶ added in v0.3.0
func (r LookupLookupResponseLineType) IsKnown() bool
type LookupLookupResponseNetworkInfo ¶ added in v0.3.0
type LookupLookupResponseNetworkInfo struct { // The name of the carrier. CarrierName string `json:"carrier_name"` // Mobile Country Code. Mcc string `json:"mcc"` // Mobile Network Code. Mnc string `json:"mnc"` JSON lookupLookupResponseNetworkInfoJSON `json:"-"` }
The current carrier information.
func (*LookupLookupResponseNetworkInfo) UnmarshalJSON ¶ added in v0.3.0
func (r *LookupLookupResponseNetworkInfo) UnmarshalJSON(data []byte) (err error)
type LookupLookupResponseOriginalNetworkInfo ¶ added in v0.3.0
type LookupLookupResponseOriginalNetworkInfo struct { // The name of the original carrier. CarrierName string `json:"carrier_name"` // Mobile Country Code. Mcc string `json:"mcc"` // Mobile Network Code. Mnc string `json:"mnc"` JSON lookupLookupResponseOriginalNetworkInfoJSON `json:"-"` }
The original carrier information.
func (*LookupLookupResponseOriginalNetworkInfo) UnmarshalJSON ¶ added in v0.3.0
func (r *LookupLookupResponseOriginalNetworkInfo) UnmarshalJSON(data []byte) (err error)
type LookupService ¶ added in v0.3.0
type LookupService struct {
Options []option.RequestOption
}
LookupService contains methods and other services that help with interacting with the Prelude API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewLookupService method instead.
func NewLookupService ¶ added in v0.3.0
func NewLookupService(opts ...option.RequestOption) (r *LookupService)
NewLookupService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*LookupService) Lookup ¶ added in v0.3.0
func (r *LookupService) Lookup(ctx context.Context, phoneNumber string, query LookupLookupParams, opts ...option.RequestOption) (res *LookupLookupResponse, err error)
Retrieve detailed information about a phone number including carrier data, line type, and portability status.
type TransactionalSendParams ¶
type TransactionalSendParams struct { // The template identifier. TemplateID param.Field[string] `json:"template_id,required"` // The recipient's phone number. To param.Field[string] `json:"to,required"` // The callback URL. CallbackURL param.Field[string] `json:"callback_url"` // A user-defined identifier to correlate this transactional message with. It is // returned in the response and any webhook events that refer to this // transactionalmessage. CorrelationID param.Field[string] `json:"correlation_id"` // The message expiration date. ExpiresAt param.Field[string] `json:"expires_at"` // The Sender ID. From param.Field[string] `json:"from"` // A BCP-47 formatted locale string with the language the text message will be sent // to. If there's no locale set, the language will be determined by the country // code of the phone number. If the language specified doesn't exist, the default // set on the template will be used. Locale param.Field[string] `json:"locale"` // The variables to be replaced in the template. Variables param.Field[map[string]string] `json:"variables"` }
func (TransactionalSendParams) MarshalJSON ¶
func (r TransactionalSendParams) MarshalJSON() (data []byte, err error)
type TransactionalSendResponse ¶
type TransactionalSendResponse struct { // The message identifier. ID string `json:"id,required"` // The message creation date. CreatedAt time.Time `json:"created_at,required" format:"date-time"` // The message expiration date. ExpiresAt time.Time `json:"expires_at,required" format:"date-time"` // The template identifier. TemplateID string `json:"template_id,required"` // The recipient's phone number. To string `json:"to,required"` // The variables to be replaced in the template. Variables map[string]string `json:"variables,required"` // The callback URL. CallbackURL string `json:"callback_url"` // A user-defined identifier to correlate this transactional message with. It is // returned in the response and any webhook events that refer to this transactional // message. CorrelationID string `json:"correlation_id"` // The Sender ID. From string `json:"from"` JSON transactionalSendResponseJSON `json:"-"` }
func (*TransactionalSendResponse) UnmarshalJSON ¶
func (r *TransactionalSendResponse) UnmarshalJSON(data []byte) (err error)
type TransactionalService ¶
type TransactionalService struct {
Options []option.RequestOption
}
TransactionalService contains methods and other services that help with interacting with the Prelude API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewTransactionalService method instead.
func NewTransactionalService ¶
func NewTransactionalService(opts ...option.RequestOption) (r *TransactionalService)
NewTransactionalService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*TransactionalService) Send ¶
func (r *TransactionalService) Send(ctx context.Context, body TransactionalSendParams, opts ...option.RequestOption) (res *TransactionalSendResponse, err error)
Send a transactional message to your user.
type VerificationCheckParams ¶
type VerificationCheckParams struct { // The OTP code to validate. Code param.Field[string] `json:"code,required"` // The verification target. Either a phone number or an email address. To use the // email verification feature contact us to discuss your use case. Target param.Field[VerificationCheckParamsTarget] `json:"target,required"` }
func (VerificationCheckParams) MarshalJSON ¶
func (r VerificationCheckParams) MarshalJSON() (data []byte, err error)
type VerificationCheckParamsTarget ¶
type VerificationCheckParamsTarget struct { // The type of the target. Either "phone_number" or "email_address". Type param.Field[VerificationCheckParamsTargetType] `json:"type,required"` // An E.164 formatted phone number or an email address. Value param.Field[string] `json:"value,required"` }
The verification target. Either a phone number or an email address. To use the email verification feature contact us to discuss your use case.
func (VerificationCheckParamsTarget) MarshalJSON ¶
func (r VerificationCheckParamsTarget) MarshalJSON() (data []byte, err error)
type VerificationCheckParamsTargetType ¶
type VerificationCheckParamsTargetType string
The type of the target. Either "phone_number" or "email_address".
const ( VerificationCheckParamsTargetTypePhoneNumber VerificationCheckParamsTargetType = "phone_number" VerificationCheckParamsTargetTypeEmailAddress VerificationCheckParamsTargetType = "email_address" )
func (VerificationCheckParamsTargetType) IsKnown ¶
func (r VerificationCheckParamsTargetType) IsKnown() bool
type VerificationCheckResponse ¶
type VerificationCheckResponse struct { // The status of the check. Status VerificationCheckResponseStatus `json:"status,required"` // The verification identifier. ID string `json:"id"` // The metadata for this verification. Metadata VerificationCheckResponseMetadata `json:"metadata"` RequestID string `json:"request_id"` JSON verificationCheckResponseJSON `json:"-"` }
func (*VerificationCheckResponse) UnmarshalJSON ¶
func (r *VerificationCheckResponse) UnmarshalJSON(data []byte) (err error)
type VerificationCheckResponseMetadata ¶
type VerificationCheckResponseMetadata struct { // A user-defined identifier to correlate this verification with. It is returned in // the response and any webhook events that refer to this verification. CorrelationID string `json:"correlation_id"` JSON verificationCheckResponseMetadataJSON `json:"-"` }
The metadata for this verification.
func (*VerificationCheckResponseMetadata) UnmarshalJSON ¶
func (r *VerificationCheckResponseMetadata) UnmarshalJSON(data []byte) (err error)
type VerificationCheckResponseStatus ¶
type VerificationCheckResponseStatus string
The status of the check.
const ( VerificationCheckResponseStatusSuccess VerificationCheckResponseStatus = "success" VerificationCheckResponseStatusFailure VerificationCheckResponseStatus = "failure" VerificationCheckResponseStatusExpiredOrNotFound VerificationCheckResponseStatus = "expired_or_not_found" )
func (VerificationCheckResponseStatus) IsKnown ¶
func (r VerificationCheckResponseStatus) IsKnown() bool
type VerificationNewParams ¶
type VerificationNewParams struct { // The verification target. Either a phone number or an email address. To use the // email verification feature contact us to discuss your use case. Target param.Field[VerificationNewParamsTarget] `json:"target,required"` // The identifier of the dispatch that came from the front-end SDK. DispatchID param.Field[string] `json:"dispatch_id"` // The metadata for this verification. This object will be returned with every // response or webhook sent that refers to this verification. Metadata param.Field[VerificationNewParamsMetadata] `json:"metadata"` // Verification options Options param.Field[VerificationNewParamsOptions] `json:"options"` // The signals used for anti-fraud. For more details, refer to // [Signals](/verify/v2/documentation/prevent-fraud#signals). Signals param.Field[VerificationNewParamsSignals] `json:"signals"` }
func (VerificationNewParams) MarshalJSON ¶
func (r VerificationNewParams) MarshalJSON() (data []byte, err error)
type VerificationNewParamsMetadata ¶
type VerificationNewParamsMetadata struct { // A user-defined identifier to correlate this verification with. It is returned in // the response and any webhook events that refer to this verification. CorrelationID param.Field[string] `json:"correlation_id"` }
The metadata for this verification. This object will be returned with every response or webhook sent that refers to this verification.
func (VerificationNewParamsMetadata) MarshalJSON ¶
func (r VerificationNewParamsMetadata) MarshalJSON() (data []byte, err error)
type VerificationNewParamsOptions ¶
type VerificationNewParamsOptions struct { // This allows you to automatically retrieve and fill the OTP code on mobile apps. // Currently only Android devices are supported. AppRealm param.Field[VerificationNewParamsOptionsAppRealm] `json:"app_realm"` // The URL where webhooks will be sent when verification events occur, including // verification creation, attempt creation, and delivery status changes. For more // details, refer to [Webhook](/verify/v2/documentation/webhook). CallbackURL param.Field[string] `json:"callback_url"` // The size of the code generated. It should be between 4 and 8. Defaults to the // code size specified from the Dashboard. CodeSize param.Field[int64] `json:"code_size"` // The custom code to use for OTP verification. To use the custom code feature, // contact us to enable it for your account. For more details, refer to // [Custom Code](/verify/v2/documentation/custom-codes). CustomCode param.Field[string] `json:"custom_code"` // A BCP-47 formatted locale string with the language the text message will be sent // to. If there's no locale set, the language will be determined by the country // code of the phone number. If the language specified doesn't exist, it defaults // to US English. Locale param.Field[string] `json:"locale"` // The method used for verifying this phone number. The 'voice' option provides an // accessible alternative for visually impaired users by delivering the // verification code through a phone call rather than a text message. It also // allows verification of landline numbers that cannot receive SMS messages. Method param.Field[VerificationNewParamsOptionsMethod] `json:"method"` // The preferred channel to be used in priority for verification. PreferredChannel param.Field[VerificationNewParamsOptionsPreferredChannel] `json:"preferred_channel"` // The Sender ID to use for this message. The Sender ID needs to be enabled by // Prelude. SenderID param.Field[string] `json:"sender_id"` // The identifier of a verification template. It applies use case-specific // settings, such as the message content or certain verification parameters. TemplateID param.Field[string] `json:"template_id"` // The variables to be replaced in the template. Variables param.Field[map[string]string] `json:"variables"` }
Verification options
func (VerificationNewParamsOptions) MarshalJSON ¶
func (r VerificationNewParamsOptions) MarshalJSON() (data []byte, err error)
type VerificationNewParamsOptionsAppRealm ¶
type VerificationNewParamsOptionsAppRealm struct { // The platform the SMS will be sent to. We are currently only supporting // "android". Platform param.Field[VerificationNewParamsOptionsAppRealmPlatform] `json:"platform,required"` // The Android SMS Retriever API hash code that identifies your app. Value param.Field[string] `json:"value,required"` }
This allows you to automatically retrieve and fill the OTP code on mobile apps. Currently only Android devices are supported.
func (VerificationNewParamsOptionsAppRealm) MarshalJSON ¶
func (r VerificationNewParamsOptionsAppRealm) MarshalJSON() (data []byte, err error)
type VerificationNewParamsOptionsAppRealmPlatform ¶
type VerificationNewParamsOptionsAppRealmPlatform string
The platform the SMS will be sent to. We are currently only supporting "android".
const (
VerificationNewParamsOptionsAppRealmPlatformAndroid VerificationNewParamsOptionsAppRealmPlatform = "android"
)
func (VerificationNewParamsOptionsAppRealmPlatform) IsKnown ¶
func (r VerificationNewParamsOptionsAppRealmPlatform) IsKnown() bool
type VerificationNewParamsOptionsMethod ¶ added in v0.4.0
type VerificationNewParamsOptionsMethod string
The method used for verifying this phone number. The 'voice' option provides an accessible alternative for visually impaired users by delivering the verification code through a phone call rather than a text message. It also allows verification of landline numbers that cannot receive SMS messages.
const ( VerificationNewParamsOptionsMethodAuto VerificationNewParamsOptionsMethod = "auto" VerificationNewParamsOptionsMethodVoice VerificationNewParamsOptionsMethod = "voice" )
func (VerificationNewParamsOptionsMethod) IsKnown ¶ added in v0.4.0
func (r VerificationNewParamsOptionsMethod) IsKnown() bool
type VerificationNewParamsOptionsPreferredChannel ¶ added in v0.4.0
type VerificationNewParamsOptionsPreferredChannel string
The preferred channel to be used in priority for verification.
const ( VerificationNewParamsOptionsPreferredChannelSMS VerificationNewParamsOptionsPreferredChannel = "sms" VerificationNewParamsOptionsPreferredChannelRcs VerificationNewParamsOptionsPreferredChannel = "rcs" VerificationNewParamsOptionsPreferredChannelWhatsapp VerificationNewParamsOptionsPreferredChannel = "whatsapp" VerificationNewParamsOptionsPreferredChannelViber VerificationNewParamsOptionsPreferredChannel = "viber" VerificationNewParamsOptionsPreferredChannelZalo VerificationNewParamsOptionsPreferredChannel = "zalo" VerificationNewParamsOptionsPreferredChannelTelegram VerificationNewParamsOptionsPreferredChannel = "telegram" )
func (VerificationNewParamsOptionsPreferredChannel) IsKnown ¶ added in v0.4.0
func (r VerificationNewParamsOptionsPreferredChannel) IsKnown() bool
type VerificationNewParamsSignals ¶
type VerificationNewParamsSignals struct { // The version of your application. AppVersion param.Field[string] `json:"app_version"` // The unique identifier for the user's device. For Android, this corresponds to // the `ANDROID_ID` and for iOS, this corresponds to the `identifierForVendor`. DeviceID param.Field[string] `json:"device_id"` // The model of the user's device. DeviceModel param.Field[string] `json:"device_model"` // The type of the user's device. DevicePlatform param.Field[VerificationNewParamsSignalsDevicePlatform] `json:"device_platform"` // The IP address of the user's device. IP param.Field[string] `json:"ip" format:"ipv4"` // This signal should provide a higher level of trust, indicating that the user is // genuine. Contact us to discuss your use case. For more details, refer to // [Signals](/verify/v2/documentation/prevent-fraud#signals). IsTrustedUser param.Field[bool] `json:"is_trusted_user"` // The version of the user's device operating system. OsVersion param.Field[string] `json:"os_version"` // The user agent of the user's device. If the individual fields (os_version, // device_platform, device_model) are provided, we will prioritize those values // instead of parsing them from the user agent string. UserAgent param.Field[string] `json:"user_agent"` }
The signals used for anti-fraud. For more details, refer to [Signals](/verify/v2/documentation/prevent-fraud#signals).
func (VerificationNewParamsSignals) MarshalJSON ¶
func (r VerificationNewParamsSignals) MarshalJSON() (data []byte, err error)
type VerificationNewParamsSignalsDevicePlatform ¶
type VerificationNewParamsSignalsDevicePlatform string
The type of the user's device.
const ( VerificationNewParamsSignalsDevicePlatformAndroid VerificationNewParamsSignalsDevicePlatform = "android" VerificationNewParamsSignalsDevicePlatformIos VerificationNewParamsSignalsDevicePlatform = "ios" VerificationNewParamsSignalsDevicePlatformIpados VerificationNewParamsSignalsDevicePlatform = "ipados" VerificationNewParamsSignalsDevicePlatformTvos VerificationNewParamsSignalsDevicePlatform = "tvos" VerificationNewParamsSignalsDevicePlatformWeb VerificationNewParamsSignalsDevicePlatform = "web" )
func (VerificationNewParamsSignalsDevicePlatform) IsKnown ¶
func (r VerificationNewParamsSignalsDevicePlatform) IsKnown() bool
type VerificationNewParamsTarget ¶
type VerificationNewParamsTarget struct { // The type of the target. Either "phone_number" or "email_address". Type param.Field[VerificationNewParamsTargetType] `json:"type,required"` // An E.164 formatted phone number or an email address. Value param.Field[string] `json:"value,required"` }
The verification target. Either a phone number or an email address. To use the email verification feature contact us to discuss your use case.
func (VerificationNewParamsTarget) MarshalJSON ¶
func (r VerificationNewParamsTarget) MarshalJSON() (data []byte, err error)
type VerificationNewParamsTargetType ¶
type VerificationNewParamsTargetType string
The type of the target. Either "phone_number" or "email_address".
const ( VerificationNewParamsTargetTypePhoneNumber VerificationNewParamsTargetType = "phone_number" VerificationNewParamsTargetTypeEmailAddress VerificationNewParamsTargetType = "email_address" )
func (VerificationNewParamsTargetType) IsKnown ¶
func (r VerificationNewParamsTargetType) IsKnown() bool
type VerificationNewResponse ¶
type VerificationNewResponse struct { // The verification identifier. ID string `json:"id,required"` // The method used for verifying this phone number. Method VerificationNewResponseMethod `json:"method,required"` // The status of the verification. Status VerificationNewResponseStatus `json:"status,required"` // The ordered sequence of channels to be used for verification Channels []VerificationNewResponseChannel `json:"channels"` // The metadata for this verification. Metadata VerificationNewResponseMetadata `json:"metadata"` // The reason why the verification was blocked. Only present when status is // "blocked". Reason VerificationNewResponseReason `json:"reason"` RequestID string `json:"request_id"` // The silent verification specific properties. Silent VerificationNewResponseSilent `json:"silent"` JSON verificationNewResponseJSON `json:"-"` }
func (*VerificationNewResponse) UnmarshalJSON ¶
func (r *VerificationNewResponse) UnmarshalJSON(data []byte) (err error)
type VerificationNewResponseChannel ¶ added in v0.7.0
type VerificationNewResponseChannel string
const ( VerificationNewResponseChannelRcs VerificationNewResponseChannel = "rcs" VerificationNewResponseChannelSilent VerificationNewResponseChannel = "silent" VerificationNewResponseChannelSMS VerificationNewResponseChannel = "sms" VerificationNewResponseChannelTelegram VerificationNewResponseChannel = "telegram" VerificationNewResponseChannelViber VerificationNewResponseChannel = "viber" VerificationNewResponseChannelVoice VerificationNewResponseChannel = "voice" VerificationNewResponseChannelWhatsapp VerificationNewResponseChannel = "whatsapp" VerificationNewResponseChannelZalo VerificationNewResponseChannel = "zalo" )
func (VerificationNewResponseChannel) IsKnown ¶ added in v0.7.0
func (r VerificationNewResponseChannel) IsKnown() bool
type VerificationNewResponseMetadata ¶
type VerificationNewResponseMetadata struct { // A user-defined identifier to correlate this verification with. It is returned in // the response and any webhook events that refer to this verification. CorrelationID string `json:"correlation_id"` JSON verificationNewResponseMetadataJSON `json:"-"` }
The metadata for this verification.
func (*VerificationNewResponseMetadata) UnmarshalJSON ¶
func (r *VerificationNewResponseMetadata) UnmarshalJSON(data []byte) (err error)
type VerificationNewResponseMethod ¶
type VerificationNewResponseMethod string
The method used for verifying this phone number.
const ( VerificationNewResponseMethodEmail VerificationNewResponseMethod = "email" VerificationNewResponseMethodMessage VerificationNewResponseMethod = "message" VerificationNewResponseMethodSilent VerificationNewResponseMethod = "silent" VerificationNewResponseMethodVoice VerificationNewResponseMethod = "voice" )
func (VerificationNewResponseMethod) IsKnown ¶
func (r VerificationNewResponseMethod) IsKnown() bool
type VerificationNewResponseReason ¶ added in v0.5.0
type VerificationNewResponseReason string
The reason why the verification was blocked. Only present when status is "blocked".
const ( VerificationNewResponseReasonExpiredSignature VerificationNewResponseReason = "expired_signature" VerificationNewResponseReasonInBlockList VerificationNewResponseReason = "in_block_list" VerificationNewResponseReasonInvalidPhoneLine VerificationNewResponseReason = "invalid_phone_line" VerificationNewResponseReasonInvalidPhoneNumber VerificationNewResponseReason = "invalid_phone_number" VerificationNewResponseReasonInvalidSignature VerificationNewResponseReason = "invalid_signature" VerificationNewResponseReasonRepeatedAttempts VerificationNewResponseReason = "repeated_attempts" VerificationNewResponseReasonSuspicious VerificationNewResponseReason = "suspicious" )
func (VerificationNewResponseReason) IsKnown ¶ added in v0.5.0
func (r VerificationNewResponseReason) IsKnown() bool
type VerificationNewResponseSilent ¶ added in v0.5.0
type VerificationNewResponseSilent struct { // The URL to start the silent verification towards. RequestURL string `json:"request_url,required"` JSON verificationNewResponseSilentJSON `json:"-"` }
The silent verification specific properties.
func (*VerificationNewResponseSilent) UnmarshalJSON ¶ added in v0.5.0
func (r *VerificationNewResponseSilent) UnmarshalJSON(data []byte) (err error)
type VerificationNewResponseStatus ¶
type VerificationNewResponseStatus string
The status of the verification.
const ( VerificationNewResponseStatusSuccess VerificationNewResponseStatus = "success" VerificationNewResponseStatusRetry VerificationNewResponseStatus = "retry" VerificationNewResponseStatusBlocked VerificationNewResponseStatus = "blocked" )
func (VerificationNewResponseStatus) IsKnown ¶
func (r VerificationNewResponseStatus) IsKnown() bool
type VerificationService ¶
type VerificationService struct {
Options []option.RequestOption
}
VerificationService contains methods and other services that help with interacting with the Prelude API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewVerificationService method instead.
func NewVerificationService ¶
func NewVerificationService(opts ...option.RequestOption) (r *VerificationService)
NewVerificationService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*VerificationService) Check ¶
func (r *VerificationService) Check(ctx context.Context, body VerificationCheckParams, opts ...option.RequestOption) (res *VerificationCheckResponse, err error)
Check the validity of a verification code.
func (*VerificationService) New ¶
func (r *VerificationService) New(ctx context.Context, body VerificationNewParams, opts ...option.RequestOption) (res *VerificationNewResponse, err error)
Create a new verification for a specific phone number. If another non-expired verification exists (the request is performed within the verification window), this endpoint will perform a retry instead.
type WatchPredictParams ¶
type WatchPredictParams struct { // The prediction target. Only supports phone numbers for now. Target param.Field[WatchPredictParamsTarget] `json:"target,required"` // The identifier of the dispatch that came from the front-end SDK. DispatchID param.Field[string] `json:"dispatch_id"` // The metadata for this prediction. Metadata param.Field[WatchPredictParamsMetadata] `json:"metadata"` // The signals used for anti-fraud. For more details, refer to // [Signals](/verify/v2/documentation/prevent-fraud#signals). Signals param.Field[WatchPredictParamsSignals] `json:"signals"` }
func (WatchPredictParams) MarshalJSON ¶
func (r WatchPredictParams) MarshalJSON() (data []byte, err error)
type WatchPredictParamsMetadata ¶ added in v0.3.0
type WatchPredictParamsMetadata struct { // A user-defined identifier to correlate this prediction with. It is returned in // the response and any webhook events that refer to this prediction. CorrelationID param.Field[string] `json:"correlation_id"` }
The metadata for this prediction.
func (WatchPredictParamsMetadata) MarshalJSON ¶ added in v0.3.0
func (r WatchPredictParamsMetadata) MarshalJSON() (data []byte, err error)
type WatchPredictParamsSignals ¶
type WatchPredictParamsSignals struct { // The version of your application. AppVersion param.Field[string] `json:"app_version"` // The unique identifier for the user's device. For Android, this corresponds to // the `ANDROID_ID` and for iOS, this corresponds to the `identifierForVendor`. DeviceID param.Field[string] `json:"device_id"` // The model of the user's device. DeviceModel param.Field[string] `json:"device_model"` // The type of the user's device. DevicePlatform param.Field[WatchPredictParamsSignalsDevicePlatform] `json:"device_platform"` // The IP address of the user's device. IP param.Field[string] `json:"ip" format:"ipv4"` // This signal should provide a higher level of trust, indicating that the user is // genuine. Contact us to discuss your use case. For more details, refer to // [Signals](/verify/v2/documentation/prevent-fraud#signals). IsTrustedUser param.Field[bool] `json:"is_trusted_user"` // The version of the user's device operating system. OsVersion param.Field[string] `json:"os_version"` // The user agent of the user's device. If the individual fields (os_version, // device_platform, device_model) are provided, we will prioritize those values // instead of parsing them from the user agent string. UserAgent param.Field[string] `json:"user_agent"` }
The signals used for anti-fraud. For more details, refer to [Signals](/verify/v2/documentation/prevent-fraud#signals).
func (WatchPredictParamsSignals) MarshalJSON ¶
func (r WatchPredictParamsSignals) MarshalJSON() (data []byte, err error)
type WatchPredictParamsSignalsDevicePlatform ¶ added in v0.3.0
type WatchPredictParamsSignalsDevicePlatform string
The type of the user's device.
const ( WatchPredictParamsSignalsDevicePlatformAndroid WatchPredictParamsSignalsDevicePlatform = "android" WatchPredictParamsSignalsDevicePlatformIos WatchPredictParamsSignalsDevicePlatform = "ios" WatchPredictParamsSignalsDevicePlatformIpados WatchPredictParamsSignalsDevicePlatform = "ipados" WatchPredictParamsSignalsDevicePlatformTvos WatchPredictParamsSignalsDevicePlatform = "tvos" WatchPredictParamsSignalsDevicePlatformWeb WatchPredictParamsSignalsDevicePlatform = "web" )
func (WatchPredictParamsSignalsDevicePlatform) IsKnown ¶ added in v0.3.0
func (r WatchPredictParamsSignalsDevicePlatform) IsKnown() bool
type WatchPredictParamsTarget ¶
type WatchPredictParamsTarget struct { // The type of the target. Either "phone_number" or "email_address". Type param.Field[WatchPredictParamsTargetType] `json:"type,required"` // An E.164 formatted phone number or an email address. Value param.Field[string] `json:"value,required"` }
The prediction target. Only supports phone numbers for now.
func (WatchPredictParamsTarget) MarshalJSON ¶
func (r WatchPredictParamsTarget) MarshalJSON() (data []byte, err error)
type WatchPredictParamsTargetType ¶
type WatchPredictParamsTargetType string
The type of the target. Either "phone_number" or "email_address".
const ( WatchPredictParamsTargetTypePhoneNumber WatchPredictParamsTargetType = "phone_number" WatchPredictParamsTargetTypeEmailAddress WatchPredictParamsTargetType = "email_address" )
func (WatchPredictParamsTargetType) IsKnown ¶
func (r WatchPredictParamsTargetType) IsKnown() bool
type WatchPredictResponse ¶
type WatchPredictResponse struct { // The prediction identifier. ID string `json:"id,required"` // The prediction outcome. Prediction WatchPredictResponsePrediction `json:"prediction,required"` // A string that identifies this specific request. Report it back to us to help us // diagnose your issues. RequestID string `json:"request_id,required"` JSON watchPredictResponseJSON `json:"-"` }
func (*WatchPredictResponse) UnmarshalJSON ¶
func (r *WatchPredictResponse) UnmarshalJSON(data []byte) (err error)
type WatchPredictResponsePrediction ¶
type WatchPredictResponsePrediction string
The prediction outcome.
const ( WatchPredictResponsePredictionLegitimate WatchPredictResponsePrediction = "legitimate" WatchPredictResponsePredictionSuspicious WatchPredictResponsePrediction = "suspicious" )
func (WatchPredictResponsePrediction) IsKnown ¶
func (r WatchPredictResponsePrediction) IsKnown() bool
type WatchSendEventsParams ¶ added in v0.3.0
type WatchSendEventsParams struct { // A list of events to dispatch. Events param.Field[[]WatchSendEventsParamsEvent] `json:"events,required"` }
func (WatchSendEventsParams) MarshalJSON ¶ added in v0.3.0
func (r WatchSendEventsParams) MarshalJSON() (data []byte, err error)
type WatchSendEventsParamsEvent ¶ added in v0.3.0
type WatchSendEventsParamsEvent struct { // A confidence level you want to assign to the event. Confidence param.Field[WatchSendEventsParamsEventsConfidence] `json:"confidence,required"` // A label to describe what the event refers to. Label param.Field[string] `json:"label,required"` // The event target. Only supports phone numbers for now. Target param.Field[WatchSendEventsParamsEventsTarget] `json:"target,required"` }
func (WatchSendEventsParamsEvent) MarshalJSON ¶ added in v0.3.0
func (r WatchSendEventsParamsEvent) MarshalJSON() (data []byte, err error)
type WatchSendEventsParamsEventsConfidence ¶ added in v0.3.0
type WatchSendEventsParamsEventsConfidence string
A confidence level you want to assign to the event.
const ( WatchSendEventsParamsEventsConfidenceMaximum WatchSendEventsParamsEventsConfidence = "maximum" WatchSendEventsParamsEventsConfidenceHigh WatchSendEventsParamsEventsConfidence = "high" WatchSendEventsParamsEventsConfidenceNeutral WatchSendEventsParamsEventsConfidence = "neutral" WatchSendEventsParamsEventsConfidenceLow WatchSendEventsParamsEventsConfidence = "low" WatchSendEventsParamsEventsConfidenceMinimum WatchSendEventsParamsEventsConfidence = "minimum" )
func (WatchSendEventsParamsEventsConfidence) IsKnown ¶ added in v0.3.0
func (r WatchSendEventsParamsEventsConfidence) IsKnown() bool
type WatchSendEventsParamsEventsTarget ¶ added in v0.3.0
type WatchSendEventsParamsEventsTarget struct { // The type of the target. Either "phone_number" or "email_address". Type param.Field[WatchSendEventsParamsEventsTargetType] `json:"type,required"` // An E.164 formatted phone number or an email address. Value param.Field[string] `json:"value,required"` }
The event target. Only supports phone numbers for now.
func (WatchSendEventsParamsEventsTarget) MarshalJSON ¶ added in v0.3.0
func (r WatchSendEventsParamsEventsTarget) MarshalJSON() (data []byte, err error)
type WatchSendEventsParamsEventsTargetType ¶ added in v0.3.0
type WatchSendEventsParamsEventsTargetType string
The type of the target. Either "phone_number" or "email_address".
const ( WatchSendEventsParamsEventsTargetTypePhoneNumber WatchSendEventsParamsEventsTargetType = "phone_number" WatchSendEventsParamsEventsTargetTypeEmailAddress WatchSendEventsParamsEventsTargetType = "email_address" )
func (WatchSendEventsParamsEventsTargetType) IsKnown ¶ added in v0.3.0
func (r WatchSendEventsParamsEventsTargetType) IsKnown() bool
type WatchSendEventsResponse ¶ added in v0.3.0
type WatchSendEventsResponse struct { // A string that identifies this specific request. Report it back to us to help us // diagnose your issues. RequestID string `json:"request_id,required"` // The status of the events dispatch. Status WatchSendEventsResponseStatus `json:"status,required"` JSON watchSendEventsResponseJSON `json:"-"` }
func (*WatchSendEventsResponse) UnmarshalJSON ¶ added in v0.3.0
func (r *WatchSendEventsResponse) UnmarshalJSON(data []byte) (err error)
type WatchSendEventsResponseStatus ¶ added in v0.3.0
type WatchSendEventsResponseStatus string
The status of the events dispatch.
const (
WatchSendEventsResponseStatusSuccess WatchSendEventsResponseStatus = "success"
)
func (WatchSendEventsResponseStatus) IsKnown ¶ added in v0.3.0
func (r WatchSendEventsResponseStatus) IsKnown() bool
type WatchSendFeedbacksParams ¶ added in v0.3.0
type WatchSendFeedbacksParams struct { // A list of feedbacks to send. Feedbacks param.Field[[]WatchSendFeedbacksParamsFeedback] `json:"feedbacks,required"` }
func (WatchSendFeedbacksParams) MarshalJSON ¶ added in v0.3.0
func (r WatchSendFeedbacksParams) MarshalJSON() (data []byte, err error)
type WatchSendFeedbacksParamsFeedback ¶ added in v0.3.0
type WatchSendFeedbacksParamsFeedback struct { // The feedback target. Only supports phone numbers for now. Target param.Field[WatchSendFeedbacksParamsFeedbacksTarget] `json:"target,required"` // The type of feedback. Type param.Field[WatchSendFeedbacksParamsFeedbacksType] `json:"type,required"` // The identifier of the dispatch that came from the front-end SDK. DispatchID param.Field[string] `json:"dispatch_id"` // The metadata for this feedback. Metadata param.Field[WatchSendFeedbacksParamsFeedbacksMetadata] `json:"metadata"` // The signals used for anti-fraud. For more details, refer to // [Signals](/verify/v2/documentation/prevent-fraud#signals). Signals param.Field[WatchSendFeedbacksParamsFeedbacksSignals] `json:"signals"` }
func (WatchSendFeedbacksParamsFeedback) MarshalJSON ¶ added in v0.3.0
func (r WatchSendFeedbacksParamsFeedback) MarshalJSON() (data []byte, err error)
type WatchSendFeedbacksParamsFeedbacksMetadata ¶ added in v0.3.0
type WatchSendFeedbacksParamsFeedbacksMetadata struct { // A user-defined identifier to correlate this feedback with. It is returned in the // response and any webhook events that refer to this feedback. CorrelationID param.Field[string] `json:"correlation_id"` }
The metadata for this feedback.
func (WatchSendFeedbacksParamsFeedbacksMetadata) MarshalJSON ¶ added in v0.3.0
func (r WatchSendFeedbacksParamsFeedbacksMetadata) MarshalJSON() (data []byte, err error)
type WatchSendFeedbacksParamsFeedbacksSignals ¶ added in v0.3.0
type WatchSendFeedbacksParamsFeedbacksSignals struct { // The version of your application. AppVersion param.Field[string] `json:"app_version"` // The unique identifier for the user's device. For Android, this corresponds to // the `ANDROID_ID` and for iOS, this corresponds to the `identifierForVendor`. DeviceID param.Field[string] `json:"device_id"` // The model of the user's device. DeviceModel param.Field[string] `json:"device_model"` // The type of the user's device. DevicePlatform param.Field[WatchSendFeedbacksParamsFeedbacksSignalsDevicePlatform] `json:"device_platform"` // The IP address of the user's device. IP param.Field[string] `json:"ip" format:"ipv4"` // This signal should provide a higher level of trust, indicating that the user is // genuine. Contact us to discuss your use case. For more details, refer to // [Signals](/verify/v2/documentation/prevent-fraud#signals). IsTrustedUser param.Field[bool] `json:"is_trusted_user"` // The version of the user's device operating system. OsVersion param.Field[string] `json:"os_version"` // The user agent of the user's device. If the individual fields (os_version, // device_platform, device_model) are provided, we will prioritize those values // instead of parsing them from the user agent string. UserAgent param.Field[string] `json:"user_agent"` }
The signals used for anti-fraud. For more details, refer to [Signals](/verify/v2/documentation/prevent-fraud#signals).
func (WatchSendFeedbacksParamsFeedbacksSignals) MarshalJSON ¶ added in v0.3.0
func (r WatchSendFeedbacksParamsFeedbacksSignals) MarshalJSON() (data []byte, err error)
type WatchSendFeedbacksParamsFeedbacksSignalsDevicePlatform ¶ added in v0.3.0
type WatchSendFeedbacksParamsFeedbacksSignalsDevicePlatform string
The type of the user's device.
const ( WatchSendFeedbacksParamsFeedbacksSignalsDevicePlatformAndroid WatchSendFeedbacksParamsFeedbacksSignalsDevicePlatform = "android" WatchSendFeedbacksParamsFeedbacksSignalsDevicePlatformIos WatchSendFeedbacksParamsFeedbacksSignalsDevicePlatform = "ios" WatchSendFeedbacksParamsFeedbacksSignalsDevicePlatformIpados WatchSendFeedbacksParamsFeedbacksSignalsDevicePlatform = "ipados" WatchSendFeedbacksParamsFeedbacksSignalsDevicePlatformTvos WatchSendFeedbacksParamsFeedbacksSignalsDevicePlatform = "tvos" WatchSendFeedbacksParamsFeedbacksSignalsDevicePlatformWeb WatchSendFeedbacksParamsFeedbacksSignalsDevicePlatform = "web" )
func (WatchSendFeedbacksParamsFeedbacksSignalsDevicePlatform) IsKnown ¶ added in v0.3.0
func (r WatchSendFeedbacksParamsFeedbacksSignalsDevicePlatform) IsKnown() bool
type WatchSendFeedbacksParamsFeedbacksTarget ¶ added in v0.3.0
type WatchSendFeedbacksParamsFeedbacksTarget struct { // The type of the target. Either "phone_number" or "email_address". Type param.Field[WatchSendFeedbacksParamsFeedbacksTargetType] `json:"type,required"` // An E.164 formatted phone number or an email address. Value param.Field[string] `json:"value,required"` }
The feedback target. Only supports phone numbers for now.
func (WatchSendFeedbacksParamsFeedbacksTarget) MarshalJSON ¶ added in v0.3.0
func (r WatchSendFeedbacksParamsFeedbacksTarget) MarshalJSON() (data []byte, err error)
type WatchSendFeedbacksParamsFeedbacksTargetType ¶ added in v0.3.0
type WatchSendFeedbacksParamsFeedbacksTargetType string
The type of the target. Either "phone_number" or "email_address".
const ( WatchSendFeedbacksParamsFeedbacksTargetTypePhoneNumber WatchSendFeedbacksParamsFeedbacksTargetType = "phone_number" WatchSendFeedbacksParamsFeedbacksTargetTypeEmailAddress WatchSendFeedbacksParamsFeedbacksTargetType = "email_address" )
func (WatchSendFeedbacksParamsFeedbacksTargetType) IsKnown ¶ added in v0.3.0
func (r WatchSendFeedbacksParamsFeedbacksTargetType) IsKnown() bool
type WatchSendFeedbacksParamsFeedbacksType ¶ added in v0.3.0
type WatchSendFeedbacksParamsFeedbacksType string
The type of feedback.
const ( WatchSendFeedbacksParamsFeedbacksTypeVerificationStarted WatchSendFeedbacksParamsFeedbacksType = "verification.started" WatchSendFeedbacksParamsFeedbacksTypeVerificationCompleted WatchSendFeedbacksParamsFeedbacksType = "verification.completed" )
func (WatchSendFeedbacksParamsFeedbacksType) IsKnown ¶ added in v0.3.0
func (r WatchSendFeedbacksParamsFeedbacksType) IsKnown() bool
type WatchSendFeedbacksResponse ¶ added in v0.3.0
type WatchSendFeedbacksResponse struct { // A string that identifies this specific request. Report it back to us to help us // diagnose your issues. RequestID string `json:"request_id,required"` // The status of the feedbacks sending. Status WatchSendFeedbacksResponseStatus `json:"status,required"` JSON watchSendFeedbacksResponseJSON `json:"-"` }
func (*WatchSendFeedbacksResponse) UnmarshalJSON ¶ added in v0.3.0
func (r *WatchSendFeedbacksResponse) UnmarshalJSON(data []byte) (err error)
type WatchSendFeedbacksResponseStatus ¶ added in v0.3.0
type WatchSendFeedbacksResponseStatus string
The status of the feedbacks sending.
const (
WatchSendFeedbacksResponseStatusSuccess WatchSendFeedbacksResponseStatus = "success"
)
func (WatchSendFeedbacksResponseStatus) IsKnown ¶ added in v0.3.0
func (r WatchSendFeedbacksResponseStatus) IsKnown() bool
type WatchService ¶
type WatchService struct {
Options []option.RequestOption
}
WatchService contains methods and other services that help with interacting with the Prelude API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewWatchService method instead.
func NewWatchService ¶
func NewWatchService(opts ...option.RequestOption) (r *WatchService)
NewWatchService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*WatchService) Predict ¶
func (r *WatchService) Predict(ctx context.Context, body WatchPredictParams, opts ...option.RequestOption) (res *WatchPredictResponse, err error)
Predict the outcome of a verification based on Prelude’s anti-fraud system.
func (*WatchService) SendEvents ¶ added in v0.3.0
func (r *WatchService) SendEvents(ctx context.Context, body WatchSendEventsParams, opts ...option.RequestOption) (res *WatchSendEventsResponse, err error)
Send real-time event data from end-user interactions within your application. Events will be analyzed for proactive fraud prevention and risk scoring.
func (*WatchService) SendFeedbacks ¶ added in v0.3.0
func (r *WatchService) SendFeedbacks(ctx context.Context, body WatchSendFeedbacksParams, opts ...option.RequestOption) (res *WatchSendFeedbacksResponse, err error)
Send feedback regarding your end-users verification funnel. Events will be analyzed for proactive fraud prevention and risk scoring.