...

Source file src/github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/textanalytics/models.go

Documentation: github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/textanalytics

     1  package textanalytics
     2  
     3  // Copyright (c) Microsoft Corporation. All rights reserved.
     4  // Licensed under the MIT License. See License.txt in the project root for license information.
     5  //
     6  // Code generated by Microsoft (R) AutoRest Code Generator.
     7  // Changes may cause incorrect behavior and will be lost if the code is regenerated.
     8  
     9  import (
    10  	"encoding/json"
    11  	"github.com/Azure/go-autorest/autorest"
    12  )
    13  
    14  // The package's fully qualified name.
    15  const fqdn = "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/textanalytics"
    16  
    17  // BatchInput ...
    18  type BatchInput struct {
    19  	Documents *[]Input `json:"documents,omitempty"`
    20  }
    21  
    22  // DetectedLanguage ...
    23  type DetectedLanguage struct {
    24  	// Name - Long name of a detected language (e.g. English, French).
    25  	Name *string `json:"name,omitempty"`
    26  	// Iso6391Name - A two letter representation of the detected language according to the ISO 639-1 standard (e.g. en, fr).
    27  	Iso6391Name *string `json:"iso6391Name,omitempty"`
    28  	// Score - A confidence score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true.
    29  	Score *float64 `json:"score,omitempty"`
    30  }
    31  
    32  // EntitiesBatchResult ...
    33  type EntitiesBatchResult struct {
    34  	autorest.Response `json:"-"`
    35  	// Documents - READ-ONLY
    36  	Documents *[]EntitiesBatchResultItem `json:"documents,omitempty"`
    37  	// Errors - READ-ONLY
    38  	Errors *[]ErrorRecord `json:"errors,omitempty"`
    39  }
    40  
    41  // MarshalJSON is the custom marshaler for EntitiesBatchResult.
    42  func (ebr EntitiesBatchResult) MarshalJSON() ([]byte, error) {
    43  	objectMap := make(map[string]interface{})
    44  	return json.Marshal(objectMap)
    45  }
    46  
    47  // EntitiesBatchResultItem ...
    48  type EntitiesBatchResultItem struct {
    49  	// ID - READ-ONLY; Unique document identifier.
    50  	ID *string `json:"id,omitempty"`
    51  	// Entities - READ-ONLY; Recognized entities in the document.
    52  	Entities *[]EntityRecord `json:"entities,omitempty"`
    53  }
    54  
    55  // MarshalJSON is the custom marshaler for EntitiesBatchResultItem.
    56  func (ebri EntitiesBatchResultItem) MarshalJSON() ([]byte, error) {
    57  	objectMap := make(map[string]interface{})
    58  	return json.Marshal(objectMap)
    59  }
    60  
    61  // EntityRecord ...
    62  type EntityRecord struct {
    63  	// Name - Entity formal name.
    64  	Name *string `json:"name,omitempty"`
    65  	// Matches - READ-ONLY; List of instances this entity appears in the text.
    66  	Matches *[]MatchRecord `json:"matches,omitempty"`
    67  	// WikipediaLanguage - Wikipedia language for which the WikipediaId and WikipediaUrl refers to.
    68  	WikipediaLanguage *string `json:"wikipediaLanguage,omitempty"`
    69  	// WikipediaID - Wikipedia unique identifier of the recognized entity.
    70  	WikipediaID *string `json:"wikipediaId,omitempty"`
    71  	// WikipediaURL - READ-ONLY; URL for the entity's English Wikipedia page.
    72  	WikipediaURL *string `json:"wikipediaUrl,omitempty"`
    73  	// BingID - Bing unique identifier of the recognized entity. Use in conjunction with the Bing Entity Search API to fetch additional relevant information.
    74  	BingID *string `json:"bingId,omitempty"`
    75  }
    76  
    77  // MarshalJSON is the custom marshaler for EntityRecord.
    78  func (er EntityRecord) MarshalJSON() ([]byte, error) {
    79  	objectMap := make(map[string]interface{})
    80  	if er.Name != nil {
    81  		objectMap["name"] = er.Name
    82  	}
    83  	if er.WikipediaLanguage != nil {
    84  		objectMap["wikipediaLanguage"] = er.WikipediaLanguage
    85  	}
    86  	if er.WikipediaID != nil {
    87  		objectMap["wikipediaId"] = er.WikipediaID
    88  	}
    89  	if er.BingID != nil {
    90  		objectMap["bingId"] = er.BingID
    91  	}
    92  	return json.Marshal(objectMap)
    93  }
    94  
    95  // ErrorRecord ...
    96  type ErrorRecord struct {
    97  	// ID - Input document unique identifier the error refers to.
    98  	ID *string `json:"id,omitempty"`
    99  	// Message - Error message.
   100  	Message *string `json:"message,omitempty"`
   101  }
   102  
   103  // ErrorResponse ...
   104  type ErrorResponse struct {
   105  	Code       *string        `json:"code,omitempty"`
   106  	Message    *string        `json:"message,omitempty"`
   107  	Target     *string        `json:"target,omitempty"`
   108  	InnerError *InternalError `json:"innerError,omitempty"`
   109  }
   110  
   111  // Input ...
   112  type Input struct {
   113  	// ID - Unique, non-empty document identifier.
   114  	ID   *string `json:"id,omitempty"`
   115  	Text *string `json:"text,omitempty"`
   116  }
   117  
   118  // InternalError ...
   119  type InternalError struct {
   120  	Code       *string        `json:"code,omitempty"`
   121  	Message    *string        `json:"message,omitempty"`
   122  	InnerError *InternalError `json:"innerError,omitempty"`
   123  }
   124  
   125  // KeyPhraseBatchResult ...
   126  type KeyPhraseBatchResult struct {
   127  	autorest.Response `json:"-"`
   128  	// Documents - READ-ONLY
   129  	Documents *[]KeyPhraseBatchResultItem `json:"documents,omitempty"`
   130  	// Errors - READ-ONLY
   131  	Errors *[]ErrorRecord `json:"errors,omitempty"`
   132  }
   133  
   134  // MarshalJSON is the custom marshaler for KeyPhraseBatchResult.
   135  func (kpbr KeyPhraseBatchResult) MarshalJSON() ([]byte, error) {
   136  	objectMap := make(map[string]interface{})
   137  	return json.Marshal(objectMap)
   138  }
   139  
   140  // KeyPhraseBatchResultItem ...
   141  type KeyPhraseBatchResultItem struct {
   142  	// KeyPhrases - READ-ONLY; A list of representative words or phrases. The number of key phrases returned is proportional to the number of words in the input document.
   143  	KeyPhrases *[]string `json:"keyPhrases,omitempty"`
   144  	// ID - READ-ONLY; Unique document identifier.
   145  	ID *string `json:"id,omitempty"`
   146  }
   147  
   148  // MarshalJSON is the custom marshaler for KeyPhraseBatchResultItem.
   149  func (kpbri KeyPhraseBatchResultItem) MarshalJSON() ([]byte, error) {
   150  	objectMap := make(map[string]interface{})
   151  	return json.Marshal(objectMap)
   152  }
   153  
   154  // LanguageBatchResult ...
   155  type LanguageBatchResult struct {
   156  	autorest.Response `json:"-"`
   157  	// Documents - READ-ONLY
   158  	Documents *[]LanguageBatchResultItem `json:"documents,omitempty"`
   159  	// Errors - READ-ONLY
   160  	Errors *[]ErrorRecord `json:"errors,omitempty"`
   161  }
   162  
   163  // MarshalJSON is the custom marshaler for LanguageBatchResult.
   164  func (lbr LanguageBatchResult) MarshalJSON() ([]byte, error) {
   165  	objectMap := make(map[string]interface{})
   166  	return json.Marshal(objectMap)
   167  }
   168  
   169  // LanguageBatchResultItem ...
   170  type LanguageBatchResultItem struct {
   171  	// ID - READ-ONLY; Unique document identifier.
   172  	ID *string `json:"id,omitempty"`
   173  	// DetectedLanguages - READ-ONLY; A list of extracted languages.
   174  	DetectedLanguages *[]DetectedLanguage `json:"detectedLanguages,omitempty"`
   175  }
   176  
   177  // MarshalJSON is the custom marshaler for LanguageBatchResultItem.
   178  func (lbri LanguageBatchResultItem) MarshalJSON() ([]byte, error) {
   179  	objectMap := make(map[string]interface{})
   180  	return json.Marshal(objectMap)
   181  }
   182  
   183  // MatchRecord ...
   184  type MatchRecord struct {
   185  	// Text - Entity text as appears in the request.
   186  	Text *string `json:"text,omitempty"`
   187  	// Offset - Start position (in Unicode characters) for the entity match text.
   188  	Offset *int32 `json:"offset,omitempty"`
   189  	// Length - Length (in Unicode characters) for the entity match text.
   190  	Length *int32 `json:"length,omitempty"`
   191  }
   192  
   193  // MultiLanguageBatchInput ...
   194  type MultiLanguageBatchInput struct {
   195  	Documents *[]MultiLanguageInput `json:"documents,omitempty"`
   196  }
   197  
   198  // MultiLanguageInput ...
   199  type MultiLanguageInput struct {
   200  	// Language - This is the 2 letter ISO 639-1 representation of a language. For example, use "en" for English; "es" for Spanish etc.,
   201  	Language *string `json:"language,omitempty"`
   202  	// ID - Unique, non-empty document identifier.
   203  	ID   *string `json:"id,omitempty"`
   204  	Text *string `json:"text,omitempty"`
   205  }
   206  
   207  // SentimentBatchResult ...
   208  type SentimentBatchResult struct {
   209  	autorest.Response `json:"-"`
   210  	// Documents - READ-ONLY
   211  	Documents *[]SentimentBatchResultItem `json:"documents,omitempty"`
   212  	// Errors - READ-ONLY
   213  	Errors *[]ErrorRecord `json:"errors,omitempty"`
   214  }
   215  
   216  // MarshalJSON is the custom marshaler for SentimentBatchResult.
   217  func (sbr SentimentBatchResult) MarshalJSON() ([]byte, error) {
   218  	objectMap := make(map[string]interface{})
   219  	return json.Marshal(objectMap)
   220  }
   221  
   222  // SentimentBatchResultItem ...
   223  type SentimentBatchResultItem struct {
   224  	// Score - READ-ONLY; A decimal number between 0 and 1 denoting the sentiment of the document. A score above 0.7 usually refers to a positive document while a score below 0.3 normally has a negative connotation. Mid values refer to neutral text.
   225  	Score *float64 `json:"score,omitempty"`
   226  	// ID - READ-ONLY; Unique document identifier.
   227  	ID *string `json:"id,omitempty"`
   228  }
   229  
   230  // MarshalJSON is the custom marshaler for SentimentBatchResultItem.
   231  func (sbri SentimentBatchResultItem) MarshalJSON() ([]byte, error) {
   232  	objectMap := make(map[string]interface{})
   233  	return json.Marshal(objectMap)
   234  }
   235  

View as plain text