Documentation ¶
Index ¶
- func Bool(value bool) param.Field[bool]
- 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 CompanyEnrichmentEnrichService
- type CompanyEnrichmentService
- type Error
- type PeopleEnrichmentEnrichService
- type PeopleEnrichmentService
- type SearchGetResponse
- type SearchGetResponseCriteriaAndReason
- type SearchNewParams
- type SearchNewParamsResultMode
- type SearchNewParamsScope
- type SearchNewResponse
- type SearchNewResponsePoll
- type SearchService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 CompanyEnrichment *CompanyEnrichmentService PeopleEnrichment *PeopleEnrichmentService Searches *SearchService }
Client creates a struct with services and top level methods that help with interacting with the find-ai 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 (FIND_AI_API_KEY). 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 CompanyEnrichmentEnrichService ¶
type CompanyEnrichmentEnrichService struct {
Options []option.RequestOption
}
CompanyEnrichmentEnrichService contains methods and other services that help with interacting with the find-ai 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 NewCompanyEnrichmentEnrichService method instead.
func NewCompanyEnrichmentEnrichService ¶
func NewCompanyEnrichmentEnrichService(opts ...option.RequestOption) (r *CompanyEnrichmentEnrichService)
NewCompanyEnrichmentEnrichService 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.
type CompanyEnrichmentService ¶
type CompanyEnrichmentService struct { Options []option.RequestOption Enrich *CompanyEnrichmentEnrichService }
CompanyEnrichmentService contains methods and other services that help with interacting with the find-ai 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 NewCompanyEnrichmentService method instead.
func NewCompanyEnrichmentService ¶
func NewCompanyEnrichmentService(opts ...option.RequestOption) (r *CompanyEnrichmentService)
NewCompanyEnrichmentService 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.
type PeopleEnrichmentEnrichService ¶
type PeopleEnrichmentEnrichService struct {
Options []option.RequestOption
}
PeopleEnrichmentEnrichService contains methods and other services that help with interacting with the find-ai 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 NewPeopleEnrichmentEnrichService method instead.
func NewPeopleEnrichmentEnrichService ¶
func NewPeopleEnrichmentEnrichService(opts ...option.RequestOption) (r *PeopleEnrichmentEnrichService)
NewPeopleEnrichmentEnrichService 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.
type PeopleEnrichmentService ¶
type PeopleEnrichmentService struct { Options []option.RequestOption Enrich *PeopleEnrichmentEnrichService }
PeopleEnrichmentService contains methods and other services that help with interacting with the find-ai 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 NewPeopleEnrichmentService method instead.
func NewPeopleEnrichmentService ¶
func NewPeopleEnrichmentService(opts ...option.RequestOption) (r *PeopleEnrichmentService)
NewPeopleEnrichmentService 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.
type SearchGetResponse ¶
type SearchGetResponse struct { LinkedinURL string `json:"linkedin_url,required"` Name string `json:"name,required"` // Returned only for a person. Company string `json:"company"` CriteriaAndReasons []SearchGetResponseCriteriaAndReason `json:"criteria_and_reasons"` // Returned only for a company. Domain string `json:"domain"` // Returned only for a person. Title string `json:"title"` JSON searchGetResponseJSON `json:"-"` }
func (*SearchGetResponse) UnmarshalJSON ¶
func (r *SearchGetResponse) UnmarshalJSON(data []byte) (err error)
type SearchGetResponseCriteriaAndReason ¶
type SearchGetResponseCriteriaAndReason struct { // Match criteria Criteria string `json:"criteria"` // Whether it's a match Match bool `json:"match"` // Reason for the match Reason string `json:"reason"` JSON searchGetResponseCriteriaAndReasonJSON `json:"-"` }
func (*SearchGetResponseCriteriaAndReason) UnmarshalJSON ¶
func (r *SearchGetResponseCriteriaAndReason) UnmarshalJSON(data []byte) (err error)
type SearchNewParams ¶
type SearchNewParams struct { // The maximum number of results to return. optional for result_mode exact MaxMatches param.Field[float64] `json:"max_matches"` // Search query. Query param.Field[string] `json:"query"` // The mode of the search. Valid values are 'exact' or 'best'. ResultMode param.Field[SearchNewParamsResultMode] `json:"result_mode"` // The scope of the search. Valid values are 'person' or 'company'. Scope param.Field[SearchNewParamsScope] `json:"scope"` }
func (SearchNewParams) MarshalJSON ¶
func (r SearchNewParams) MarshalJSON() (data []byte, err error)
type SearchNewParamsResultMode ¶
type SearchNewParamsResultMode string
The mode of the search. Valid values are 'exact' or 'best'.
const ( SearchNewParamsResultModeExact SearchNewParamsResultMode = "exact" SearchNewParamsResultModeBest SearchNewParamsResultMode = "best" )
func (SearchNewParamsResultMode) IsKnown ¶
func (r SearchNewParamsResultMode) IsKnown() bool
type SearchNewParamsScope ¶
type SearchNewParamsScope string
The scope of the search. Valid values are 'person' or 'company'.
const ( SearchNewParamsScopePerson SearchNewParamsScope = "person" SearchNewParamsScopeCompany SearchNewParamsScope = "company" )
func (SearchNewParamsScope) IsKnown ¶
func (r SearchNewParamsScope) IsKnown() bool
type SearchNewResponse ¶
type SearchNewResponse struct { Poll SearchNewResponsePoll `json:"poll,required"` JSON searchNewResponseJSON `json:"-"` }
func (*SearchNewResponse) UnmarshalJSON ¶
func (r *SearchNewResponse) UnmarshalJSON(data []byte) (err error)
type SearchNewResponsePoll ¶
type SearchNewResponsePoll struct { Token string `json:"token,required"` Path string `json:"path,required"` JSON searchNewResponsePollJSON `json:"-"` }
func (*SearchNewResponsePoll) UnmarshalJSON ¶
func (r *SearchNewResponsePoll) UnmarshalJSON(data []byte) (err error)
type SearchService ¶
type SearchService struct {
Options []option.RequestOption
}
SearchService contains methods and other services that help with interacting with the find-ai 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 NewSearchService method instead.
func NewSearchService ¶
func NewSearchService(opts ...option.RequestOption) (r *SearchService)
NewSearchService 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 (*SearchService) Get ¶
func (r *SearchService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *[]SearchGetResponse, err error)
The endpoint to poll to check the latest results of a search.
func (*SearchService) New ¶
func (r *SearchService) New(ctx context.Context, body SearchNewParams, opts ...option.RequestOption) (res *SearchNewResponse, err error)
Starts a search.