sdk

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: MIT Imports: 18 Imported by: 1

Documentation

Overview

* Fingerprint Pro Server API * * Fingerprint Pro Server API provides a way for validating visitors’ data issued by Fingerprint Pro. * * API version: 3 * Contact: support@fingerprint.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Fingerprint Pro Server API * * Fingerprint Pro Server API provides a way for validating visitors’ data issued by Fingerprint Pro. * * API version: 3 * Contact: support@fingerprint.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Fingerprint Pro Server API * * Fingerprint Pro Server API provides a way for validating visitors’ data issued by Fingerprint Pro. * * API version: 3 * Contact: support@fingerprint.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Fingerprint Pro Server API * * Fingerprint Pro Server API provides a way for validating visitors’ data issued by Fingerprint Pro. * * API version: 3 * Contact: support@fingerprint.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Fingerprint Pro Server API * * Fingerprint Pro Server API provides a way for validating visitors’ data issued by Fingerprint Pro. * * API version: 3 * Contact: support@fingerprint.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Fingerprint Pro Server API * * Fingerprint Pro Server API provides a way for validating visitors’ data issued by Fingerprint Pro. * * API version: 3 * Contact: support@fingerprint.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Fingerprint Pro Server API * * Fingerprint Pro Server API provides a way for validating visitors’ data issued by Fingerprint Pro. * * API version: 3 * Contact: support@fingerprint.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Fingerprint Pro Server API * * Fingerprint Pro Server API provides a way for validating visitors’ data issued by Fingerprint Pro. * * API version: 3 * Contact: support@fingerprint.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Fingerprint Pro Server API * * Fingerprint Pro Server API provides a way for validating visitors’ data issued by Fingerprint Pro. * * API version: 3 * Contact: support@fingerprint.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Fingerprint Pro Server API * * Fingerprint Pro Server API provides a way for validating visitors’ data issued by Fingerprint Pro. * * API version: 3 * Contact: support@fingerprint.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Fingerprint Pro Server API * * Fingerprint Pro Server API provides a way for validating visitors’ data issued by Fingerprint Pro. * * API version: 3 * Contact: support@fingerprint.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Fingerprint Pro Server API * * Fingerprint Pro Server API provides a way for validating visitors’ data issued by Fingerprint Pro. * * API version: 3 * Contact: support@fingerprint.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Fingerprint Pro Server API * * Fingerprint Pro Server API provides a way for validating visitors’ data issued by Fingerprint Pro. * * API version: 3 * Contact: support@fingerprint.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Fingerprint Pro Server API * * Fingerprint Pro Server API provides a way for validating visitors’ data issued by Fingerprint Pro. * * API version: 3 * Contact: support@fingerprint.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Fingerprint Pro Server API * * Fingerprint Pro Server API provides a way for validating visitors’ data issued by Fingerprint Pro. * * API version: 3 * Contact: support@fingerprint.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Fingerprint Pro Server API * * Fingerprint Pro Server API provides a way for validating visitors’ data issued by Fingerprint Pro. * * API version: 3 * Contact: support@fingerprint.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Fingerprint Pro Server API * * Fingerprint Pro Server API provides a way for validating visitors’ data issued by Fingerprint Pro. * * API version: 3 * Contact: support@fingerprint.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Fingerprint Pro Server API * * Fingerprint Pro Server API provides a way for validating visitors’ data issued by Fingerprint Pro. * * API version: 3 * Contact: support@fingerprint.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Fingerprint Pro Server API * * Fingerprint Pro Server API provides a way for validating visitors’ data issued by Fingerprint Pro. * * API version: 3 * Contact: support@fingerprint.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Fingerprint Pro Server API * * Fingerprint Pro Server API provides a way for validating visitors’ data issued by Fingerprint Pro. * * API version: 3 * Contact: support@fingerprint.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Fingerprint Pro Server API * * Fingerprint Pro Server API provides a way for validating visitors’ data issued by Fingerprint Pro. * * API version: 3 * Contact: support@fingerprint.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Fingerprint Pro Server API * * Fingerprint Pro Server API provides a way for validating visitors’ data issued by Fingerprint Pro. * * API version: 3 * Contact: support@fingerprint.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Fingerprint Pro Server API * * Fingerprint Pro Server API provides a way for validating visitors’ data issued by Fingerprint Pro. * * API version: 3 * Contact: support@fingerprint.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Fingerprint Pro Server API * * Fingerprint Pro Server API provides a way for validating visitors’ data issued by Fingerprint Pro. * * API version: 3 * Contact: support@fingerprint.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Fingerprint Pro Server API * * Fingerprint Pro Server API provides a way for validating visitors’ data issued by Fingerprint Pro. * * API version: 3 * Contact: support@fingerprint.com * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

Index

Constants

This section is empty.

Variables

View Source
var (
	// ContextOAuth2 takes a oauth2.TokenSource as authentication for the request.
	ContextOAuth2 = contextKey("token")

	// ContextBasicAuth takes BasicAuth as authentication for the request.
	ContextBasicAuth = contextKey("basic")

	// ContextAccessToken takes a string oauth2 access token as authentication for the request.
	ContextAccessToken = contextKey("accesstoken")

	// ContextAPIKey takes an APIKey as authentication for the request
	ContextAPIKey = contextKey("apikey")
)

Functions

This section is empty.

Types

type APIClient

type APIClient struct {
	FingerprintApi *FingerprintApiService
	// contains filtered or unexported fields
}

APIClient manages communication with the Fingerprint Pro Server API API v3 In most cases there should be only one, shared, APIClient.

func NewAPIClient

func NewAPIClient(cfg *Configuration) *APIClient

NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.

type APIKey

type APIKey struct {
	Key    string
	Prefix string
}

APIKey provides API key based authentication to a request passed via context using ContextAPIKey

type APIResponse

type APIResponse struct {
	*http.Response `json:"-"`
	Message        string `json:"message,omitempty"`
	// Operation is the name of the swagger operation.
	Operation string `json:"operation,omitempty"`
	// RequestURL is the request URL. This value is always available, even if the
	// embedded *http.Response is nil.
	RequestURL string `json:"url,omitempty"`
	// Method is the HTTP method used for the request.  This value is always
	// available, even if the embedded *http.Response is nil.
	Method string `json:"method,omitempty"`
	// Payload holds the contents of the response body (which may be nil or empty).
	// This is provided here as the raw response.Body() reader will have already
	// been drained.
	Payload []byte `json:"-"`
}

func NewAPIResponse

func NewAPIResponse(r *http.Response) *APIResponse

func NewAPIResponseWithError

func NewAPIResponseWithError(errorMessage string) *APIResponse

type BasicAuth

type BasicAuth struct {
	UserName string `json:"userName,omitempty"`
	Password string `json:"password,omitempty"`
}

BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth

type BotdDetectionResult added in v1.1.0

type BotdDetectionResult struct {
	// Bot detection result:  * `notDetected` - the visitor is not a bot  * `good` - good bot detected, such as Google bot, Baidu Spider, AlexaBot and so on  * `bad` - bad bot detected, such as Selenium, Puppeteer, Playwright, headless browsers, and so on
	Result string `json:"result"`
}

Stores bot detection result

type BotdResult added in v1.1.0

type BotdResult struct {
	// IP address of the requesting browser or bot.
	Ip string `json:"ip"`
	// Time in UTC when the request from the JS agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible
	Time *time.Time `json:"time"`
	// Page URL from which identification request was sent.
	Url string               `json:"url"`
	Bot *BotdDetectionResult `json:"bot"`
}

Contains all the information from BOTD product

type BrowserDetails

type BrowserDetails struct {
	BrowserName         string `json:"browserName"`
	BrowserMajorVersion string `json:"browserMajorVersion"`
	BrowserFullVersion  string `json:"browserFullVersion"`
	Os                  string `json:"os"`
	OsVersion           string `json:"osVersion"`
	Device              string `json:"device"`
	UserAgent           string `json:"userAgent"`
	BotProbability      int32  `json:"botProbability,omitempty"`
}

type Confidence

type Confidence struct {
	// The confidence score is a floating-point number between 0 and 1 that represents the probability of accurate identification.
	Score float32 `json:"score"`
}

type Configuration

type Configuration struct {
	Host          string            `json:"host,omitempty"`
	Scheme        string            `json:"scheme,omitempty"`
	DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
	UserAgent     string            `json:"userAgent,omitempty"`
	HTTPClient    *http.Client
	// contains filtered or unexported fields
}

func NewConfiguration

func NewConfiguration() *Configuration

func (*Configuration) AddDefaultHeader

func (c *Configuration) AddDefaultHeader(key string, value string)

func (*Configuration) ChangeBasePath

func (c *Configuration) ChangeBasePath(path string)

ChangeBasePath Change base path to allow switching to mocks

func (*Configuration) ChangeRegion

func (c *Configuration) ChangeRegion(region Region)

ChangeRegion Changes region and sets basePath for it

func (*Configuration) GetBasePath

func (c *Configuration) GetBasePath() string

func (*Configuration) GetRegion

func (c *Configuration) GetRegion() Region

type ErrorResponse added in v1.1.0

type ErrorResponse struct {
	Error_ *ErrorResponseError `json:"error,omitempty"`
}

type ErrorResponseError added in v1.1.0

type ErrorResponseError struct {
	Code    string `json:"code,omitempty"`
	Message string `json:"message,omitempty"`
}

type EventResponse added in v1.1.0

type EventResponse struct {
	Products *ProductsResponse `json:"products,omitempty"`
}

Contains event from activated products - BOTD and Identification

type FingerprintApiGetVisitsOpts

type FingerprintApiGetVisitsOpts struct {
	RequestId optional.String
	LinkedId  optional.String
	Limit     optional.Int32
	Before    optional.Int32
}

type FingerprintApiService

type FingerprintApiService service

func (*FingerprintApiService) GetEvent added in v1.1.0

func (a *FingerprintApiService) GetEvent(ctx context.Context, requestId string) (EventResponse, *http.Response, error)

FingerprintApiService Get event by request ID This endpoint allows you to get events with all the information from each activated product - BOTD and Fingerprinting. Use the requestId as a URL path :request_id parameter. This API method is scoped to a request, i.e. all returned information is by requestId.

  • @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param requestId Request ID

@return EventResponse

func (*FingerprintApiService) GetVisits

func (a *FingerprintApiService) GetVisits(ctx context.Context, visitorId string, localVarOptionals *FingerprintApiGetVisitsOpts) (Response, *http.Response, error)

type GenericSwaggerError

type GenericSwaggerError struct {
	// contains filtered or unexported fields
}

GenericSwaggerError Provides access to the body, error and model on returned errors.

func (GenericSwaggerError) Body

func (e GenericSwaggerError) Body() []byte

Body returns the raw bytes of the response

func (GenericSwaggerError) Error

func (e GenericSwaggerError) Error() string

Error returns non-empty string if there was an error.

func (GenericSwaggerError) Model

func (e GenericSwaggerError) Model() interface{}

Model returns the unpacked model of the error

type IpLocation

type IpLocation struct {
	AccuracyRadius int32           `json:"accuracyRadius"`
	Latitude       float64         `json:"latitude"`
	Longitude      float64         `json:"longitude"`
	PostalCode     string          `json:"postalCode,omitempty"`
	Timezone       string          `json:"timezone"`
	City           *IpLocationCity `json:"city,omitempty"`
	Country        *Location       `json:"country"`
	Continent      *Location       `json:"continent"`
	Subdivisions   []Subdivision   `json:"subdivisions,omitempty"`
}

type IpLocationCity

type IpLocationCity struct {
	Name string `json:"name,omitempty"`
}

type Location

type Location struct {
	Code string `json:"code"`
	Name string `json:"name"`
}

type ManyRequestsResponse

type ManyRequestsResponse struct {
	// Error text.
	Error_ string `json:"error"`
}

type Model

type Model struct{}

type ModelMap

type ModelMap map[string]string

type ProductsResponse added in v1.1.0

type ProductsResponse struct {
	Identification *ProductsResponseIdentification `json:"identification,omitempty"`
	Botd           *ProductsResponseBotd           `json:"botd,omitempty"`
}

Contains all the information from each activated product - BOTD and Identification

type ProductsResponseBotd added in v1.1.0

type ProductsResponseBotd struct {
	Data *BotdResult `json:"data,omitempty"`
}

type ProductsResponseIdentification added in v1.1.0

type ProductsResponseIdentification struct {
	Data *ProductsResponseIdentificationData `json:"data,omitempty"`
}

type ProductsResponseIdentificationData added in v1.1.0

type ProductsResponseIdentificationData struct {
	// Unique identifier of the user's identification request.
	RequestId      string          `json:"requestId"`
	BrowserDetails *BrowserDetails `json:"browserDetails"`
	// Flag if user used incognito session.
	Incognito  bool        `json:"incognito"`
	Ip         string      `json:"ip"`
	IpLocation *IpLocation `json:"ipLocation"`
	// Timestamp of the event with millisecond precision in Unix time.
	Timestamp int64 `json:"timestamp"`
	// Time expressed according to ISO 8601 in UTC format.
	Time *time.Time `json:"time"`
	// Page URL from which identification request was sent.
	Url string `json:"url"`
	// A customer-provided value or an object that was sent with identification request.
	Tag ModelMap `json:"tag,omitempty"`
	// A customer-provided id that was sent with identification request.
	LinkedId   string      `json:"linkedId,omitempty"`
	Confidence *Confidence `json:"confidence"`
	// Attribute represents if a visitor had been identified before.
	VisitorFound bool      `json:"visitorFound"`
	FirstSeenAt  *StSeenAt `json:"firstSeenAt"`
	LastSeenAt   *StSeenAt `json:"lastSeenAt"`
	VisitorId    string    `json:"visitorId"`
}

type Region

type Region string
const (
	RegionEU   Region = "eu"
	RegionUS   Region = "us"
	RegionAsia Region = "asia"
)

type Response

type Response struct {
	VisitorId string           `json:"visitorId"`
	Visits    []ResponseVisits `json:"visits"`
	// When more results are available (e.g., you scanned 200 results using `limit` parameter, but a total of 600 results are available), a special `lastTimestamp` top-level attribute is added to the response. If you want to paginate the results further in the past, you should use the value of this attribute.
	LastTimestamp int64 `json:"lastTimestamp,omitempty"`
	// Visit's `requestId` of the last visit in the current page.
	PaginationKey string `json:"paginationKey,omitempty"`
}

Fields `lastTimestamp` and `paginationKey` added when `limit` or `before` parameter provided and there is more data to show

type ResponseVisits added in v1.1.0

type ResponseVisits struct {
	// Unique identifier of the user's identification request.
	RequestId      string          `json:"requestId"`
	BrowserDetails *BrowserDetails `json:"browserDetails"`
	// Flag if user used incognito session.
	Incognito  bool        `json:"incognito"`
	Ip         string      `json:"ip"`
	IpLocation *IpLocation `json:"ipLocation"`
	// Timestamp of the event with millisecond precision in Unix time.
	Timestamp int64 `json:"timestamp"`
	// Time expressed according to ISO 8601 in UTC format.
	Time *time.Time `json:"time"`
	// Page URL from which identification request was sent.
	Url string `json:"url"`
	// A customer-provided value or an object that was sent with identification request.
	Tag ModelMap `json:"tag"`
	// A customer-provided id that was sent with identification request.
	LinkedId   string      `json:"linkedId,omitempty"`
	Confidence *Confidence `json:"confidence"`
	// Attribute represents if a visitor had been identified before.
	VisitorFound bool      `json:"visitorFound"`
	FirstSeenAt  *StSeenAt `json:"firstSeenAt"`
	LastSeenAt   *StSeenAt `json:"lastSeenAt"`
}

type StSeenAt

type StSeenAt struct {
	Global       *time.Time `json:"global"`
	Subscription *time.Time `json:"subscription"`
}

type Subdivision

type Subdivision struct {
	IsoCode string `json:"isoCode,omitempty"`
	Name    string `json:"name,omitempty"`
}

type Visit

type Visit struct {
	// Unique identifier of the user's identification request.
	RequestId      string          `json:"requestId"`
	BrowserDetails *BrowserDetails `json:"browserDetails"`
	// Flag if user used incognito session.
	Incognito  bool        `json:"incognito"`
	Ip         string      `json:"ip"`
	IpLocation *IpLocation `json:"ipLocation"`
	// Timestamp of the event with millisecond precision in Unix time.
	Timestamp int64 `json:"timestamp"`
	// Time expressed according to ISO 8601 in UTC format.
	Time *time.Time `json:"time"`
	// Page URL from which identification request was sent.
	Url string `json:"url"`
	// A customer-provided value or an object that was sent with identification request.
	Tag ModelMap `json:"tag,omitempty"`
	// A customer-provided id that was sent with identification request.
	LinkedId   string      `json:"linkedId,omitempty"`
	Confidence *Confidence `json:"confidence"`
	// Attribute represents if a visitor had been identified before.
	VisitorFound bool      `json:"visitorFound"`
	FirstSeenAt  *StSeenAt `json:"firstSeenAt"`
	LastSeenAt   *StSeenAt `json:"lastSeenAt"`
}

type WebhookVisit

type WebhookVisit struct {
	VisitorId      string `json:"visitorId"`
	ClientReferrer string `json:"clientReferrer,omitempty"`
	// Unique identifier of the user's identification request.
	RequestId      string          `json:"requestId"`
	BrowserDetails *BrowserDetails `json:"browserDetails"`
	// Flag if user used incognito session.
	Incognito  bool        `json:"incognito"`
	Ip         string      `json:"ip"`
	IpLocation *IpLocation `json:"ipLocation"`
	// Timestamp of the event with millisecond precision in Unix time.
	Timestamp int64 `json:"timestamp"`
	// Time expressed according to ISO 8601 in UTC format.
	Time *time.Time `json:"time"`
	// Page URL from which identification request was sent.
	Url string `json:"url"`
	// A customer-provided value or an object that was sent with identification request.
	Tag ModelMap `json:"tag,omitempty"`
	// A customer-provided id that was sent with identification request.
	LinkedId   string      `json:"linkedId,omitempty"`
	Confidence *Confidence `json:"confidence"`
	// Attribute represents if a visitor had been identified before.
	VisitorFound bool      `json:"visitorFound"`
	FirstSeenAt  *StSeenAt `json:"firstSeenAt"`
	LastSeenAt   *StSeenAt `json:"lastSeenAt"`
}

Jump to

Keyboard shortcuts

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