spellcheck

package
v33.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package spellcheck implements the Azure ARM Spellcheck service API version 1.0.

The Spell Check API - V7 lets you check a text string for spelling and grammar errors.

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 ActionType

type ActionType string

ActionType enumerates the values for action type.

const (
	// Edit ...
	Edit ActionType = "Edit"
	// Load ...
	Load ActionType = "Load"
)

func PossibleActionTypeValues

func PossibleActionTypeValues() []ActionType

PossibleActionTypeValues returns an array of possible values for the ActionType const type.

type Answer

type Answer struct {
	// ID - READ-ONLY; A String identifier.
	ID *string `json:"id,omitempty"`
	// Type - Possible values include: 'TypeResponseBase', 'TypeSpellCheck', 'TypeAnswer', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse'
	Type Type `json:"_type,omitempty"`
}

Answer ...

func (Answer) AsAnswer

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

AsAnswer is the BasicResponseBase implementation for Answer.

func (Answer) AsBasicAnswer

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

AsBasicAnswer 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) 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) AsSpellCheck

func (a Answer) AsSpellCheck() (*SpellCheck, bool)

AsSpellCheck is the BasicResponseBase implementation for Answer.

func (Answer) MarshalJSON

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

MarshalJSON is the custom marshaler for Answer.

type BaseClient

type BaseClient struct {
	autorest.Client
	Endpoint string
}

BaseClient is the base client for Spellcheck.

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) SpellCheckerMethod

func (client BaseClient) SpellCheckerMethod(ctx context.Context, textParameter string, acceptLanguage string, pragma string, userAgent string, clientID string, clientIP string, location string, actionType ActionType, appName string, countryCode string, clientMachineName string, docID string, market string, sessionID string, setLang string, userID string, mode Mode, preContextText string, postContextText string) (result SpellCheck, err error)

SpellCheckerMethod sends the spell checker request. Parameters: textParameter - the text string to check for spelling and grammar errors. The combined length of the text string, preContextText string, and postContextText string may not exceed 10,000 characters. You may specify this parameter in the query string of a GET request or in the body of a POST request. Because of the query string length limit, you'll typically use a POST request unless you're checking only short strings. 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 query parameter. Bing will use the first supported language it finds from the list, and combine that language with the cc parameter value to determine the market to return results for. If the list does not include a supported language, Bing will find the closest language and market that supports the request, and may use an aggregated or default market for the results instead of a specified one. You should use this header and the cc query parameter only if you specify multiple languages; otherwise, you should use the mkt and setLang query parameters. A user interface string is a string that's used as a label in a user interface. There are very few user interface strings in the JSON response objects. Any links in the response objects to Bing.com properties will 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 strongly encouraged to always specify this header. The user-agent should be the same string that any commonly used browser would send. For information about user agents, see [RFC 2616](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html). 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-Search-ClientIP header, but at a minimum, you should include this header. actionType - a string that's used by logging to determine whether the request is coming from an interactive session or a page load. The following are the possible values. 1) Edit—The request is from an interactive session 2) Load—The request is from a page load appName - the unique name of your app. The name must be known by Bing. Do not include this parameter unless you have previously contacted Bing to get a unique app name. To get a unique name, contact your Bing Business Development manager. 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. clientMachineName - a unique name of the device that the request is being made from. Generate a unique value for each device (the value is unimportant). The service uses the ID to help debug issues and improve the quality of corrections. docID - a unique ID that identifies the document that the text belongs to. Generate a unique value for each document (the value is unimportant). The service uses the ID to help debug issues and improve the quality of corrections. 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. sessionID - a unique ID that identifies this user session. Generate a unique value for each user session (the value is unimportant). The service uses the ID to help debug issues and improve the quality of corrections 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. userID - a unique ID that identifies the user. Generate a unique value for each user (the value is unimportant). The service uses the ID to help debug issues and improve the quality of corrections. mode - the type of spelling and grammar checks to perform. The following are the possible values (the values are case insensitive). The default is Proof. 1) Proof—Finds most spelling and grammar mistakes. 2) Spell—Finds most spelling mistakes but does not find some of the grammar errors that Proof catches (for example, capitalization and repeated words) preContextText - a string that gives context to the text string. For example, the text string petal is valid. However, if you set preContextText to bike, the context changes and the text string becomes not valid. In this case, the API suggests that you change petal to pedal (as in bike pedal). This text is not checked for grammar or spelling errors. The combined length of the text string, preContextText string, and postContextText string may not exceed 10,000 characters. You may specify this parameter in the query string of a GET request or in the body of a POST request. postContextText - a string that gives context to the text string. For example, the text string read is valid. However, if you set postContextText to carpet, the context changes and the text string becomes not valid. In this case, the API suggests that you change read to red (as in red carpet). This text is not checked for grammar or spelling errors. The combined length of the text string, preContextText string, and postContextText string may not exceed 10,000 characters. You may specify this parameter in the query string of a GET request or in the body of a POST request.

func (BaseClient) SpellCheckerMethodPreparer

func (client BaseClient) SpellCheckerMethodPreparer(ctx context.Context, textParameter string, acceptLanguage string, pragma string, userAgent string, clientID string, clientIP string, location string, actionType ActionType, appName string, countryCode string, clientMachineName string, docID string, market string, sessionID string, setLang string, userID string, mode Mode, preContextText string, postContextText string) (*http.Request, error)

SpellCheckerMethodPreparer prepares the SpellCheckerMethod request.

func (BaseClient) SpellCheckerMethodResponder

func (client BaseClient) SpellCheckerMethodResponder(resp *http.Response) (result SpellCheck, err error)

SpellCheckerMethodResponder handles the response to the SpellCheckerMethod request. The method always closes the http.Response Body.

func (BaseClient) SpellCheckerMethodSender

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

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

type BasicAnswer

type BasicAnswer interface {
	AsSpellCheck() (*SpellCheck, bool)
	AsAnswer() (*Answer, bool)
}

BasicAnswer ...

type BasicIdentifiable

type BasicIdentifiable interface {
	AsSpellCheck() (*SpellCheck, bool)
	AsAnswer() (*Answer, bool)
	AsBasicAnswer() (BasicAnswer, bool)
	AsResponse() (*Response, bool)
	AsBasicResponse() (BasicResponse, bool)
	AsErrorResponse() (*ErrorResponse, bool)
	AsIdentifiable() (*Identifiable, bool)
}

BasicIdentifiable defines the identity of a resource.

type BasicResponse

type BasicResponse interface {
	AsSpellCheck() (*SpellCheck, bool)
	AsAnswer() (*Answer, bool)
	AsBasicAnswer() (BasicAnswer, bool)
	AsErrorResponse() (*ErrorResponse, 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 {
	AsSpellCheck() (*SpellCheck, bool)
	AsAnswer() (*Answer, bool)
	AsBasicAnswer() (BasicAnswer, bool)
	AsResponse() (*Response, bool)
	AsBasicResponse() (BasicResponse, bool)
	AsIdentifiable() (*Identifiable, bool)
	AsBasicIdentifiable() (BasicIdentifiable, bool)
	AsErrorResponse() (*ErrorResponse, bool)
	AsResponseBase() (*ResponseBase, bool)
}

BasicResponseBase ...

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"`
	// SubCode - READ-ONLY; The error code that further helps to identify the error. Possible values include: 'UnexpectedError', 'ResourceError', 'NotImplemented', 'ParameterMissing', 'ParameterInvalidValue', 'HTTPNotAllowed', 'Blocked', 'AuthorizationMissing', 'AuthorizationRedundancy', 'AuthorizationDisabled', 'AuthorizationExpired'
	SubCode ErrorSubCode `json:"subCode,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"`
}

Error defines the error that occurred.

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 *[]Error `json:"errors,omitempty"`
	// ID - READ-ONLY; A String identifier.
	ID *string `json:"id,omitempty"`
	// Type - Possible values include: 'TypeResponseBase', 'TypeSpellCheck', 'TypeAnswer', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse'
	Type Type `json:"_type,omitempty"`
}

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

func (ErrorResponse) AsAnswer

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

AsAnswer is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) AsBasicAnswer

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

AsBasicAnswer 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) 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) AsSpellCheck

func (er ErrorResponse) AsSpellCheck() (*SpellCheck, bool)

AsSpellCheck is the BasicResponseBase implementation for ErrorResponse.

func (ErrorResponse) MarshalJSON

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

MarshalJSON is the custom marshaler for ErrorResponse.

type ErrorSubCode

type ErrorSubCode string

ErrorSubCode enumerates the values for error sub code.

const (
	// AuthorizationDisabled ...
	AuthorizationDisabled ErrorSubCode = "AuthorizationDisabled"
	// AuthorizationExpired ...
	AuthorizationExpired ErrorSubCode = "AuthorizationExpired"
	// AuthorizationMissing ...
	AuthorizationMissing ErrorSubCode = "AuthorizationMissing"
	// AuthorizationRedundancy ...
	AuthorizationRedundancy ErrorSubCode = "AuthorizationRedundancy"
	// Blocked ...
	Blocked ErrorSubCode = "Blocked"
	// HTTPNotAllowed ...
	HTTPNotAllowed ErrorSubCode = "HttpNotAllowed"
	// NotImplemented ...
	NotImplemented ErrorSubCode = "NotImplemented"
	// ParameterInvalidValue ...
	ParameterInvalidValue ErrorSubCode = "ParameterInvalidValue"
	// ParameterMissing ...
	ParameterMissing ErrorSubCode = "ParameterMissing"
	// ResourceError ...
	ResourceError ErrorSubCode = "ResourceError"
	// UnexpectedError ...
	UnexpectedError ErrorSubCode = "UnexpectedError"
)

func PossibleErrorSubCodeValues

func PossibleErrorSubCodeValues() []ErrorSubCode

PossibleErrorSubCodeValues returns an array of possible values for the ErrorSubCode const type.

type ErrorType

type ErrorType string

ErrorType enumerates the values for error type.

const (
	// RepeatedToken ...
	RepeatedToken ErrorType = "RepeatedToken"
	// UnknownToken ...
	UnknownToken ErrorType = "UnknownToken"
)

func PossibleErrorTypeValues

func PossibleErrorTypeValues() []ErrorType

PossibleErrorTypeValues returns an array of possible values for the ErrorType const type.

type Identifiable

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

Identifiable defines the identity of a resource.

func (Identifiable) AsAnswer

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

AsAnswer is the BasicResponseBase implementation for Identifiable.

func (Identifiable) AsBasicAnswer

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

AsBasicAnswer 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) 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) AsSpellCheck

func (i Identifiable) AsSpellCheck() (*SpellCheck, bool)

AsSpellCheck is the BasicResponseBase implementation for Identifiable.

func (Identifiable) MarshalJSON

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

MarshalJSON is the custom marshaler for Identifiable.

type Mode

type Mode string

Mode enumerates the values for mode.

const (
	// Proof ...
	Proof Mode = "proof"
	// Spell ...
	Spell Mode = "spell"
)

func PossibleModeValues

func PossibleModeValues() []Mode

PossibleModeValues returns an array of possible values for the Mode const type.

type Response

type Response struct {
	// ID - READ-ONLY; A String identifier.
	ID *string `json:"id,omitempty"`
	// Type - Possible values include: 'TypeResponseBase', 'TypeSpellCheck', 'TypeAnswer', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse'
	Type Type `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) AsAnswer

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

AsAnswer is the BasicResponseBase implementation for Response.

func (Response) AsBasicAnswer

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

AsBasicAnswer 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) 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) AsSpellCheck

func (r Response) AsSpellCheck() (*SpellCheck, bool)

AsSpellCheck is the BasicResponseBase implementation for Response.

func (Response) MarshalJSON

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

MarshalJSON is the custom marshaler for Response.

type ResponseBase

type ResponseBase struct {
	// Type - Possible values include: 'TypeResponseBase', 'TypeSpellCheck', 'TypeAnswer', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse'
	Type Type `json:"_type,omitempty"`
}

ResponseBase ...

func (ResponseBase) AsAnswer

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

AsAnswer is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) AsBasicAnswer

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

AsBasicAnswer 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) 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) AsSpellCheck

func (rb ResponseBase) AsSpellCheck() (*SpellCheck, bool)

AsSpellCheck is the BasicResponseBase implementation for ResponseBase.

func (ResponseBase) MarshalJSON

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

MarshalJSON is the custom marshaler for ResponseBase.

type SpellCheck

type SpellCheck struct {
	autorest.Response `json:"-"`
	FlaggedTokens     *[]SpellingFlaggedToken `json:"flaggedTokens,omitempty"`
	// ID - READ-ONLY; A String identifier.
	ID *string `json:"id,omitempty"`
	// Type - Possible values include: 'TypeResponseBase', 'TypeSpellCheck', 'TypeAnswer', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse'
	Type Type `json:"_type,omitempty"`
}

SpellCheck ...

func (SpellCheck) AsAnswer

func (sc SpellCheck) AsAnswer() (*Answer, bool)

AsAnswer is the BasicResponseBase implementation for SpellCheck.

func (SpellCheck) AsBasicAnswer

func (sc SpellCheck) AsBasicAnswer() (BasicAnswer, bool)

AsBasicAnswer is the BasicResponseBase implementation for SpellCheck.

func (SpellCheck) AsBasicIdentifiable

func (sc SpellCheck) AsBasicIdentifiable() (BasicIdentifiable, bool)

AsBasicIdentifiable is the BasicResponseBase implementation for SpellCheck.

func (SpellCheck) AsBasicResponse

func (sc SpellCheck) AsBasicResponse() (BasicResponse, bool)

AsBasicResponse is the BasicResponseBase implementation for SpellCheck.

func (SpellCheck) AsBasicResponseBase

func (sc SpellCheck) AsBasicResponseBase() (BasicResponseBase, bool)

AsBasicResponseBase is the BasicResponseBase implementation for SpellCheck.

func (SpellCheck) AsErrorResponse

func (sc SpellCheck) AsErrorResponse() (*ErrorResponse, bool)

AsErrorResponse is the BasicResponseBase implementation for SpellCheck.

func (SpellCheck) AsIdentifiable

func (sc SpellCheck) AsIdentifiable() (*Identifiable, bool)

AsIdentifiable is the BasicResponseBase implementation for SpellCheck.

func (SpellCheck) AsResponse

func (sc SpellCheck) AsResponse() (*Response, bool)

AsResponse is the BasicResponseBase implementation for SpellCheck.

func (SpellCheck) AsResponseBase

func (sc SpellCheck) AsResponseBase() (*ResponseBase, bool)

AsResponseBase is the BasicResponseBase implementation for SpellCheck.

func (SpellCheck) AsSpellCheck

func (sc SpellCheck) AsSpellCheck() (*SpellCheck, bool)

AsSpellCheck is the BasicResponseBase implementation for SpellCheck.

func (SpellCheck) MarshalJSON

func (sc SpellCheck) MarshalJSON() ([]byte, error)

MarshalJSON is the custom marshaler for SpellCheck.

type SpellingFlaggedToken

type SpellingFlaggedToken struct {
	Offset *int32  `json:"offset,omitempty"`
	Token  *string `json:"token,omitempty"`
	// Type - Possible values include: 'UnknownToken', 'RepeatedToken'
	Type ErrorType `json:"type,omitempty"`
	// Suggestions - READ-ONLY
	Suggestions *[]SpellingTokenSuggestion `json:"suggestions,omitempty"`
	// PingURLSuffix - READ-ONLY
	PingURLSuffix *string `json:"pingUrlSuffix,omitempty"`
}

SpellingFlaggedToken ...

type SpellingTokenSuggestion

type SpellingTokenSuggestion struct {
	Suggestion *string `json:"suggestion,omitempty"`
	// Score - READ-ONLY
	Score *float64 `json:"score,omitempty"`
	// PingURLSuffix - READ-ONLY
	PingURLSuffix *string `json:"pingUrlSuffix,omitempty"`
}

SpellingTokenSuggestion ...

type Type

type Type string

Type enumerates the values for type.

const (
	// TypeAnswer ...
	TypeAnswer Type = "Answer"
	// TypeErrorResponse ...
	TypeErrorResponse Type = "ErrorResponse"
	// TypeIdentifiable ...
	TypeIdentifiable Type = "Identifiable"
	// TypeResponse ...
	TypeResponse Type = "Response"
	// TypeResponseBase ...
	TypeResponseBase Type = "ResponseBase"
	// TypeSpellCheck ...
	TypeSpellCheck Type = "SpellCheck"
)

func PossibleTypeValues

func PossibleTypeValues() []Type

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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