autosuggest

package
v36.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2019 License: Apache-2.0 Imports: 7 Imported by: 358

Documentation

Overview

Package autosuggest implements the Azure ARM Autosuggest service API version 1.0.

Autosuggest supplies search terms derived from a root text sent to the service. The terms Autosuggest supplies are related to the root text based on similarity and their frequency or ratings of usefulness in other searches. For examples that show how to use Autosuggest, see [Search using AutoSuggest](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-autosuggest-api-v7-reference).

Index

Constants

View Source
const (
	// DefaultEndpoint is the default value for endpoint
	DefaultEndpoint = "https://api.cognitive.microsoft.com"
)

Variables

This section is empty.

Functions

func UserAgent

func UserAgent() string

UserAgent returns the UserAgent string to use when sending http.Requests.

func Version

func Version() string

Version returns the semantic version (see http://semver.org) of the client.

Types

type Action

type Action struct {
	// Result - READ-ONLY
	Result *[]BasicThing `json:"result,omitempty"`
	// DisplayName - READ-ONLY
	DisplayName *string `json:"displayName,omitempty"`
	// IsTopAction - READ-ONLY
	IsTopAction *bool `json:"isTopAction,omitempty"`
	// ServiceURL - READ-ONLY
	ServiceURL *string `json:"serviceUrl,omitempty"`
	// ThumbnailURL - READ-ONLY; The URL to a thumbnail of the item.
	ThumbnailURL *string `json:"thumbnailUrl,omitempty"`
	// About - READ-ONLY; For internal use only.
	About *[]BasicThing `json:"about,omitempty"`
	// Mentions - READ-ONLY; For internal use only.
	Mentions *[]BasicThing `json:"mentions,omitempty"`
	// Provider - READ-ONLY; The source of the creative work.
	Provider *[]BasicThing `json:"provider,omitempty"`
	// Creator - READ-ONLY
	Creator BasicThing `json:"creator,omitempty"`
	// Text - READ-ONLY; Text content of this creative work
	Text *string `json:"text,omitempty"`
	// DiscussionURL - READ-ONLY
	DiscussionURL *string `json:"discussionUrl,omitempty"`
	// CommentCount - READ-ONLY
	CommentCount *int32 `json:"commentCount,omitempty"`
	// MainEntity - READ-ONLY
	MainEntity BasicThing `json:"mainEntity,omitempty"`
	// HeadLine - READ-ONLY
	HeadLine *string `json:"headLine,omitempty"`
	// CopyrightHolder - READ-ONLY
	CopyrightHolder BasicThing `json:"copyrightHolder,omitempty"`
	// CopyrightYear - READ-ONLY
	CopyrightYear *int32 `json:"copyrightYear,omitempty"`
	// Disclaimer - READ-ONLY
	Disclaimer *string `json:"disclaimer,omitempty"`
	// IsAccessibleForFree - READ-ONLY
	IsAccessibleForFree *bool `json:"isAccessibleForFree,omitempty"`
	// Genre - READ-ONLY
	Genre *[]string `json:"genre,omitempty"`
	// IsFamilyFriendly - READ-ONLY
	IsFamilyFriendly *bool `json:"isFamilyFriendly,omitempty"`
	// URL - READ-ONLY; The URL to get more information about the thing represented by this object.
	URL *string `json:"url,omitempty"`
	// ReadLink - READ-ONLY; The URL that returns this resource.
	ReadLink *string `json:"readLink,omitempty"`
	// WebSearchURL - READ-ONLY; The URL To Bing's search result for this item.
	WebSearchURL *string `json:"webSearchUrl,omitempty"`
	// PotentialAction - READ-ONLY
	PotentialAction *[]BasicAction `json:"potentialAction,omitempty"`
	// ImmediateAction - READ-ONLY
	ImmediateAction *[]BasicAction `json:"immediateAction,omitempty"`
	// PreferredClickthroughURL - READ-ONLY
	PreferredClickthroughURL *string `json:"preferredClickthroughUrl,omitempty"`
	// AdaptiveCard - READ-ONLY
	AdaptiveCard *string `json:"adaptiveCard,omitempty"`
	// ID - READ-ONLY; A String identifier.
	ID *string `json:"id,omitempty"`
	// Type - Possible values include: 'TypeResponseBase', 'TypeSearchAction', 'TypeSuggestions', 'TypeSearchResultsAnswer', 'TypeAnswer', 'TypeThing', 'TypeAction', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeCreativeWork'
	Type TypeBasicResponseBase `json:"_type,omitempty"`
}

Action ...

func (Action) AsAction

func (a Action) AsAction() (*Action, bool)

AsAction is the BasicResponseBase implementation for Action.

func (Action) AsAnswer

func (a Action) AsAnswer() (*Answer, bool)

AsAnswer is the BasicResponseBase implementation for Action.

func (Action) AsBasicAction

func (a Action) AsBasicAction() (BasicAction, bool)

AsBasicAction is the BasicResponseBase implementation for Action.

func (Action) AsBasicAnswer

func (a Action) AsBasicAnswer() (BasicAnswer, bool)

AsBasicAnswer is the BasicResponseBase implementation for Action.

func (Action) AsBasicCreativeWork

func (a Action) AsBasicCreativeWork() (BasicCreativeWork, bool)

AsBasicCreativeWork is the BasicResponseBase implementation for Action.

func (Action) AsBasicIdentifiable

func (a Action) AsBasicIdentifiable() (BasicIdentifiable, bool)

AsBasicIdentifiable is the BasicResponseBase implementation for Action.

func (Action) AsBasicResponse

func (a Action) AsBasicResponse() (BasicResponse, bool)

AsBasicResponse is the BasicResponseBase implementation for Action.

func (Action) AsBasicResponseBase

func (a Action) AsBasicResponseBase() (BasicResponseBase, bool)

AsBasicResponseBase is the BasicResponseBase implementation for Action.

func (Action) AsBasicSearchResultsAnswer

func (a Action) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool)

AsBasicSearchResultsAnswer is the BasicResponseBase implementation for Action.

func (Action) AsBasicThing

func (a Action) AsBasicThing() (BasicThing, bool)

AsBasicThing is the BasicResponseBase implementation for Action.

func (Action) AsCreativeWork

func (a Action) AsCreativeWork() (*CreativeWork, bool)

AsCreativeWork is the BasicResponseBase implementation for Action.

func (Action) AsErrorResponse

func (a Action) AsErrorResponse() (*ErrorResponse, bool)

AsErrorResponse is the BasicResponseBase implementation for Action.

func (Action) AsIdentifiable

func (a Action) AsIdentifiable() (*Identifiable, bool)

AsIdentifiable is the BasicResponseBase implementation for Action.

func (Action) AsResponse

func (a Action) AsResponse() (*Response, bool)

AsResponse is the BasicResponseBase implementation for Action.

func (Action) AsResponseBase

func (a Action) AsResponseBase() (*ResponseBase, bool)

AsResponseBase is the BasicResponseBase implementation for Action.

func (Action) AsSearchAction

func (a Action) AsSearchAction() (*SearchAction, bool)

AsSearchAction is the BasicResponseBase implementation for Action.

func (Action) AsSearchResultsAnswer

func (a Action) AsSearchResultsAnswer() (*SearchResultsAnswer, bool)

AsSearchResultsAnswer is the BasicResponseBase implementation for Action.

func (Action) AsSuggestions

func (a Action) AsSuggestions() (*Suggestions, bool)

AsSuggestions is the BasicResponseBase implementation for Action.

func (Action) AsThing

func (a Action) AsThing() (*Thing, bool)

AsThing is the BasicResponseBase implementation for Action.

func (Action) MarshalJSON

func (a Action) MarshalJSON() ([]byte, error)

MarshalJSON is the custom marshaler for Action.

func (*Action) UnmarshalJSON

func (a *Action) UnmarshalJSON(body []byte) error

UnmarshalJSON is the custom unmarshaler for Action struct.

type Answer

type Answer struct {
	// ReadLink - READ-ONLY; The URL that returns this resource.
	ReadLink *string `json:"readLink,omitempty"`
	// WebSearchURL - READ-ONLY; The URL To Bing's search result for this item.
	WebSearchURL *string `json:"webSearchUrl,omitempty"`
	// PotentialAction - READ-ONLY
	PotentialAction *[]BasicAction `json:"potentialAction,omitempty"`
	// ImmediateAction - READ-ONLY
	ImmediateAction *[]BasicAction `json:"immediateAction,omitempty"`
	// PreferredClickthroughURL - READ-ONLY
	PreferredClickthroughURL *string `json:"preferredClickthroughUrl,omitempty"`
	// AdaptiveCard - READ-ONLY
	AdaptiveCard *string `json:"adaptiveCard,omitempty"`
	// ID - READ-ONLY; A String identifier.
	ID *string `json:"id,omitempty"`
	// Type - Possible values include: 'TypeResponseBase', 'TypeSearchAction', 'TypeSuggestions', 'TypeSearchResultsAnswer', 'TypeAnswer', 'TypeThing', 'TypeAction', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeCreativeWork'
	Type TypeBasicResponseBase `json:"_type,omitempty"`
}

Answer defines an answer.

func (Answer) AsAction

func (a Answer) AsAction() (*Action, bool)

AsAction is the BasicResponseBase implementation for Answer.

func (Answer) AsAnswer

func (a Answer) AsAnswer() (*Answer, bool)

AsAnswer is the BasicResponseBase implementation for Answer.

func (Answer) AsBasicAction

func (a Answer) AsBasicAction() (BasicAction, bool)

AsBasicAction is the BasicResponseBase implementation for Answer.

func (Answer) AsBasicAnswer

func (a Answer) AsBasicAnswer() (BasicAnswer, bool)

AsBasicAnswer is the BasicResponseBase implementation for Answer.

func (Answer) AsBasicCreativeWork

func (a Answer) AsBasicCreativeWork() (BasicCreativeWork, bool)

AsBasicCreativeWork is the BasicResponseBase implementation for Answer.

func (Answer) AsBasicIdentifiable

func (a Answer) AsBasicIdentifiable() (BasicIdentifiable, bool)

AsBasicIdentifiable is the BasicResponseBase implementation for Answer.

func (Answer) AsBasicResponse

func (a Answer) AsBasicResponse() (BasicResponse, bool)

AsBasicResponse is the BasicResponseBase implementation for Answer.

func (Answer) AsBasicResponseBase

func (a Answer) AsBasicResponseBase() (BasicResponseBase, bool)

AsBasicResponseBase is the BasicResponseBase implementation for Answer.

func (Answer) AsBasicSearchResultsAnswer

func (a Answer) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool)

AsBasicSearchResultsAnswer is the BasicResponseBase implementation for Answer.

func (Answer) AsBasicThing

func (a Answer) AsBasicThing() (BasicThing, bool)

AsBasicThing is the BasicResponseBase implementation for Answer.

func (Answer) AsCreativeWork

func (a Answer) AsCreativeWork() (*CreativeWork, bool)

AsCreativeWork is the BasicResponseBase implementation for Answer.

func (Answer) AsErrorResponse

func (a Answer) AsErrorResponse() (*ErrorResponse, bool)

AsErrorResponse is the BasicResponseBase implementation for Answer.

func (Answer) AsIdentifiable

func (a Answer) AsIdentifiable() (*Identifiable, bool)

AsIdentifiable is the BasicResponseBase implementation for Answer.

func (Answer) AsResponse

func (a Answer) AsResponse() (*Response, bool)

AsResponse is the BasicResponseBase implementation for Answer.

func (Answer) AsResponseBase

func (a Answer) AsResponseBase() (*ResponseBase, bool)

AsResponseBase is the BasicResponseBase implementation for Answer.

func (Answer) AsSearchAction

func (a Answer) AsSearchAction() (*SearchAction, bool)

AsSearchAction is the BasicResponseBase implementation for Answer.

func (Answer) AsSearchResultsAnswer

func (a Answer) AsSearchResultsAnswer() (*SearchResultsAnswer, bool)

AsSearchResultsAnswer is the BasicResponseBase implementation for Answer.

func (Answer) AsSuggestions

func (a Answer) AsSuggestions() (*Suggestions, bool)

AsSuggestions is the BasicResponseBase implementation for Answer.

func (Answer) AsThing

func (a Answer) AsThing() (*Thing, bool)

AsThing is the BasicResponseBase implementation for Answer.

func (Answer) MarshalJSON

func (a Answer) MarshalJSON() ([]byte, error)

MarshalJSON is the custom marshaler for Answer.

func (*Answer) UnmarshalJSON

func (a *Answer) UnmarshalJSON(body []byte) error

UnmarshalJSON is the custom unmarshaler for Answer struct.

type BaseClient

type BaseClient struct {
	autorest.Client
	Endpoint string
}

BaseClient is the base client for Autosuggest.

func New

func New() BaseClient

New creates an instance of the BaseClient client.

func NewWithoutDefaults

func NewWithoutDefaults(endpoint string) BaseClient

NewWithoutDefaults creates an instance of the BaseClient client.

func (BaseClient) AutoSuggest

func (client BaseClient) AutoSuggest(ctx context.Context, query string, acceptLanguage string, pragma string, userAgent string, clientID string, clientIP string, location string, countryCode string, market string, safeSearch SafeSearch, setLang string, responseFormat []ResponseFormat) (result Suggestions, err error)

AutoSuggest sends the auto suggest request. Parameters: query - the user's search term. acceptLanguage - a comma-delimited list of one or more languages to use for user interface strings. The list is in decreasing order of preference. For additional information, including expected format, see [RFC2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). This header and the setLang query parameter are mutually exclusive; do not specify both. If you set this header, you must also specify the [cc](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-autosuggest-api-v7-reference#cc) query parameter. To determine the market to return results for, Bing uses the first supported language it finds from the list and combines it with the cc parameter value. If the list does not include a supported language, Bing finds the closest language and market that supports the request or it uses an aggregated or default market for the results. To determine the market that Bing used, see the BingAPIs-Market header. Use this header and the cc query parameter only if you specify multiple languages. Otherwise, use the [mkt](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-autosuggest-api-v7-reference#mkt) and [setLang](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-autosuggest-api-v7-reference#setlang) query parameters. A user interface string is a string that's used as a label in a user interface. There are few user interface strings in the JSON response objects. Any links to Bing.com properties in the response objects apply the specified language. pragma - by default, Bing returns cached content, if available. To prevent Bing from returning cached content, set the Pragma header to no-cache (for example, Pragma: no-cache). userAgent - the user agent originating the request. Bing uses the user agent to provide mobile users with an optimized experience. Although optional, you are encouraged to always specify this header. The user-agent should be the same string that any commonly used browser sends. For information about user agents, see [RFC 2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). The following are examples of user-agent strings. Windows Phone: Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 822). Android: Mozilla / 5.0 (Linux; U; Android 2.3.5; en - us; SCH - I500 Build / GINGERBREAD) AppleWebKit / 533.1 (KHTML; like Gecko) Version / 4.0 Mobile Safari / 533.1. iPhone: Mozilla / 5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X) AppleWebKit / 536.26 (KHTML; like Gecko) Mobile / 10B142 iPhone4; 1 BingWeb / 3.03.1428.20120423. PC: Mozilla / 5.0 (Windows NT 6.3; WOW64; Trident / 7.0; Touch; rv:11.0) like Gecko. iPad: Mozilla / 5.0 (iPad; CPU OS 7_0 like Mac OS X) AppleWebKit / 537.51.1 (KHTML, like Gecko) Version / 7.0 Mobile / 11A465 Safari / 9537.53 clientID - bing uses this header to provide users with consistent behavior across Bing API calls. Bing often flights new features and improvements, and it uses the client ID as a key for assigning traffic on different flights. If you do not use the same client ID for a user across multiple requests, then Bing may assign the user to multiple conflicting flights. Being assigned to multiple conflicting flights can lead to an inconsistent user experience. For example, if the second request has a different flight assignment than the first, the experience may be unexpected. Also, Bing can use the client ID to tailor web results to that client ID’s search history, providing a richer experience for the user. Bing also uses this header to help improve result rankings by analyzing the activity generated by a client ID. The relevance improvements help with better quality of results delivered by Bing APIs and in turn enables higher click-through rates for the API consumer. IMPORTANT: Although optional, you should consider this header required. Persisting the client ID across multiple requests for the same end user and device combination enables 1) the API consumer to receive a consistent user experience, and 2) higher click-through rates via better quality of results from the Bing APIs. Each user that uses your application on the device must have a unique, Bing generated client ID. If you do not include this header in the request, Bing generates an ID and returns it in the X-MSEdge-ClientID response header. The only time that you should NOT include this header in a request is the first time the user uses your app on that device. Use the client ID for each Bing API request that your app makes for this user on the device. Persist the client ID. To persist the ID in a browser app, use a persistent HTTP cookie to ensure the ID is used across all sessions. Do not use a session cookie. For other apps such as mobile apps, use the device's persistent storage to persist the ID. The next time the user uses your app on that device, get the client ID that you persisted. Bing responses may or may not include this header. If the response includes this header, capture the client ID and use it for all subsequent Bing requests for the user on that device. If you include the X-MSEdge-ClientID, you must not include cookies in the request. clientIP - the IPv4 or IPv6 address of the client device. The IP address is used to discover the user's location. Bing uses the location information to determine safe search behavior. Although optional, you are encouraged to always specify this header and the X-Search-Location header. Do not obfuscate the address (for example, by changing the last octet to 0). Obfuscating the address results in the location not being anywhere near the device's actual location, which may result in Bing serving erroneous results. location - a semicolon-delimited list of key/value pairs that describe the client's geographical location. Bing uses the location information to determine safe search behavior and to return relevant local content. Specify the key/value pair as <key>:<value>. The following are the keys that you use to specify the user's location. lat (required): The latitude of the client's location, in degrees. The latitude must be greater than or equal to -90.0 and less than or equal to +90.0. Negative values indicate southern latitudes and positive values indicate northern latitudes. long (required): The longitude of the client's location, in degrees. The longitude must be greater than or equal to -180.0 and less than or equal to +180.0. Negative values indicate western longitudes and positive values indicate eastern longitudes. re (required): The radius, in meters, which specifies the horizontal accuracy of the coordinates. Pass the value returned by the device's location service. Typical values might be 22m for GPS/Wi-Fi, 380m for cell tower triangulation, and 18,000m for reverse IP lookup. ts (optional): The UTC UNIX timestamp of when the client was at the location. (The UNIX timestamp is the number of seconds since January 1, 1970.) head (optional): The client's relative heading or direction of travel. Specify the direction of travel as degrees from 0 through 360, counting clockwise relative to true north. Specify this key only if the sp key is nonzero. sp (optional): The horizontal velocity (speed), in meters per second, that the client device is traveling. alt (optional): The altitude of the client device, in meters. are (optional): The radius, in meters, that specifies the vertical accuracy of the coordinates. Specify this key only if you specify the alt key. Although many of the keys are optional, the more information that you provide, the more accurate the location results are. Although optional, you are encouraged to always specify the user's geographical location. Providing the location is especially important if the client's IP address does not accurately reflect the user's physical location (for example, if the client uses VPN). For optimal results, you should include this header and the X-MSEdge-ClientIP header, but at a minimum, you should include this header. countryCode - a 2-character country code of the country where the results come from. This API supports only the United States market. If you specify this query parameter, it must be set to us. If you set this parameter, you must also specify the Accept-Language header. Bing uses the first supported language it finds from the languages list, and combine that language with the country code that you specify to determine the market to return results for. If the languages list does not include a supported language, Bing finds the closest language and market that supports the request, or it may use an aggregated or default market for the results instead of a specified one. You should use this query parameter and the Accept-Language query parameter only if you specify multiple languages; otherwise, you should use the mkt and setLang query parameters. This parameter and the mkt query parameter are mutually exclusive—do not specify both. market - the market where the results come from. You are strongly encouraged to always specify the market, if known. Specifying the market helps Bing route the request and return an appropriate and optimal response. This parameter and the cc query parameter are mutually exclusive—do not specify both. safeSearch - filter suggestions for adult content. The following are the possible filter values. Off: Return suggestions with adult text, images, or videos. Moderate: Return suggestion with adult text but not adult images or videos. Strict: Do not return news articles with adult text, images, or videos. If the request comes from a market that Bing's adult policy requires that safeSearch is set to Strict, Bing ignores the safeSearch value and uses Strict. If you use the site: query operator, there is the chance that the response may contain adult content regardless of what the safeSearch query parameter is set to. Use site: only if you are aware of the content on the site and your scenario supports the possibility of adult content. setLang - the language to use for user interface strings. Specify the language using the ISO 639-1 2-letter language code. For example, the language code for English is EN. The default is EN (English). Although optional, you should always specify the language. Typically, you set setLang to the same language specified by mkt unless the user wants the user interface strings displayed in a different language. This parameter and the Accept-Language header are mutually exclusive; do not specify both. A user interface string is a string that's used as a label in a user interface. There are few user interface strings in the JSON response objects. Also, any links to Bing.com properties in the response objects apply the specified language. responseFormat - the media type to use for the response. The following are the possible case-insensitive values: JSON, JSONLD. The default is JSON. If you specify JSONLD, the response body includes JSON-LD objects that contain the search results.

func (BaseClient) AutoSuggestPreparer

func (client BaseClient) AutoSuggestPreparer(ctx context.Context, query string, acceptLanguage string, pragma string, userAgent string, clientID string, clientIP string, location string, countryCode string, market string, safeSearch SafeSearch, setLang string, responseFormat []ResponseFormat) (*http.Request, error)

AutoSuggestPreparer prepares the AutoSuggest request.

func (BaseClient) AutoSuggestResponder

func (client BaseClient) AutoSuggestResponder(resp *http.Response) (result Suggestions, err error)

AutoSuggestResponder handles the response to the AutoSuggest request. The method always closes the http.Response Body.

func (BaseClient) AutoSuggestSender

func (client BaseClient) AutoSuggestSender(req *http.Request) (*http.Response, error)

AutoSuggestSender sends the AutoSuggest request. The method will close the http.Response Body if it receives an error.

type BasicAction

type BasicAction interface {
	AsSearchAction() (*SearchAction, bool)
	AsAction() (*Action, bool)
}

BasicAction ...

type BasicAnswer

type BasicAnswer interface {
	AsSuggestions() (*Suggestions, bool)
	AsSearchResultsAnswer() (*SearchResultsAnswer, bool)
	AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool)
	AsAnswer() (*Answer, bool)
}

BasicAnswer defines an answer.

type BasicCreativeWork

type BasicCreativeWork interface {
	AsSearchAction() (*SearchAction, bool)
	AsAction() (*Action, bool)
	AsBasicAction() (BasicAction, bool)
	AsCreativeWork() (*CreativeWork, bool)
}

BasicCreativeWork the most generic kind of creative work, including books, movies, photographs, software programs, etc.

type BasicError

type BasicError interface {
	AsError() (*Error, bool)
}

BasicError defines the error that occurred.

type BasicIdentifiable

type BasicIdentifiable interface {
	AsSearchAction() (*SearchAction, bool)
	AsSuggestions() (*Suggestions, bool)
	AsSearchResultsAnswer() (*SearchResultsAnswer, bool)
	AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool)
	AsAnswer() (*Answer, bool)
	AsBasicAnswer() (BasicAnswer, bool)
	AsThing() (*Thing, bool)
	AsBasicThing() (BasicThing, bool)
	AsAction() (*Action, bool)
	AsBasicAction() (BasicAction, bool)
	AsResponse() (*Response, bool)
	AsBasicResponse() (BasicResponse, bool)
	AsErrorResponse() (*ErrorResponse, bool)
	AsCreativeWork() (*CreativeWork, bool)
	AsBasicCreativeWork() (BasicCreativeWork, bool)
	AsIdentifiable() (*Identifiable, bool)
}

BasicIdentifiable defines the identity of a resource.

type BasicQueryContext

type BasicQueryContext interface {
	AsQueryContext() (*QueryContext, bool)
}

BasicQueryContext defines the query context that Bing used for the request.

type BasicResponse

type BasicResponse interface {
	AsSearchAction() (*SearchAction, bool)
	AsSuggestions() (*Suggestions, bool)
	AsSearchResultsAnswer() (*SearchResultsAnswer, bool)
	AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool)
	AsAnswer() (*Answer, bool)
	AsBasicAnswer() (BasicAnswer, bool)
	AsThing() (*Thing, bool)
	AsBasicThing() (BasicThing, bool)
	AsAction() (*Action, bool)
	AsBasicAction() (BasicAction, bool)
	AsErrorResponse() (*ErrorResponse, bool)
	AsCreativeWork() (*CreativeWork, bool)
	AsBasicCreativeWork() (BasicCreativeWork, bool)
	AsResponse() (*Response, bool)
}

BasicResponse defines a response. All schemas that could be returned at the root of a response should inherit from this

type BasicResponseBase

type BasicResponseBase interface {
	AsSearchAction() (*SearchAction, bool)
	AsSuggestions() (*Suggestions, bool)
	AsSearchResultsAnswer() (*SearchResultsAnswer, bool)
	AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool)
	AsAnswer() (*Answer, bool)
	AsBasicAnswer() (BasicAnswer, bool)
	AsThing() (*Thing, bool)
	AsBasicThing() (BasicThing, bool)
	AsAction() (*Action, bool)
	AsBasicAction() (BasicAction, bool)
	AsResponse() (*Response, bool)
	AsBasicResponse() (BasicResponse, bool)
	AsIdentifiable() (*Identifiable, bool)
	AsBasicIdentifiable() (BasicIdentifiable, bool)
	AsErrorResponse() (*ErrorResponse, bool)
	AsCreativeWork() (*CreativeWork, bool)
	AsBasicCreativeWork() (BasicCreativeWork, bool)
	AsResponseBase() (*ResponseBase, bool)
}

BasicResponseBase response base

type BasicSearchResultsAnswer

type BasicSearchResultsAnswer interface {
	AsSuggestions() (*Suggestions, bool)
	AsSearchResultsAnswer() (*SearchResultsAnswer, bool)
}

BasicSearchResultsAnswer defines a search result answer.

type BasicSuggestionsSuggestionGroup

type BasicSuggestionsSuggestionGroup interface {
	AsSuggestionsSuggestionGroup() (*SuggestionsSuggestionGroup, bool)
}

BasicSuggestionsSuggestionGroup ...

type BasicThing

type BasicThing interface {
	AsSearchAction() (*SearchAction, bool)
	AsAction() (*Action, bool)
	AsBasicAction() (BasicAction, bool)
	AsCreativeWork() (*CreativeWork, bool)
	AsBasicCreativeWork() (BasicCreativeWork, bool)
	AsThing() (*Thing, bool)
}

BasicThing defines a thing.

type CreativeWork

type CreativeWork struct {
	// ThumbnailURL - READ-ONLY; The URL to a thumbnail of the item.
	ThumbnailURL *string `json:"thumbnailUrl,omitempty"`
	// About - READ-ONLY; For internal use only.
	About *[]BasicThing `json:"about,omitempty"`
	// Mentions - READ-ONLY; For internal use only.
	Mentions *[]BasicThing `json:"mentions,omitempty"`
	// Provider - READ-ONLY; The source of the creative work.
	Provider *[]BasicThing `json:"provider,omitempty"`
	// Creator - READ-ONLY
	Creator BasicThing `json:"creator,omitempty"`
	// Text - READ-ONLY; Text content of this creative work
	Text *string `json:"text,omitempty"`
	// DiscussionURL - READ-ONLY
	DiscussionURL *string `json:"discussionUrl,omitempty"`
	// CommentCount - READ-ONLY
	CommentCount *int32 `json:"commentCount,omitempty"`
	// MainEntity - READ-ONLY
	MainEntity BasicThing `json:"mainEntity,omitempty"`
	// HeadLine - READ-ONLY
	HeadLine *string `json:"headLine,omitempty"`
	// CopyrightHolder - READ-ONLY
	CopyrightHolder BasicThing `json:"copyrightHolder,omitempty"`
	// CopyrightYear - READ-ONLY
	CopyrightYear *int32 `json:"copyrightYear,omitempty"`
	// Disclaimer - READ-ONLY
	Disclaimer *string `json:"disclaimer,omitempty"`
	// IsAccessibleForFree - READ-ONLY
	IsAccessibleForFree *bool `json:"isAccessibleForFree,omitempty"`
	// Genre - READ-ONLY
	Genre *[]string `json:"genre,omitempty"`
	// IsFamilyFriendly - READ-ONLY
	IsFamilyFriendly *bool `json:"isFamilyFriendly,omitempty"`
	// URL - READ-ONLY; The URL to get more information about the thing represented by this object.
	URL *string `json:"url,omitempty"`
	// ReadLink - READ-ONLY; The URL that returns this resource.
	ReadLink *string `json:"readLink,omitempty"`
	// WebSearchURL - READ-ONLY; The URL To Bing's search result for this item.
	WebSearchURL *string `json:"webSearchUrl,omitempty"`
	// PotentialAction - READ-ONLY
	PotentialAction *[]BasicAction `json:"potentialAction,omitempty"`
	// ImmediateAction - READ-ONLY
	ImmediateAction *[]BasicAction `json:"immediateAction,omitempty"`
	// PreferredClickthroughURL - READ-ONLY
	PreferredClickthroughURL *string `json:"preferredClickthroughUrl,omitempty"`
	// AdaptiveCard - READ-ONLY
	AdaptiveCard *string `json:"adaptiveCard,omitempty"`
	// ID - READ-ONLY; A String identifier.
	ID *string `json:"id,omitempty"`
	// Type - Possible values include: 'TypeResponseBase', 'TypeSearchAction', 'TypeSuggestions', 'TypeSearchResultsAnswer', 'TypeAnswer', 'TypeThing', 'TypeAction', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeCreativeWork'
	Type TypeBasicResponseBase `json:"_type,omitempty"`
}

CreativeWork the most generic kind of creative work, including books, movies, photographs, software programs, etc.

func (CreativeWork) AsAction

func (cw CreativeWork) AsAction() (*Action, bool)

AsAction is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsAnswer

func (cw CreativeWork) AsAnswer() (*Answer, bool)

AsAnswer is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsBasicAction

func (cw CreativeWork) AsBasicAction() (BasicAction, bool)

AsBasicAction is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsBasicAnswer

func (cw CreativeWork) AsBasicAnswer() (BasicAnswer, bool)

AsBasicAnswer is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsBasicCreativeWork

func (cw CreativeWork) AsBasicCreativeWork() (BasicCreativeWork, bool)

AsBasicCreativeWork is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsBasicIdentifiable

func (cw CreativeWork) AsBasicIdentifiable() (BasicIdentifiable, bool)

AsBasicIdentifiable is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsBasicResponse

func (cw CreativeWork) AsBasicResponse() (BasicResponse, bool)

AsBasicResponse is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsBasicResponseBase

func (cw CreativeWork) AsBasicResponseBase() (BasicResponseBase, bool)

AsBasicResponseBase is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsBasicSearchResultsAnswer

func (cw CreativeWork) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool)

AsBasicSearchResultsAnswer is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsBasicThing

func (cw CreativeWork) AsBasicThing() (BasicThing, bool)

AsBasicThing is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsCreativeWork

func (cw CreativeWork) AsCreativeWork() (*CreativeWork, bool)

AsCreativeWork is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsErrorResponse

func (cw CreativeWork) AsErrorResponse() (*ErrorResponse, bool)

AsErrorResponse is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsIdentifiable

func (cw CreativeWork) AsIdentifiable() (*Identifiable, bool)

AsIdentifiable is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsResponse

func (cw CreativeWork) AsResponse() (*Response, bool)

AsResponse is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsResponseBase

func (cw CreativeWork) AsResponseBase() (*ResponseBase, bool)

AsResponseBase is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsSearchAction

func (cw CreativeWork) AsSearchAction() (*SearchAction, bool)

AsSearchAction is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsSearchResultsAnswer

func (cw CreativeWork) AsSearchResultsAnswer() (*SearchResultsAnswer, bool)

AsSearchResultsAnswer is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsSuggestions

func (cw CreativeWork) AsSuggestions() (*Suggestions, bool)

AsSuggestions is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsThing

func (cw CreativeWork) AsThing() (*Thing, bool)

AsThing is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) MarshalJSON

func (cw CreativeWork) MarshalJSON() ([]byte, error)

MarshalJSON is the custom marshaler for CreativeWork.

func (*CreativeWork) UnmarshalJSON

func (cw *CreativeWork) UnmarshalJSON(body []byte) error

UnmarshalJSON is the custom unmarshaler for CreativeWork struct.

type Error

type Error struct {
	// Code - The error code that identifies the category of error. Possible values include: 'None', 'ServerError', 'InvalidRequest', 'RateLimitExceeded', 'InvalidAuthorization', 'InsufficientAuthorization'
	Code ErrorCode `json:"code,omitempty"`
	// Message - A description of the error.
	Message *string `json:"message,omitempty"`
	// MoreDetails - READ-ONLY; A description that provides additional information about the error.
	MoreDetails *string `json:"moreDetails,omitempty"`
	// Parameter - READ-ONLY; The parameter in the request that caused the error.
	Parameter *string `json:"parameter,omitempty"`
	// Value - READ-ONLY; The parameter's value in the request that was not valid.
	Value *string `json:"value,omitempty"`
	// Type - Possible values include: 'TypeError'
	Type TypeBasicError `json:"_type,omitempty"`
}

Error defines the error that occurred.

func (Error) AsBasicError

func (e Error) AsBasicError() (BasicError, bool)

AsBasicError is the BasicError implementation for Error.

func (Error) AsError

func (e Error) AsError() (*Error, bool)

AsError is the BasicError implementation for Error.

func (Error) MarshalJSON

func (e Error) MarshalJSON() ([]byte, error)

MarshalJSON is the custom marshaler for Error.

type ErrorCode

type ErrorCode string

ErrorCode enumerates the values for error code.

const (
	// InsufficientAuthorization ...
	InsufficientAuthorization ErrorCode = "InsufficientAuthorization"
	// InvalidAuthorization ...
	InvalidAuthorization ErrorCode = "InvalidAuthorization"
	// InvalidRequest ...
	InvalidRequest ErrorCode = "InvalidRequest"
	// None ...
	None ErrorCode = "None"
	// RateLimitExceeded ...
	RateLimitExceeded ErrorCode = "RateLimitExceeded"
	// ServerError ...
	ServerError ErrorCode = "ServerError"
)

func PossibleErrorCodeValues

func PossibleErrorCodeValues() []ErrorCode

PossibleErrorCodeValues returns an array of possible values for the ErrorCode const type.

type ErrorResponse

type ErrorResponse struct {
	// Errors - A list of errors that describe the reasons why the request failed.
	Errors *[]BasicError `json:"errors,omitempty"`
	// ReadLink - READ-ONLY; The URL that returns this resource.
	ReadLink *string `json:"readLink,omitempty"`
	// WebSearchURL - READ-ONLY; The URL To Bing's search result for this item.
	WebSearchURL *string `json:"webSearchUrl,omitempty"`
	// PotentialAction - READ-ONLY
	PotentialAction *[]BasicAction `json:"potentialAction,omitempty"`
	// ImmediateAction - READ-ONLY
	ImmediateAction *[]BasicAction `json:"immediateAction,omitempty"`
	// PreferredClickthroughURL - READ-ONLY
	PreferredClickthroughURL *string `json:"preferredClickthroughUrl,omitempty"`
	// AdaptiveCard - READ-ONLY
	AdaptiveCard *string `json:"adaptiveCard,omitempty"`
	// ID - READ-ONLY; A String identifier.
	ID *string `json:"id,omitempty"`
	// Type - Possible values include: 'TypeResponseBase', 'TypeSearchAction', 'TypeSuggestions', 'TypeSearchResultsAnswer', 'TypeAnswer', 'TypeThing', 'TypeAction', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeCreativeWork'
	Type TypeBasicResponseBase `json:"_type,omitempty"`
}

ErrorResponse the top-level response that represents a failed request.

func (ErrorResponse) AsAction

func (er ErrorResponse) AsAction() (*Action, bool)

AsAction is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsAnswer

func (er ErrorResponse) AsAnswer() (*Answer, bool)

AsAnswer is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsBasicAction

func (er ErrorResponse) AsBasicAction() (BasicAction, bool)

AsBasicAction is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsBasicAnswer

func (er ErrorResponse) AsBasicAnswer() (BasicAnswer, bool)

AsBasicAnswer is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsBasicCreativeWork

func (er ErrorResponse) AsBasicCreativeWork() (BasicCreativeWork, bool)

AsBasicCreativeWork is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsBasicIdentifiable

func (er ErrorResponse) AsBasicIdentifiable() (BasicIdentifiable, bool)

AsBasicIdentifiable is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsBasicResponse

func (er ErrorResponse) AsBasicResponse() (BasicResponse, bool)

AsBasicResponse is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsBasicResponseBase

func (er ErrorResponse) AsBasicResponseBase() (BasicResponseBase, bool)

AsBasicResponseBase is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsBasicSearchResultsAnswer

func (er ErrorResponse) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool)

AsBasicSearchResultsAnswer is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsBasicThing

func (er ErrorResponse) AsBasicThing() (BasicThing, bool)

AsBasicThing is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsCreativeWork

func (er ErrorResponse) AsCreativeWork() (*CreativeWork, bool)

AsCreativeWork is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsErrorResponse

func (er ErrorResponse) AsErrorResponse() (*ErrorResponse, bool)

AsErrorResponse is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsIdentifiable

func (er ErrorResponse) AsIdentifiable() (*Identifiable, bool)

AsIdentifiable is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsResponse

func (er ErrorResponse) AsResponse() (*Response, bool)

AsResponse is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsResponseBase

func (er ErrorResponse) AsResponseBase() (*ResponseBase, bool)

AsResponseBase is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsSearchAction

func (er ErrorResponse) AsSearchAction() (*SearchAction, bool)

AsSearchAction is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsSearchResultsAnswer

func (er ErrorResponse) AsSearchResultsAnswer() (*SearchResultsAnswer, bool)

AsSearchResultsAnswer is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsSuggestions

func (er ErrorResponse) AsSuggestions() (*Suggestions, bool)

AsSuggestions is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsThing

func (er ErrorResponse) AsThing() (*Thing, bool)

AsThing is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) MarshalJSON

func (er ErrorResponse) MarshalJSON() ([]byte, error)

MarshalJSON is the custom marshaler for ErrorResponse.

func (*ErrorResponse) UnmarshalJSON

func (er *ErrorResponse) UnmarshalJSON(body []byte) error

UnmarshalJSON is the custom unmarshaler for ErrorResponse struct.

type Identifiable

type Identifiable struct {
	// ID - READ-ONLY; A String identifier.
	ID *string `json:"id,omitempty"`
	// Type - Possible values include: 'TypeResponseBase', 'TypeSearchAction', 'TypeSuggestions', 'TypeSearchResultsAnswer', 'TypeAnswer', 'TypeThing', 'TypeAction', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeCreativeWork'
	Type TypeBasicResponseBase `json:"_type,omitempty"`
}

Identifiable defines the identity of a resource.

func (Identifiable) AsAction

func (i Identifiable) AsAction() (*Action, bool)

AsAction is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsAnswer

func (i Identifiable) AsAnswer() (*Answer, bool)

AsAnswer is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsBasicAction

func (i Identifiable) AsBasicAction() (BasicAction, bool)

AsBasicAction is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsBasicAnswer

func (i Identifiable) AsBasicAnswer() (BasicAnswer, bool)

AsBasicAnswer is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsBasicCreativeWork

func (i Identifiable) AsBasicCreativeWork() (BasicCreativeWork, bool)

AsBasicCreativeWork is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsBasicIdentifiable

func (i Identifiable) AsBasicIdentifiable() (BasicIdentifiable, bool)

AsBasicIdentifiable is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsBasicResponse

func (i Identifiable) AsBasicResponse() (BasicResponse, bool)

AsBasicResponse is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsBasicResponseBase

func (i Identifiable) AsBasicResponseBase() (BasicResponseBase, bool)

AsBasicResponseBase is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsBasicSearchResultsAnswer

func (i Identifiable) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool)

AsBasicSearchResultsAnswer is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsBasicThing

func (i Identifiable) AsBasicThing() (BasicThing, bool)

AsBasicThing is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsCreativeWork

func (i Identifiable) AsCreativeWork() (*CreativeWork, bool)

AsCreativeWork is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsErrorResponse

func (i Identifiable) AsErrorResponse() (*ErrorResponse, bool)

AsErrorResponse is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsIdentifiable

func (i Identifiable) AsIdentifiable() (*Identifiable, bool)

AsIdentifiable is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsResponse

func (i Identifiable) AsResponse() (*Response, bool)

AsResponse is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsResponseBase

func (i Identifiable) AsResponseBase() (*ResponseBase, bool)

AsResponseBase is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsSearchAction

func (i Identifiable) AsSearchAction() (*SearchAction, bool)

AsSearchAction is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsSearchResultsAnswer

func (i Identifiable) AsSearchResultsAnswer() (*SearchResultsAnswer, bool)

AsSearchResultsAnswer is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsSuggestions

func (i Identifiable) AsSuggestions() (*Suggestions, bool)

AsSuggestions is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsThing

func (i Identifiable) AsThing() (*Thing, bool)

AsThing is the BasicResponseBase implementation for Identifiable.

func (Identifiable) MarshalJSON

func (i Identifiable) MarshalJSON() ([]byte, error)

MarshalJSON is the custom marshaler for Identifiable.

type QueryContext

type QueryContext struct {
	// OriginalQuery - The query string as specified in the request.
	OriginalQuery *string `json:"originalQuery,omitempty"`
	// AlteredQuery - READ-ONLY; The query string used by Bing to perform the query. Bing uses the altered query string if the original query string contained spelling mistakes. For example, if the query string is "saling downwind", the altered query string will be "sailing downwind". This field is included only if the original query string contains a spelling mistake.
	AlteredQuery *string `json:"alteredQuery,omitempty"`
	// AlterationOverrideQuery - READ-ONLY; The query string to use to force Bing to use the original string. For example, if the query string is "saling downwind", the override query string will be "+saling downwind". Remember to encode the query string which results in "%2Bsaling+downwind". This field is included only if the original query string contains a spelling mistake.
	AlterationOverrideQuery *string `json:"alterationOverrideQuery,omitempty"`
	// AdultIntent - READ-ONLY; A Boolean value that indicates whether the specified query has adult intent. The value is true if the query has adult intent; otherwise, false.
	AdultIntent *bool `json:"adultIntent,omitempty"`
	// AskUserForLocation - READ-ONLY; A Boolean value that indicates whether Bing requires the user's location to provide accurate results. If you specified the user's location by using the X-MSEdge-ClientIP and X-Search-Location headers, you can ignore this field. For location aware queries, such as "today's weather" or "restaurants near me" that need the user's location to provide accurate results, this field is set to true. For location aware queries that include the location (for example, "Seattle weather"), this field is set to false. This field is also set to false for queries that are not location aware, such as "best sellers".
	AskUserForLocation *bool `json:"askUserForLocation,omitempty"`
	// IsTransactional - READ-ONLY
	IsTransactional *bool `json:"isTransactional,omitempty"`
	// Type - Possible values include: 'TypeQueryContext'
	Type TypeBasicQueryContext `json:"_type,omitempty"`
}

QueryContext defines the query context that Bing used for the request.

func (QueryContext) AsBasicQueryContext

func (qc QueryContext) AsBasicQueryContext() (BasicQueryContext, bool)

AsBasicQueryContext is the BasicQueryContext implementation for QueryContext.

func (QueryContext) AsQueryContext

func (qc QueryContext) AsQueryContext() (*QueryContext, bool)

AsQueryContext is the BasicQueryContext implementation for QueryContext.

func (QueryContext) MarshalJSON

func (qc QueryContext) MarshalJSON() ([]byte, error)

MarshalJSON is the custom marshaler for QueryContext.

type Response

type Response struct {
	// ReadLink - READ-ONLY; The URL that returns this resource.
	ReadLink *string `json:"readLink,omitempty"`
	// WebSearchURL - READ-ONLY; The URL To Bing's search result for this item.
	WebSearchURL *string `json:"webSearchUrl,omitempty"`
	// PotentialAction - READ-ONLY
	PotentialAction *[]BasicAction `json:"potentialAction,omitempty"`
	// ImmediateAction - READ-ONLY
	ImmediateAction *[]BasicAction `json:"immediateAction,omitempty"`
	// PreferredClickthroughURL - READ-ONLY
	PreferredClickthroughURL *string `json:"preferredClickthroughUrl,omitempty"`
	// AdaptiveCard - READ-ONLY
	AdaptiveCard *string `json:"adaptiveCard,omitempty"`
	// ID - READ-ONLY; A String identifier.
	ID *string `json:"id,omitempty"`
	// Type - Possible values include: 'TypeResponseBase', 'TypeSearchAction', 'TypeSuggestions', 'TypeSearchResultsAnswer', 'TypeAnswer', 'TypeThing', 'TypeAction', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeCreativeWork'
	Type TypeBasicResponseBase `json:"_type,omitempty"`
}

Response defines a response. All schemas that could be returned at the root of a response should inherit from this

func (Response) AsAction

func (r Response) AsAction() (*Action, bool)

AsAction is the BasicResponseBase implementation for Response.

func (Response) AsAnswer

func (r Response) AsAnswer() (*Answer, bool)

AsAnswer is the BasicResponseBase implementation for Response.

func (Response) AsBasicAction

func (r Response) AsBasicAction() (BasicAction, bool)

AsBasicAction is the BasicResponseBase implementation for Response.

func (Response) AsBasicAnswer

func (r Response) AsBasicAnswer() (BasicAnswer, bool)

AsBasicAnswer is the BasicResponseBase implementation for Response.

func (Response) AsBasicCreativeWork

func (r Response) AsBasicCreativeWork() (BasicCreativeWork, bool)

AsBasicCreativeWork is the BasicResponseBase implementation for Response.

func (Response) AsBasicIdentifiable

func (r Response) AsBasicIdentifiable() (BasicIdentifiable, bool)

AsBasicIdentifiable is the BasicResponseBase implementation for Response.

func (Response) AsBasicResponse

func (r Response) AsBasicResponse() (BasicResponse, bool)

AsBasicResponse is the BasicResponseBase implementation for Response.

func (Response) AsBasicResponseBase

func (r Response) AsBasicResponseBase() (BasicResponseBase, bool)

AsBasicResponseBase is the BasicResponseBase implementation for Response.

func (Response) AsBasicSearchResultsAnswer

func (r Response) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool)

AsBasicSearchResultsAnswer is the BasicResponseBase implementation for Response.

func (Response) AsBasicThing

func (r Response) AsBasicThing() (BasicThing, bool)

AsBasicThing is the BasicResponseBase implementation for Response.

func (Response) AsCreativeWork

func (r Response) AsCreativeWork() (*CreativeWork, bool)

AsCreativeWork is the BasicResponseBase implementation for Response.

func (Response) AsErrorResponse

func (r Response) AsErrorResponse() (*ErrorResponse, bool)

AsErrorResponse is the BasicResponseBase implementation for Response.

func (Response) AsIdentifiable

func (r Response) AsIdentifiable() (*Identifiable, bool)

AsIdentifiable is the BasicResponseBase implementation for Response.

func (Response) AsResponse

func (r Response) AsResponse() (*Response, bool)

AsResponse is the BasicResponseBase implementation for Response.

func (Response) AsResponseBase

func (r Response) AsResponseBase() (*ResponseBase, bool)

AsResponseBase is the BasicResponseBase implementation for Response.

func (Response) AsSearchAction

func (r Response) AsSearchAction() (*SearchAction, bool)

AsSearchAction is the BasicResponseBase implementation for Response.

func (Response) AsSearchResultsAnswer

func (r Response) AsSearchResultsAnswer() (*SearchResultsAnswer, bool)

AsSearchResultsAnswer is the BasicResponseBase implementation for Response.

func (Response) AsSuggestions

func (r Response) AsSuggestions() (*Suggestions, bool)

AsSuggestions is the BasicResponseBase implementation for Response.

func (Response) AsThing

func (r Response) AsThing() (*Thing, bool)

AsThing is the BasicResponseBase implementation for Response.

func (Response) MarshalJSON

func (r Response) MarshalJSON() ([]byte, error)

MarshalJSON is the custom marshaler for Response.

func (*Response) UnmarshalJSON

func (r *Response) UnmarshalJSON(body []byte) error

UnmarshalJSON is the custom unmarshaler for Response struct.

type ResponseBase

type ResponseBase struct {
	// Type - Possible values include: 'TypeResponseBase', 'TypeSearchAction', 'TypeSuggestions', 'TypeSearchResultsAnswer', 'TypeAnswer', 'TypeThing', 'TypeAction', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeCreativeWork'
	Type TypeBasicResponseBase `json:"_type,omitempty"`
}

ResponseBase response base

func (ResponseBase) AsAction

func (rb ResponseBase) AsAction() (*Action, bool)

AsAction is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsAnswer

func (rb ResponseBase) AsAnswer() (*Answer, bool)

AsAnswer is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsBasicAction

func (rb ResponseBase) AsBasicAction() (BasicAction, bool)

AsBasicAction is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsBasicAnswer

func (rb ResponseBase) AsBasicAnswer() (BasicAnswer, bool)

AsBasicAnswer is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsBasicCreativeWork

func (rb ResponseBase) AsBasicCreativeWork() (BasicCreativeWork, bool)

AsBasicCreativeWork is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsBasicIdentifiable

func (rb ResponseBase) AsBasicIdentifiable() (BasicIdentifiable, bool)

AsBasicIdentifiable is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsBasicResponse

func (rb ResponseBase) AsBasicResponse() (BasicResponse, bool)

AsBasicResponse is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsBasicResponseBase

func (rb ResponseBase) AsBasicResponseBase() (BasicResponseBase, bool)

AsBasicResponseBase is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsBasicSearchResultsAnswer

func (rb ResponseBase) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool)

AsBasicSearchResultsAnswer is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsBasicThing

func (rb ResponseBase) AsBasicThing() (BasicThing, bool)

AsBasicThing is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsCreativeWork

func (rb ResponseBase) AsCreativeWork() (*CreativeWork, bool)

AsCreativeWork is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsErrorResponse

func (rb ResponseBase) AsErrorResponse() (*ErrorResponse, bool)

AsErrorResponse is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsIdentifiable

func (rb ResponseBase) AsIdentifiable() (*Identifiable, bool)

AsIdentifiable is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsResponse

func (rb ResponseBase) AsResponse() (*Response, bool)

AsResponse is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsResponseBase

func (rb ResponseBase) AsResponseBase() (*ResponseBase, bool)

AsResponseBase is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsSearchAction

func (rb ResponseBase) AsSearchAction() (*SearchAction, bool)

AsSearchAction is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsSearchResultsAnswer

func (rb ResponseBase) AsSearchResultsAnswer() (*SearchResultsAnswer, bool)

AsSearchResultsAnswer is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsSuggestions

func (rb ResponseBase) AsSuggestions() (*Suggestions, bool)

AsSuggestions is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsThing

func (rb ResponseBase) AsThing() (*Thing, bool)

AsThing is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) MarshalJSON

func (rb ResponseBase) MarshalJSON() ([]byte, error)

MarshalJSON is the custom marshaler for ResponseBase.

type ResponseFormat

type ResponseFormat string

ResponseFormat enumerates the values for response format.

const (
	// JSON ...
	JSON ResponseFormat = "Json"
	// JSONLd ...
	JSONLd ResponseFormat = "JsonLd"
)

func PossibleResponseFormatValues

func PossibleResponseFormatValues() []ResponseFormat

PossibleResponseFormatValues returns an array of possible values for the ResponseFormat const type.

type SafeSearch

type SafeSearch string

SafeSearch enumerates the values for safe search.

const (
	// Moderate ...
	Moderate SafeSearch = "Moderate"
	// Off ...
	Off SafeSearch = "Off"
	// Strict ...
	Strict SafeSearch = "Strict"
)

func PossibleSafeSearchValues

func PossibleSafeSearchValues() []SafeSearch

PossibleSafeSearchValues returns an array of possible values for the SafeSearch const type.

type ScenarioType

type ScenarioType string

ScenarioType enumerates the values for scenario type.

const (
	// Custom ...
	Custom ScenarioType = "Custom"
	// PersonalSearchDocuments ...
	PersonalSearchDocuments ScenarioType = "PersonalSearchDocuments"
	// PersonalSearchTags ...
	PersonalSearchTags ScenarioType = "PersonalSearchTags"
	// SearchHistory ...
	SearchHistory ScenarioType = "SearchHistory"
	// StoreApps ...
	StoreApps ScenarioType = "StoreApps"
	// Unknown ...
	Unknown ScenarioType = "Unknown"
	// Web ...
	Web ScenarioType = "Web"
)

func PossibleScenarioTypeValues

func PossibleScenarioTypeValues() []ScenarioType

PossibleScenarioTypeValues returns an array of possible values for the ScenarioType const type.

type SearchAction

type SearchAction struct {
	// DisplayText - READ-ONLY
	DisplayText *string `json:"displayText,omitempty"`
	// Query - READ-ONLY
	Query *string `json:"query,omitempty"`
	// SearchKind - READ-ONLY; Possible values include: 'WebSearch', 'HistorySearch', 'DocumentSearch', 'TagSearch', 'LocationSearch', 'CustomSearch'
	SearchKind SearchKind `json:"searchKind,omitempty"`
	// Result - READ-ONLY
	Result *[]BasicThing `json:"result,omitempty"`
	// DisplayName - READ-ONLY
	DisplayName *string `json:"displayName,omitempty"`
	// IsTopAction - READ-ONLY
	IsTopAction *bool `json:"isTopAction,omitempty"`
	// ServiceURL - READ-ONLY
	ServiceURL *string `json:"serviceUrl,omitempty"`
	// ThumbnailURL - READ-ONLY; The URL to a thumbnail of the item.
	ThumbnailURL *string `json:"thumbnailUrl,omitempty"`
	// About - READ-ONLY; For internal use only.
	About *[]BasicThing `json:"about,omitempty"`
	// Mentions - READ-ONLY; For internal use only.
	Mentions *[]BasicThing `json:"mentions,omitempty"`
	// Provider - READ-ONLY; The source of the creative work.
	Provider *[]BasicThing `json:"provider,omitempty"`
	// Creator - READ-ONLY
	Creator BasicThing `json:"creator,omitempty"`
	// Text - READ-ONLY; Text content of this creative work
	Text *string `json:"text,omitempty"`
	// DiscussionURL - READ-ONLY
	DiscussionURL *string `json:"discussionUrl,omitempty"`
	// CommentCount - READ-ONLY
	CommentCount *int32 `json:"commentCount,omitempty"`
	// MainEntity - READ-ONLY
	MainEntity BasicThing `json:"mainEntity,omitempty"`
	// HeadLine - READ-ONLY
	HeadLine *string `json:"headLine,omitempty"`
	// CopyrightHolder - READ-ONLY
	CopyrightHolder BasicThing `json:"copyrightHolder,omitempty"`
	// CopyrightYear - READ-ONLY
	CopyrightYear *int32 `json:"copyrightYear,omitempty"`
	// Disclaimer - READ-ONLY
	Disclaimer *string `json:"disclaimer,omitempty"`
	// IsAccessibleForFree - READ-ONLY
	IsAccessibleForFree *bool `json:"isAccessibleForFree,omitempty"`
	// Genre - READ-ONLY
	Genre *[]string `json:"genre,omitempty"`
	// IsFamilyFriendly - READ-ONLY
	IsFamilyFriendly *bool `json:"isFamilyFriendly,omitempty"`
	// URL - READ-ONLY; The URL to get more information about the thing represented by this object.
	URL *string `json:"url,omitempty"`
	// ReadLink - READ-ONLY; The URL that returns this resource.
	ReadLink *string `json:"readLink,omitempty"`
	// WebSearchURL - READ-ONLY; The URL To Bing's search result for this item.
	WebSearchURL *string `json:"webSearchUrl,omitempty"`
	// PotentialAction - READ-ONLY
	PotentialAction *[]BasicAction `json:"potentialAction,omitempty"`
	// ImmediateAction - READ-ONLY
	ImmediateAction *[]BasicAction `json:"immediateAction,omitempty"`
	// PreferredClickthroughURL - READ-ONLY
	PreferredClickthroughURL *string `json:"preferredClickthroughUrl,omitempty"`
	// AdaptiveCard - READ-ONLY
	AdaptiveCard *string `json:"adaptiveCard,omitempty"`
	// ID - READ-ONLY; A String identifier.
	ID *string `json:"id,omitempty"`
	// Type - Possible values include: 'TypeResponseBase', 'TypeSearchAction', 'TypeSuggestions', 'TypeSearchResultsAnswer', 'TypeAnswer', 'TypeThing', 'TypeAction', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeCreativeWork'
	Type TypeBasicResponseBase `json:"_type,omitempty"`
}

SearchAction ...

func (SearchAction) AsAction

func (sa SearchAction) AsAction() (*Action, bool)

AsAction is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsAnswer

func (sa SearchAction) AsAnswer() (*Answer, bool)

AsAnswer is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsBasicAction

func (sa SearchAction) AsBasicAction() (BasicAction, bool)

AsBasicAction is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsBasicAnswer

func (sa SearchAction) AsBasicAnswer() (BasicAnswer, bool)

AsBasicAnswer is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsBasicCreativeWork

func (sa SearchAction) AsBasicCreativeWork() (BasicCreativeWork, bool)

AsBasicCreativeWork is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsBasicIdentifiable

func (sa SearchAction) AsBasicIdentifiable() (BasicIdentifiable, bool)

AsBasicIdentifiable is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsBasicResponse

func (sa SearchAction) AsBasicResponse() (BasicResponse, bool)

AsBasicResponse is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsBasicResponseBase

func (sa SearchAction) AsBasicResponseBase() (BasicResponseBase, bool)

AsBasicResponseBase is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsBasicSearchResultsAnswer

func (sa SearchAction) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool)

AsBasicSearchResultsAnswer is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsBasicThing

func (sa SearchAction) AsBasicThing() (BasicThing, bool)

AsBasicThing is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsCreativeWork

func (sa SearchAction) AsCreativeWork() (*CreativeWork, bool)

AsCreativeWork is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsErrorResponse

func (sa SearchAction) AsErrorResponse() (*ErrorResponse, bool)

AsErrorResponse is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsIdentifiable

func (sa SearchAction) AsIdentifiable() (*Identifiable, bool)

AsIdentifiable is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsResponse

func (sa SearchAction) AsResponse() (*Response, bool)

AsResponse is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsResponseBase

func (sa SearchAction) AsResponseBase() (*ResponseBase, bool)

AsResponseBase is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsSearchAction

func (sa SearchAction) AsSearchAction() (*SearchAction, bool)

AsSearchAction is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsSearchResultsAnswer

func (sa SearchAction) AsSearchResultsAnswer() (*SearchResultsAnswer, bool)

AsSearchResultsAnswer is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsSuggestions

func (sa SearchAction) AsSuggestions() (*Suggestions, bool)

AsSuggestions is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsThing

func (sa SearchAction) AsThing() (*Thing, bool)

AsThing is the BasicResponseBase implementation for SearchAction.

func (SearchAction) MarshalJSON

func (sa SearchAction) MarshalJSON() ([]byte, error)

MarshalJSON is the custom marshaler for SearchAction.

func (*SearchAction) UnmarshalJSON

func (sa *SearchAction) UnmarshalJSON(body []byte) error

UnmarshalJSON is the custom unmarshaler for SearchAction struct.

type SearchKind

type SearchKind string

SearchKind enumerates the values for search kind.

const (
	// CustomSearch ...
	CustomSearch SearchKind = "CustomSearch"
	// DocumentSearch ...
	DocumentSearch SearchKind = "DocumentSearch"
	// HistorySearch ...
	HistorySearch SearchKind = "HistorySearch"
	// LocationSearch ...
	LocationSearch SearchKind = "LocationSearch"
	// TagSearch ...
	TagSearch SearchKind = "TagSearch"
	// WebSearch ...
	WebSearch SearchKind = "WebSearch"
)

func PossibleSearchKindValues

func PossibleSearchKindValues() []SearchKind

PossibleSearchKindValues returns an array of possible values for the SearchKind const type.

type SearchResultsAnswer

type SearchResultsAnswer struct {
	// QueryContext - READ-ONLY
	QueryContext BasicQueryContext `json:"queryContext,omitempty"`
	// ReadLink - READ-ONLY; The URL that returns this resource.
	ReadLink *string `json:"readLink,omitempty"`
	// WebSearchURL - READ-ONLY; The URL To Bing's search result for this item.
	WebSearchURL *string `json:"webSearchUrl,omitempty"`
	// PotentialAction - READ-ONLY
	PotentialAction *[]BasicAction `json:"potentialAction,omitempty"`
	// ImmediateAction - READ-ONLY
	ImmediateAction *[]BasicAction `json:"immediateAction,omitempty"`
	// PreferredClickthroughURL - READ-ONLY
	PreferredClickthroughURL *string `json:"preferredClickthroughUrl,omitempty"`
	// AdaptiveCard - READ-ONLY
	AdaptiveCard *string `json:"adaptiveCard,omitempty"`
	// ID - READ-ONLY; A String identifier.
	ID *string `json:"id,omitempty"`
	// Type - Possible values include: 'TypeResponseBase', 'TypeSearchAction', 'TypeSuggestions', 'TypeSearchResultsAnswer', 'TypeAnswer', 'TypeThing', 'TypeAction', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeCreativeWork'
	Type TypeBasicResponseBase `json:"_type,omitempty"`
}

SearchResultsAnswer defines a search result answer.

func (SearchResultsAnswer) AsAction

func (sra SearchResultsAnswer) AsAction() (*Action, bool)

AsAction is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsAnswer

func (sra SearchResultsAnswer) AsAnswer() (*Answer, bool)

AsAnswer is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsBasicAction

func (sra SearchResultsAnswer) AsBasicAction() (BasicAction, bool)

AsBasicAction is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsBasicAnswer

func (sra SearchResultsAnswer) AsBasicAnswer() (BasicAnswer, bool)

AsBasicAnswer is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsBasicCreativeWork

func (sra SearchResultsAnswer) AsBasicCreativeWork() (BasicCreativeWork, bool)

AsBasicCreativeWork is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsBasicIdentifiable

func (sra SearchResultsAnswer) AsBasicIdentifiable() (BasicIdentifiable, bool)

AsBasicIdentifiable is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsBasicResponse

func (sra SearchResultsAnswer) AsBasicResponse() (BasicResponse, bool)

AsBasicResponse is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsBasicResponseBase

func (sra SearchResultsAnswer) AsBasicResponseBase() (BasicResponseBase, bool)

AsBasicResponseBase is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsBasicSearchResultsAnswer

func (sra SearchResultsAnswer) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool)

AsBasicSearchResultsAnswer is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsBasicThing

func (sra SearchResultsAnswer) AsBasicThing() (BasicThing, bool)

AsBasicThing is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsCreativeWork

func (sra SearchResultsAnswer) AsCreativeWork() (*CreativeWork, bool)

AsCreativeWork is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsErrorResponse

func (sra SearchResultsAnswer) AsErrorResponse() (*ErrorResponse, bool)

AsErrorResponse is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsIdentifiable

func (sra SearchResultsAnswer) AsIdentifiable() (*Identifiable, bool)

AsIdentifiable is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsResponse

func (sra SearchResultsAnswer) AsResponse() (*Response, bool)

AsResponse is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsResponseBase

func (sra SearchResultsAnswer) AsResponseBase() (*ResponseBase, bool)

AsResponseBase is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsSearchAction

func (sra SearchResultsAnswer) AsSearchAction() (*SearchAction, bool)

AsSearchAction is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsSearchResultsAnswer

func (sra SearchResultsAnswer) AsSearchResultsAnswer() (*SearchResultsAnswer, bool)

AsSearchResultsAnswer is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsSuggestions

func (sra SearchResultsAnswer) AsSuggestions() (*Suggestions, bool)

AsSuggestions is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsThing

func (sra SearchResultsAnswer) AsThing() (*Thing, bool)

AsThing is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) MarshalJSON

func (sra SearchResultsAnswer) MarshalJSON() ([]byte, error)

MarshalJSON is the custom marshaler for SearchResultsAnswer.

func (*SearchResultsAnswer) UnmarshalJSON

func (sra *SearchResultsAnswer) UnmarshalJSON(body []byte) error

UnmarshalJSON is the custom unmarshaler for SearchResultsAnswer struct.

type Suggestions

type Suggestions struct {
	autorest.Response `json:"-"`
	SuggestionGroups  *[]BasicSuggestionsSuggestionGroup `json:"suggestionGroups,omitempty"`
	// QueryContext - READ-ONLY
	QueryContext BasicQueryContext `json:"queryContext,omitempty"`
	// ReadLink - READ-ONLY; The URL that returns this resource.
	ReadLink *string `json:"readLink,omitempty"`
	// WebSearchURL - READ-ONLY; The URL To Bing's search result for this item.
	WebSearchURL *string `json:"webSearchUrl,omitempty"`
	// PotentialAction - READ-ONLY
	PotentialAction *[]BasicAction `json:"potentialAction,omitempty"`
	// ImmediateAction - READ-ONLY
	ImmediateAction *[]BasicAction `json:"immediateAction,omitempty"`
	// PreferredClickthroughURL - READ-ONLY
	PreferredClickthroughURL *string `json:"preferredClickthroughUrl,omitempty"`
	// AdaptiveCard - READ-ONLY
	AdaptiveCard *string `json:"adaptiveCard,omitempty"`
	// ID - READ-ONLY; A String identifier.
	ID *string `json:"id,omitempty"`
	// Type - Possible values include: 'TypeResponseBase', 'TypeSearchAction', 'TypeSuggestions', 'TypeSearchResultsAnswer', 'TypeAnswer', 'TypeThing', 'TypeAction', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeCreativeWork'
	Type TypeBasicResponseBase `json:"_type,omitempty"`
}

Suggestions ...

func (Suggestions) AsAction

func (s Suggestions) AsAction() (*Action, bool)

AsAction is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsAnswer

func (s Suggestions) AsAnswer() (*Answer, bool)

AsAnswer is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsBasicAction

func (s Suggestions) AsBasicAction() (BasicAction, bool)

AsBasicAction is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsBasicAnswer

func (s Suggestions) AsBasicAnswer() (BasicAnswer, bool)

AsBasicAnswer is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsBasicCreativeWork

func (s Suggestions) AsBasicCreativeWork() (BasicCreativeWork, bool)

AsBasicCreativeWork is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsBasicIdentifiable

func (s Suggestions) AsBasicIdentifiable() (BasicIdentifiable, bool)

AsBasicIdentifiable is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsBasicResponse

func (s Suggestions) AsBasicResponse() (BasicResponse, bool)

AsBasicResponse is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsBasicResponseBase

func (s Suggestions) AsBasicResponseBase() (BasicResponseBase, bool)

AsBasicResponseBase is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsBasicSearchResultsAnswer

func (s Suggestions) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool)

AsBasicSearchResultsAnswer is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsBasicThing

func (s Suggestions) AsBasicThing() (BasicThing, bool)

AsBasicThing is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsCreativeWork

func (s Suggestions) AsCreativeWork() (*CreativeWork, bool)

AsCreativeWork is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsErrorResponse

func (s Suggestions) AsErrorResponse() (*ErrorResponse, bool)

AsErrorResponse is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsIdentifiable

func (s Suggestions) AsIdentifiable() (*Identifiable, bool)

AsIdentifiable is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsResponse

func (s Suggestions) AsResponse() (*Response, bool)

AsResponse is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsResponseBase

func (s Suggestions) AsResponseBase() (*ResponseBase, bool)

AsResponseBase is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsSearchAction

func (s Suggestions) AsSearchAction() (*SearchAction, bool)

AsSearchAction is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsSearchResultsAnswer

func (s Suggestions) AsSearchResultsAnswer() (*SearchResultsAnswer, bool)

AsSearchResultsAnswer is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsSuggestions

func (s Suggestions) AsSuggestions() (*Suggestions, bool)

AsSuggestions is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsThing

func (s Suggestions) AsThing() (*Thing, bool)

AsThing is the BasicResponseBase implementation for Suggestions.

func (Suggestions) MarshalJSON

func (s Suggestions) MarshalJSON() ([]byte, error)

MarshalJSON is the custom marshaler for Suggestions.

func (*Suggestions) UnmarshalJSON

func (s *Suggestions) UnmarshalJSON(body []byte) error

UnmarshalJSON is the custom unmarshaler for Suggestions struct.

type SuggestionsSuggestionGroup

type SuggestionsSuggestionGroup struct {
	// Name - Possible values include: 'Unknown', 'Web', 'StoreApps', 'SearchHistory', 'PersonalSearchDocuments', 'PersonalSearchTags', 'Custom'
	Name              ScenarioType    `json:"name,omitempty"`
	SearchSuggestions *[]SearchAction `json:"searchSuggestions,omitempty"`
	// Type - Possible values include: 'TypeSuggestionsSuggestionGroup'
	Type Type `json:"_type,omitempty"`
}

SuggestionsSuggestionGroup ...

func (SuggestionsSuggestionGroup) AsBasicSuggestionsSuggestionGroup

func (ssg SuggestionsSuggestionGroup) AsBasicSuggestionsSuggestionGroup() (BasicSuggestionsSuggestionGroup, bool)

AsBasicSuggestionsSuggestionGroup is the BasicSuggestionsSuggestionGroup implementation for SuggestionsSuggestionGroup.

func (SuggestionsSuggestionGroup) AsSuggestionsSuggestionGroup

func (ssg SuggestionsSuggestionGroup) AsSuggestionsSuggestionGroup() (*SuggestionsSuggestionGroup, bool)

AsSuggestionsSuggestionGroup is the BasicSuggestionsSuggestionGroup implementation for SuggestionsSuggestionGroup.

func (SuggestionsSuggestionGroup) MarshalJSON

func (ssg SuggestionsSuggestionGroup) MarshalJSON() ([]byte, error)

MarshalJSON is the custom marshaler for SuggestionsSuggestionGroup.

type Thing

type Thing struct {
	// URL - READ-ONLY; The URL to get more information about the thing represented by this object.
	URL *string `json:"url,omitempty"`
	// ReadLink - READ-ONLY; The URL that returns this resource.
	ReadLink *string `json:"readLink,omitempty"`
	// WebSearchURL - READ-ONLY; The URL To Bing's search result for this item.
	WebSearchURL *string `json:"webSearchUrl,omitempty"`
	// PotentialAction - READ-ONLY
	PotentialAction *[]BasicAction `json:"potentialAction,omitempty"`
	// ImmediateAction - READ-ONLY
	ImmediateAction *[]BasicAction `json:"immediateAction,omitempty"`
	// PreferredClickthroughURL - READ-ONLY
	PreferredClickthroughURL *string `json:"preferredClickthroughUrl,omitempty"`
	// AdaptiveCard - READ-ONLY
	AdaptiveCard *string `json:"adaptiveCard,omitempty"`
	// ID - READ-ONLY; A String identifier.
	ID *string `json:"id,omitempty"`
	// Type - Possible values include: 'TypeResponseBase', 'TypeSearchAction', 'TypeSuggestions', 'TypeSearchResultsAnswer', 'TypeAnswer', 'TypeThing', 'TypeAction', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeCreativeWork'
	Type TypeBasicResponseBase `json:"_type,omitempty"`
}

Thing defines a thing.

func (Thing) AsAction

func (t Thing) AsAction() (*Action, bool)

AsAction is the BasicResponseBase implementation for Thing.

func (Thing) AsAnswer

func (t Thing) AsAnswer() (*Answer, bool)

AsAnswer is the BasicResponseBase implementation for Thing.

func (Thing) AsBasicAction

func (t Thing) AsBasicAction() (BasicAction, bool)

AsBasicAction is the BasicResponseBase implementation for Thing.

func (Thing) AsBasicAnswer

func (t Thing) AsBasicAnswer() (BasicAnswer, bool)

AsBasicAnswer is the BasicResponseBase implementation for Thing.

func (Thing) AsBasicCreativeWork

func (t Thing) AsBasicCreativeWork() (BasicCreativeWork, bool)

AsBasicCreativeWork is the BasicResponseBase implementation for Thing.

func (Thing) AsBasicIdentifiable

func (t Thing) AsBasicIdentifiable() (BasicIdentifiable, bool)

AsBasicIdentifiable is the BasicResponseBase implementation for Thing.

func (Thing) AsBasicResponse

func (t Thing) AsBasicResponse() (BasicResponse, bool)

AsBasicResponse is the BasicResponseBase implementation for Thing.

func (Thing) AsBasicResponseBase

func (t Thing) AsBasicResponseBase() (BasicResponseBase, bool)

AsBasicResponseBase is the BasicResponseBase implementation for Thing.

func (Thing) AsBasicSearchResultsAnswer

func (t Thing) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool)

AsBasicSearchResultsAnswer is the BasicResponseBase implementation for Thing.

func (Thing) AsBasicThing

func (t Thing) AsBasicThing() (BasicThing, bool)

AsBasicThing is the BasicResponseBase implementation for Thing.

func (Thing) AsCreativeWork

func (t Thing) AsCreativeWork() (*CreativeWork, bool)

AsCreativeWork is the BasicResponseBase implementation for Thing.

func (Thing) AsErrorResponse

func (t Thing) AsErrorResponse() (*ErrorResponse, bool)

AsErrorResponse is the BasicResponseBase implementation for Thing.

func (Thing) AsIdentifiable

func (t Thing) AsIdentifiable() (*Identifiable, bool)

AsIdentifiable is the BasicResponseBase implementation for Thing.

func (Thing) AsResponse

func (t Thing) AsResponse() (*Response, bool)

AsResponse is the BasicResponseBase implementation for Thing.

func (Thing) AsResponseBase

func (t Thing) AsResponseBase() (*ResponseBase, bool)

AsResponseBase is the BasicResponseBase implementation for Thing.

func (Thing) AsSearchAction

func (t Thing) AsSearchAction() (*SearchAction, bool)

AsSearchAction is the BasicResponseBase implementation for Thing.

func (Thing) AsSearchResultsAnswer

func (t Thing) AsSearchResultsAnswer() (*SearchResultsAnswer, bool)

AsSearchResultsAnswer is the BasicResponseBase implementation for Thing.

func (Thing) AsSuggestions

func (t Thing) AsSuggestions() (*Suggestions, bool)

AsSuggestions is the BasicResponseBase implementation for Thing.

func (Thing) AsThing

func (t Thing) AsThing() (*Thing, bool)

AsThing is the BasicResponseBase implementation for Thing.

func (Thing) MarshalJSON

func (t Thing) MarshalJSON() ([]byte, error)

MarshalJSON is the custom marshaler for Thing.

func (*Thing) UnmarshalJSON

func (t *Thing) UnmarshalJSON(body []byte) error

UnmarshalJSON is the custom unmarshaler for Thing struct.

type Type

type Type string

Type enumerates the values for type.

const (
	// TypeSuggestionsSuggestionGroup ...
	TypeSuggestionsSuggestionGroup Type = "Suggestions/SuggestionGroup"
)

func PossibleTypeValues

func PossibleTypeValues() []Type

PossibleTypeValues returns an array of possible values for the Type const type.

type TypeBasicError

type TypeBasicError string

TypeBasicError enumerates the values for type basic error.

const (
	// TypeError ...
	TypeError TypeBasicError = "Error"
)

func PossibleTypeBasicErrorValues

func PossibleTypeBasicErrorValues() []TypeBasicError

PossibleTypeBasicErrorValues returns an array of possible values for the TypeBasicError const type.

type TypeBasicQueryContext

type TypeBasicQueryContext string

TypeBasicQueryContext enumerates the values for type basic query context.

const (
	// TypeQueryContext ...
	TypeQueryContext TypeBasicQueryContext = "QueryContext"
)

func PossibleTypeBasicQueryContextValues

func PossibleTypeBasicQueryContextValues() []TypeBasicQueryContext

PossibleTypeBasicQueryContextValues returns an array of possible values for the TypeBasicQueryContext const type.

type TypeBasicResponseBase

type TypeBasicResponseBase string

TypeBasicResponseBase enumerates the values for type basic response base.

const (
	// TypeAction ...
	TypeAction TypeBasicResponseBase = "Action"
	// TypeAnswer ...
	TypeAnswer TypeBasicResponseBase = "Answer"
	// TypeCreativeWork ...
	TypeCreativeWork TypeBasicResponseBase = "CreativeWork"
	// TypeErrorResponse ...
	TypeErrorResponse TypeBasicResponseBase = "ErrorResponse"
	// TypeIdentifiable ...
	TypeIdentifiable TypeBasicResponseBase = "Identifiable"
	// TypeResponse ...
	TypeResponse TypeBasicResponseBase = "Response"
	// TypeResponseBase ...
	TypeResponseBase TypeBasicResponseBase = "ResponseBase"
	// TypeSearchAction ...
	TypeSearchAction TypeBasicResponseBase = "SearchAction"
	// TypeSearchResultsAnswer ...
	TypeSearchResultsAnswer TypeBasicResponseBase = "SearchResultsAnswer"
	// TypeSuggestions ...
	TypeSuggestions TypeBasicResponseBase = "Suggestions"
	// TypeThing ...
	TypeThing TypeBasicResponseBase = "Thing"
)

func PossibleTypeBasicResponseBaseValues

func PossibleTypeBasicResponseBaseValues() []TypeBasicResponseBase

PossibleTypeBasicResponseBaseValues returns an array of possible values for the TypeBasicResponseBase const type.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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