azure-sdk-for-go: github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/autosuggest Index | Files | Directories

package autosuggest

import "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/autosuggest"

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

Package Files

client.go models.go version.go

Constants

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

func UserAgent Uses

func UserAgent() string

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

func Version Uses

func Version() string

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

type Action Uses

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 Uses

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

AsAction is the BasicResponseBase implementation for Action.

func (Action) AsAnswer Uses

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

AsAnswer is the BasicResponseBase implementation for Action.

func (Action) AsBasicAction Uses

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

AsBasicAction is the BasicResponseBase implementation for Action.

func (Action) AsBasicAnswer Uses

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

AsBasicAnswer is the BasicResponseBase implementation for Action.

func (Action) AsBasicCreativeWork Uses

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

AsBasicCreativeWork is the BasicResponseBase implementation for Action.

func (Action) AsBasicIdentifiable Uses

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

AsBasicIdentifiable is the BasicResponseBase implementation for Action.

func (Action) AsBasicResponse Uses

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

AsBasicResponse is the BasicResponseBase implementation for Action.

func (Action) AsBasicResponseBase Uses

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

AsBasicResponseBase is the BasicResponseBase implementation for Action.

func (Action) AsBasicSearchResultsAnswer Uses

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

AsBasicSearchResultsAnswer is the BasicResponseBase implementation for Action.

func (Action) AsBasicThing Uses

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

AsBasicThing is the BasicResponseBase implementation for Action.

func (Action) AsCreativeWork Uses

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

AsCreativeWork is the BasicResponseBase implementation for Action.

func (Action) AsErrorResponse Uses

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

AsErrorResponse is the BasicResponseBase implementation for Action.

func (Action) AsIdentifiable Uses

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

AsIdentifiable is the BasicResponseBase implementation for Action.

func (Action) AsResponse Uses

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

AsResponse is the BasicResponseBase implementation for Action.

func (Action) AsResponseBase Uses

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

AsResponseBase is the BasicResponseBase implementation for Action.

func (Action) AsSearchAction Uses

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

AsSearchAction is the BasicResponseBase implementation for Action.

func (Action) AsSearchResultsAnswer Uses

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

AsSearchResultsAnswer is the BasicResponseBase implementation for Action.

func (Action) AsSuggestions Uses

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

AsSuggestions is the BasicResponseBase implementation for Action.

func (Action) AsThing Uses

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

AsThing is the BasicResponseBase implementation for Action.

func (Action) MarshalJSON Uses

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

MarshalJSON is the custom marshaler for Action.

func (*Action) UnmarshalJSON Uses

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

UnmarshalJSON is the custom unmarshaler for Action struct.

type Answer Uses

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 Uses

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

AsAction is the BasicResponseBase implementation for Answer.

func (Answer) AsAnswer Uses

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

AsAnswer is the BasicResponseBase implementation for Answer.

func (Answer) AsBasicAction Uses

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

AsBasicAction is the BasicResponseBase implementation for Answer.

func (Answer) AsBasicAnswer Uses

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

AsBasicAnswer is the BasicResponseBase implementation for Answer.

func (Answer) AsBasicCreativeWork Uses

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

AsBasicCreativeWork is the BasicResponseBase implementation for Answer.

func (Answer) AsBasicIdentifiable Uses

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

AsBasicIdentifiable is the BasicResponseBase implementation for Answer.

func (Answer) AsBasicResponse Uses

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

AsBasicResponse is the BasicResponseBase implementation for Answer.

func (Answer) AsBasicResponseBase Uses

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

AsBasicResponseBase is the BasicResponseBase implementation for Answer.

func (Answer) AsBasicSearchResultsAnswer Uses

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

AsBasicSearchResultsAnswer is the BasicResponseBase implementation for Answer.

func (Answer) AsBasicThing Uses

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

AsBasicThing is the BasicResponseBase implementation for Answer.

func (Answer) AsCreativeWork Uses

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

AsCreativeWork is the BasicResponseBase implementation for Answer.

func (Answer) AsErrorResponse Uses

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

AsErrorResponse is the BasicResponseBase implementation for Answer.

func (Answer) AsIdentifiable Uses

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

AsIdentifiable is the BasicResponseBase implementation for Answer.

func (Answer) AsResponse Uses

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

AsResponse is the BasicResponseBase implementation for Answer.

func (Answer) AsResponseBase Uses

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

AsResponseBase is the BasicResponseBase implementation for Answer.

func (Answer) AsSearchAction Uses

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

AsSearchAction is the BasicResponseBase implementation for Answer.

func (Answer) AsSearchResultsAnswer Uses

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

AsSearchResultsAnswer is the BasicResponseBase implementation for Answer.

func (Answer) AsSuggestions Uses

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

AsSuggestions is the BasicResponseBase implementation for Answer.

func (Answer) AsThing Uses

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

AsThing is the BasicResponseBase implementation for Answer.

func (Answer) MarshalJSON Uses

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

MarshalJSON is the custom marshaler for Answer.

func (*Answer) UnmarshalJSON Uses

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

UnmarshalJSON is the custom unmarshaler for Answer struct.

type BaseClient Uses

type BaseClient struct {
    autorest.Client
    Endpoint string
}

BaseClient is the base client for Autosuggest.

func New Uses

func New() BaseClient

New creates an instance of the BaseClient client.

func NewWithoutDefaults Uses

func NewWithoutDefaults(endpoint string) BaseClient

NewWithoutDefaults creates an instance of the BaseClient client.

func (BaseClient) AutoSuggest Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

BasicAction ...

type BasicAnswer Uses

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

BasicAnswer defines an answer.

type BasicCreativeWork Uses

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 Uses

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

BasicError defines the error that occurred.

type BasicIdentifiable Uses

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 Uses

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

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

type BasicResponse Uses

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 Uses

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 Uses

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

BasicSearchResultsAnswer defines a search result answer.

type BasicSuggestionsSuggestionGroup Uses

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

BasicSuggestionsSuggestionGroup ...

type BasicThing Uses

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 Uses

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 Uses

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

AsAction is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsAnswer Uses

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

AsAnswer is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsBasicAction Uses

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

AsBasicAction is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsBasicAnswer Uses

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

AsBasicAnswer is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsBasicCreativeWork Uses

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

AsBasicCreativeWork is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsBasicIdentifiable Uses

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

AsBasicIdentifiable is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsBasicResponse Uses

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

AsBasicResponse is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsBasicResponseBase Uses

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

AsBasicResponseBase is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsBasicSearchResultsAnswer Uses

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

AsBasicSearchResultsAnswer is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsBasicThing Uses

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

AsBasicThing is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsCreativeWork Uses

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

AsCreativeWork is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsErrorResponse Uses

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

AsErrorResponse is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsIdentifiable Uses

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

AsIdentifiable is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsResponse Uses

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

AsResponse is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsResponseBase Uses

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

AsResponseBase is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsSearchAction Uses

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

AsSearchAction is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsSearchResultsAnswer Uses

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

AsSearchResultsAnswer is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsSuggestions Uses

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

AsSuggestions is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) AsThing Uses

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

AsThing is the BasicResponseBase implementation for CreativeWork.

func (CreativeWork) MarshalJSON Uses

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

MarshalJSON is the custom marshaler for CreativeWork.

func (*CreativeWork) UnmarshalJSON Uses

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

UnmarshalJSON is the custom unmarshaler for CreativeWork struct.

type Error Uses

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 Uses

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

AsBasicError is the BasicError implementation for Error.

func (Error) AsError Uses

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

AsError is the BasicError implementation for Error.

func (Error) MarshalJSON Uses

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

MarshalJSON is the custom marshaler for Error.

type ErrorCode Uses

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 Uses

func PossibleErrorCodeValues() []ErrorCode

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

type ErrorResponse Uses

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 Uses

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

AsAction is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsAnswer Uses

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

AsAnswer is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsBasicAction Uses

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

AsBasicAction is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsBasicAnswer Uses

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

AsBasicAnswer is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsBasicCreativeWork Uses

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

AsBasicCreativeWork is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsBasicIdentifiable Uses

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

AsBasicIdentifiable is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsBasicResponse Uses

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

AsBasicResponse is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsBasicResponseBase Uses

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

AsBasicResponseBase is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsBasicSearchResultsAnswer Uses

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

AsBasicSearchResultsAnswer is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsBasicThing Uses

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

AsBasicThing is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsCreativeWork Uses

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

AsCreativeWork is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsErrorResponse Uses

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

AsErrorResponse is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsIdentifiable Uses

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

AsIdentifiable is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsResponse Uses

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

AsResponse is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsResponseBase Uses

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

AsResponseBase is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsSearchAction Uses

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

AsSearchAction is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsSearchResultsAnswer Uses

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

AsSearchResultsAnswer is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsSuggestions Uses

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

AsSuggestions is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsThing Uses

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

AsThing is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) MarshalJSON Uses

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

MarshalJSON is the custom marshaler for ErrorResponse.

func (*ErrorResponse) UnmarshalJSON Uses

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

UnmarshalJSON is the custom unmarshaler for ErrorResponse struct.

type Identifiable Uses

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 Uses

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

AsAction is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsAnswer Uses

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

AsAnswer is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsBasicAction Uses

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

AsBasicAction is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsBasicAnswer Uses

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

AsBasicAnswer is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsBasicCreativeWork Uses

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

AsBasicCreativeWork is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsBasicIdentifiable Uses

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

AsBasicIdentifiable is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsBasicResponse Uses

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

AsBasicResponse is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsBasicResponseBase Uses

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

AsBasicResponseBase is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsBasicSearchResultsAnswer Uses

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

AsBasicSearchResultsAnswer is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsBasicThing Uses

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

AsBasicThing is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsCreativeWork Uses

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

AsCreativeWork is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsErrorResponse Uses

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

AsErrorResponse is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsIdentifiable Uses

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

AsIdentifiable is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsResponse Uses

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

AsResponse is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsResponseBase Uses

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

AsResponseBase is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsSearchAction Uses

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

AsSearchAction is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsSearchResultsAnswer Uses

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

AsSearchResultsAnswer is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsSuggestions Uses

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

AsSuggestions is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsThing Uses

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

AsThing is the BasicResponseBase implementation for Identifiable.

func (Identifiable) MarshalJSON Uses

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

MarshalJSON is the custom marshaler for Identifiable.

type QueryContext Uses

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 Uses

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

AsBasicQueryContext is the BasicQueryContext implementation for QueryContext.

func (QueryContext) AsQueryContext Uses

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

AsQueryContext is the BasicQueryContext implementation for QueryContext.

func (QueryContext) MarshalJSON Uses

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

MarshalJSON is the custom marshaler for QueryContext.

type Response Uses

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 Uses

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

AsAction is the BasicResponseBase implementation for Response.

func (Response) AsAnswer Uses

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

AsAnswer is the BasicResponseBase implementation for Response.

func (Response) AsBasicAction Uses

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

AsBasicAction is the BasicResponseBase implementation for Response.

func (Response) AsBasicAnswer Uses

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

AsBasicAnswer is the BasicResponseBase implementation for Response.

func (Response) AsBasicCreativeWork Uses

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

AsBasicCreativeWork is the BasicResponseBase implementation for Response.

func (Response) AsBasicIdentifiable Uses

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

AsBasicIdentifiable is the BasicResponseBase implementation for Response.

func (Response) AsBasicResponse Uses

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

AsBasicResponse is the BasicResponseBase implementation for Response.

func (Response) AsBasicResponseBase Uses

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

AsBasicResponseBase is the BasicResponseBase implementation for Response.

func (Response) AsBasicSearchResultsAnswer Uses

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

AsBasicSearchResultsAnswer is the BasicResponseBase implementation for Response.

func (Response) AsBasicThing Uses

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

AsBasicThing is the BasicResponseBase implementation for Response.

func (Response) AsCreativeWork Uses

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

AsCreativeWork is the BasicResponseBase implementation for Response.

func (Response) AsErrorResponse Uses

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

AsErrorResponse is the BasicResponseBase implementation for Response.

func (Response) AsIdentifiable Uses

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

AsIdentifiable is the BasicResponseBase implementation for Response.

func (Response) AsResponse Uses

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

AsResponse is the BasicResponseBase implementation for Response.

func (Response) AsResponseBase Uses

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

AsResponseBase is the BasicResponseBase implementation for Response.

func (Response) AsSearchAction Uses

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

AsSearchAction is the BasicResponseBase implementation for Response.

func (Response) AsSearchResultsAnswer Uses

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

AsSearchResultsAnswer is the BasicResponseBase implementation for Response.

func (Response) AsSuggestions Uses

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

AsSuggestions is the BasicResponseBase implementation for Response.

func (Response) AsThing Uses

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

AsThing is the BasicResponseBase implementation for Response.

func (Response) MarshalJSON Uses

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

MarshalJSON is the custom marshaler for Response.

func (*Response) UnmarshalJSON Uses

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

UnmarshalJSON is the custom unmarshaler for Response struct.

type ResponseBase Uses

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 Uses

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

AsAction is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsAnswer Uses

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

AsAnswer is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsBasicAction Uses

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

AsBasicAction is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsBasicAnswer Uses

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

AsBasicAnswer is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsBasicCreativeWork Uses

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

AsBasicCreativeWork is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsBasicIdentifiable Uses

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

AsBasicIdentifiable is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsBasicResponse Uses

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

AsBasicResponse is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsBasicResponseBase Uses

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

AsBasicResponseBase is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsBasicSearchResultsAnswer Uses

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

AsBasicSearchResultsAnswer is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsBasicThing Uses

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

AsBasicThing is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsCreativeWork Uses

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

AsCreativeWork is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsErrorResponse Uses

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

AsErrorResponse is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsIdentifiable Uses

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

AsIdentifiable is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsResponse Uses

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

AsResponse is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsResponseBase Uses

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

AsResponseBase is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsSearchAction Uses

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

AsSearchAction is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsSearchResultsAnswer Uses

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

AsSearchResultsAnswer is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsSuggestions Uses

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

AsSuggestions is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsThing Uses

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

AsThing is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) MarshalJSON Uses

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

MarshalJSON is the custom marshaler for ResponseBase.

type ResponseFormat Uses

type ResponseFormat string

ResponseFormat enumerates the values for response format.

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

func PossibleResponseFormatValues Uses

func PossibleResponseFormatValues() []ResponseFormat

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

type SafeSearch Uses

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 Uses

func PossibleSafeSearchValues() []SafeSearch

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

type ScenarioType Uses

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 Uses

func PossibleScenarioTypeValues() []ScenarioType

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

type SearchAction Uses

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 Uses

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

AsAction is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsAnswer Uses

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

AsAnswer is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsBasicAction Uses

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

AsBasicAction is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsBasicAnswer Uses

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

AsBasicAnswer is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsBasicCreativeWork Uses

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

AsBasicCreativeWork is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsBasicIdentifiable Uses

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

AsBasicIdentifiable is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsBasicResponse Uses

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

AsBasicResponse is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsBasicResponseBase Uses

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

AsBasicResponseBase is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsBasicSearchResultsAnswer Uses

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

AsBasicSearchResultsAnswer is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsBasicThing Uses

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

AsBasicThing is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsCreativeWork Uses

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

AsCreativeWork is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsErrorResponse Uses

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

AsErrorResponse is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsIdentifiable Uses

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

AsIdentifiable is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsResponse Uses

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

AsResponse is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsResponseBase Uses

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

AsResponseBase is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsSearchAction Uses

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

AsSearchAction is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsSearchResultsAnswer Uses

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

AsSearchResultsAnswer is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsSuggestions Uses

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

AsSuggestions is the BasicResponseBase implementation for SearchAction.

func (SearchAction) AsThing Uses

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

AsThing is the BasicResponseBase implementation for SearchAction.

func (SearchAction) MarshalJSON Uses

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

MarshalJSON is the custom marshaler for SearchAction.

func (*SearchAction) UnmarshalJSON Uses

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

UnmarshalJSON is the custom unmarshaler for SearchAction struct.

type SearchKind Uses

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 Uses

func PossibleSearchKindValues() []SearchKind

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

type SearchResultsAnswer Uses

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 Uses

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

AsAction is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsAnswer Uses

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

AsAnswer is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsBasicAction Uses

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

AsBasicAction is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsBasicAnswer Uses

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

AsBasicAnswer is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsBasicCreativeWork Uses

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

AsBasicCreativeWork is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsBasicIdentifiable Uses

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

AsBasicIdentifiable is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsBasicResponse Uses

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

AsBasicResponse is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsBasicResponseBase Uses

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

AsBasicResponseBase is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsBasicSearchResultsAnswer Uses

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

AsBasicSearchResultsAnswer is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsBasicThing Uses

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

AsBasicThing is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsCreativeWork Uses

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

AsCreativeWork is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsErrorResponse Uses

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

AsErrorResponse is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsIdentifiable Uses

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

AsIdentifiable is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsResponse Uses

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

AsResponse is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsResponseBase Uses

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

AsResponseBase is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsSearchAction Uses

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

AsSearchAction is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsSearchResultsAnswer Uses

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

AsSearchResultsAnswer is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsSuggestions Uses

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

AsSuggestions is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) AsThing Uses

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

AsThing is the BasicResponseBase implementation for SearchResultsAnswer.

func (SearchResultsAnswer) MarshalJSON Uses

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

MarshalJSON is the custom marshaler for SearchResultsAnswer.

func (*SearchResultsAnswer) UnmarshalJSON Uses

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

UnmarshalJSON is the custom unmarshaler for SearchResultsAnswer struct.

type Suggestions Uses

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 Uses

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

AsAction is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsAnswer Uses

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

AsAnswer is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsBasicAction Uses

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

AsBasicAction is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsBasicAnswer Uses

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

AsBasicAnswer is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsBasicCreativeWork Uses

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

AsBasicCreativeWork is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsBasicIdentifiable Uses

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

AsBasicIdentifiable is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsBasicResponse Uses

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

AsBasicResponse is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsBasicResponseBase Uses

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

AsBasicResponseBase is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsBasicSearchResultsAnswer Uses

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

AsBasicSearchResultsAnswer is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsBasicThing Uses

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

AsBasicThing is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsCreativeWork Uses

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

AsCreativeWork is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsErrorResponse Uses

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

AsErrorResponse is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsIdentifiable Uses

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

AsIdentifiable is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsResponse Uses

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

AsResponse is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsResponseBase Uses

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

AsResponseBase is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsSearchAction Uses

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

AsSearchAction is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsSearchResultsAnswer Uses

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

AsSearchResultsAnswer is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsSuggestions Uses

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

AsSuggestions is the BasicResponseBase implementation for Suggestions.

func (Suggestions) AsThing Uses

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

AsThing is the BasicResponseBase implementation for Suggestions.

func (Suggestions) MarshalJSON Uses

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

MarshalJSON is the custom marshaler for Suggestions.

func (*Suggestions) UnmarshalJSON Uses

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

UnmarshalJSON is the custom unmarshaler for Suggestions struct.

type SuggestionsSuggestionGroup Uses

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 Uses

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

AsBasicSuggestionsSuggestionGroup is the BasicSuggestionsSuggestionGroup implementation for SuggestionsSuggestionGroup.

func (SuggestionsSuggestionGroup) AsSuggestionsSuggestionGroup Uses

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

AsSuggestionsSuggestionGroup is the BasicSuggestionsSuggestionGroup implementation for SuggestionsSuggestionGroup.

func (SuggestionsSuggestionGroup) MarshalJSON Uses

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

MarshalJSON is the custom marshaler for SuggestionsSuggestionGroup.

type Thing Uses

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 Uses

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

AsAction is the BasicResponseBase implementation for Thing.

func (Thing) AsAnswer Uses

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

AsAnswer is the BasicResponseBase implementation for Thing.

func (Thing) AsBasicAction Uses

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

AsBasicAction is the BasicResponseBase implementation for Thing.

func (Thing) AsBasicAnswer Uses

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

AsBasicAnswer is the BasicResponseBase implementation for Thing.

func (Thing) AsBasicCreativeWork Uses

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

AsBasicCreativeWork is the BasicResponseBase implementation for Thing.

func (Thing) AsBasicIdentifiable Uses

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

AsBasicIdentifiable is the BasicResponseBase implementation for Thing.

func (Thing) AsBasicResponse Uses

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

AsBasicResponse is the BasicResponseBase implementation for Thing.

func (Thing) AsBasicResponseBase Uses

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

AsBasicResponseBase is the BasicResponseBase implementation for Thing.

func (Thing) AsBasicSearchResultsAnswer Uses

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

AsBasicSearchResultsAnswer is the BasicResponseBase implementation for Thing.

func (Thing) AsBasicThing Uses

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

AsBasicThing is the BasicResponseBase implementation for Thing.

func (Thing) AsCreativeWork Uses

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

AsCreativeWork is the BasicResponseBase implementation for Thing.

func (Thing) AsErrorResponse Uses

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

AsErrorResponse is the BasicResponseBase implementation for Thing.

func (Thing) AsIdentifiable Uses

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

AsIdentifiable is the BasicResponseBase implementation for Thing.

func (Thing) AsResponse Uses

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

AsResponse is the BasicResponseBase implementation for Thing.

func (Thing) AsResponseBase Uses

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

AsResponseBase is the BasicResponseBase implementation for Thing.

func (Thing) AsSearchAction Uses

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

AsSearchAction is the BasicResponseBase implementation for Thing.

func (Thing) AsSearchResultsAnswer Uses

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

AsSearchResultsAnswer is the BasicResponseBase implementation for Thing.

func (Thing) AsSuggestions Uses

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

AsSuggestions is the BasicResponseBase implementation for Thing.

func (Thing) AsThing Uses

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

AsThing is the BasicResponseBase implementation for Thing.

func (Thing) MarshalJSON Uses

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

MarshalJSON is the custom marshaler for Thing.

func (*Thing) UnmarshalJSON Uses

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

UnmarshalJSON is the custom unmarshaler for Thing struct.

type Type Uses

type Type string

Type enumerates the values for type.

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

func PossibleTypeValues Uses

func PossibleTypeValues() []Type

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

type TypeBasicError Uses

type TypeBasicError string

TypeBasicError enumerates the values for type basic error.

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

func PossibleTypeBasicErrorValues Uses

func PossibleTypeBasicErrorValues() []TypeBasicError

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

type TypeBasicQueryContext Uses

type TypeBasicQueryContext string

TypeBasicQueryContext enumerates the values for type basic query context.

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

func PossibleTypeBasicQueryContextValues Uses

func PossibleTypeBasicQueryContextValues() []TypeBasicQueryContext

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

type TypeBasicResponseBase Uses

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 Uses

func PossibleTypeBasicResponseBaseValues() []TypeBasicResponseBase

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

Directories

PathSynopsis
autosuggestapi

Package autosuggest imports 7 packages (graph) and is imported by 4 packages. Updated 2019-08-01. Refresh now. Tools for package owners.