type EntitiesSearchCall struct {
// contains filtered or unexported fields
}
func (c *EntitiesSearchCall) Context(ctx context.Context) *EntitiesSearchCall
Context sets the context to be used in this call's Do method.
func (c *EntitiesSearchCall) Do(opts ...googleapi.CallOption) (*SearchResponse, error)
Do executes the "kgsearch.entities.search" call. Any non-2xx status code is an error. Response headers are in either *SearchResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.
func (c *EntitiesSearchCall) Fields(s ...googleapi.Field) *EntitiesSearchCall
Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more details.
func (c *EntitiesSearchCall) Header() http.Header
Header returns a http.Header that can be modified by the caller to add headers to the request.
func (c *EntitiesSearchCall) Ids(ids ...string) *EntitiesSearchCall
Ids sets the optional parameter "ids": The list of entity id to be used for search instead of query string. To specify multiple ids in the HTTP request, repeat the parameter in the URL as in ...?ids=A&ids=B
func (c *EntitiesSearchCall) IfNoneMatch(entityTag string) *EntitiesSearchCall
IfNoneMatch sets an optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request.
func (c *EntitiesSearchCall) Indent(indent bool) *EntitiesSearchCall
Indent sets the optional parameter "indent": Enables indenting of json results.
func (c *EntitiesSearchCall) Languages(languages ...string) *EntitiesSearchCall
Languages sets the optional parameter "languages": The list of language codes (defined in ISO 693) to run the query with, e.g. 'en'.
func (c *EntitiesSearchCall) Limit(limit int64) *EntitiesSearchCall
Limit sets the optional parameter "limit": Limits the number of entities to be returned.
func (c *EntitiesSearchCall) Prefix(prefix bool) *EntitiesSearchCall
Prefix sets the optional parameter "prefix": Enables prefix match against names and aliases of entities
func (c *EntitiesSearchCall) Query(query string) *EntitiesSearchCall
Query sets the optional parameter "query": The literal query string for search.
func (c *EntitiesSearchCall) Types(types ...string) *EntitiesSearchCall
Types sets the optional parameter "types": Restricts returned entities with these types, e.g. Person (as defined in http://schema.org/Person). If multiple types are specified, returned entities will contain one or more of these types.
type EntitiesService struct {
// contains filtered or unexported fields
}
func NewEntitiesService(s *Service) *EntitiesService
func (r *EntitiesService) Search() *EntitiesSearchCall
Search: Searches Knowledge Graph for entities that match the constraints. A list of matched entities will be returned in response, which will be in JSON-LD format and compatible with http://schema.org
SearchResponse: Response message includes the context and a list of matching results which contain the detail of associated entities.
type SearchResponse struct { // ItemListElement: The item list of search results. ItemListElement []interface{} `json:"itemListElement,omitempty"` // ServerResponse contains the HTTP response code and headers from the server. googleapi.ServerResponse `json:"-"` // ForceSendFields is a list of field names (e.g. "ItemListElement") to // unconditionally include in API requests. By default, fields with empty or // default values are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more // details. ForceSendFields []string `json:"-"` // NullFields is a list of field names (e.g. "ItemListElement") to include in // API requests with the JSON null value. By default, fields with empty values // are omitted from API requests. See // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. NullFields []string `json:"-"` }
func (s *SearchResponse) MarshalJSON() ([]byte, error)
type Service struct { BasePath string // API endpoint base URL UserAgent string // optional additional User-Agent fragment Entities *EntitiesService // contains filtered or unexported fields }
func New(client *http.Client) (*Service, error)
New creates a new Service. It uses the provided http.Client for requests.
Deprecated: please use NewService instead. To provide a custom HTTP client, use option.WithHTTPClient. If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error)
NewService creates a new Service.