Documentation ¶
Overview ¶
Package pii provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.11.0 DO NOT EDIT.
Index ¶
- Constants
- func NewPostDetectPiiLanguageRequest(server string, language string, body PostDetectPiiLanguageJSONRequestBody) (*http.Request, error)
- func NewPostDetectPiiLanguageRequestWithBody(server string, language string, contentType string, body io.Reader) (*http.Request, error)
- type Atom
- type Client
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) PostDetectPiiLanguageWithBodyWithResponse(ctx context.Context, language string, contentType string, body io.Reader, ...) (*PostDetectPiiLanguageResponse, error)
- func (c *ClientWithResponses) PostDetectPiiLanguageWithResponse(ctx context.Context, language string, ...) (*PostDetectPiiLanguageResponse, error)
- type ClientWithResponsesInterface
- type Dependency
- type DocumentPosition
- type Entity
- type Extraction
- type HttpRequestDoer
- type InferredAttribute
- type KnowledgeEntry
- type PIIBankAccount
- type PIIBaseItem
- type PIIFinancialProduct
- type PIIIP
- type PIIItem
- type PIIPerson
- type PIIPostalAddress
- type PIIURL
- type PIIemail
- type PIItelephone
- type Paragraph
- type Phrase
- type PostDetectPiiLanguageJSONBody
- type PostDetectPiiLanguageJSONRequestBody
- type PostDetectPiiLanguageResponse
- type Property
- type Request
- type RequestEditorFn
- type Response
- type Sentence
- type Token
- type VirtualSyncon
Constants ¶
const (
BearerAuthScopes = "bearerAuth.Scopes"
)
Variables ¶
This section is empty.
Functions ¶
func NewPostDetectPiiLanguageRequest ¶
func NewPostDetectPiiLanguageRequest(server string, language string, body PostDetectPiiLanguageJSONRequestBody) (*http.Request, error)
NewPostDetectPiiLanguageRequest calls the generic PostDetectPiiLanguage builder with application/json body
Types ¶
type Atom ¶
type Atom struct { // Zero-based position of the first character after the atom End *int64 `json:"end,omitempty"` // Lemma Lemma *string `json:"lemma,omitempty"` // Zero-based position of the first character of the atom Start *int64 `json:"start,omitempty"` // expert.ai type Type *string `json:"type,omitempty"` }
Atom info
type Client ¶
type Client struct { // The endpoint of the server conforming to this interface, with scheme, // https://api.deepmap.com for example. This can contain a path relative // to the server, such as https://api.deepmap.com/dev-test, and all the // paths in the swagger spec will be appended to the server. Server string // Doer for performing requests, typically a *http.Client with any // customized settings, such as certificate chains. Client HttpRequestDoer // A list of callbacks for modifying requests which are generated before sending over // the network. RequestEditors []RequestEditorFn }
Client which conforms to the OpenAPI3 specification for this service.
func NewClient ¶
func NewClient(server string, opts ...ClientOption) (*Client, error)
Creates a new Client, with reasonable defaults
func (*Client) PostDetectPiiLanguage ¶
func (c *Client) PostDetectPiiLanguage(ctx context.Context, language string, body PostDetectPiiLanguageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
type ClientInterface ¶
type ClientInterface interface { // PostDetectPiiLanguage request with any body PostDetectPiiLanguageWithBody(ctx context.Context, language string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) PostDetectPiiLanguage(ctx context.Context, language string, body PostDetectPiiLanguageJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) }
The interface specification for the client above.
type ClientOption ¶
ClientOption allows setting custom parameters during construction
func WithHTTPClient ¶
func WithHTTPClient(doer HttpRequestDoer) ClientOption
WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.
func WithRequestEditorFn ¶
func WithRequestEditorFn(fn RequestEditorFn) ClientOption
WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.
type ClientWithResponses ¶
type ClientWithResponses struct {
ClientInterface
}
ClientWithResponses builds on ClientInterface to offer response payloads
func NewClientWithResponses ¶
func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)
NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling
func (*ClientWithResponses) PostDetectPiiLanguageWithBodyWithResponse ¶
func (c *ClientWithResponses) PostDetectPiiLanguageWithBodyWithResponse(ctx context.Context, language string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostDetectPiiLanguageResponse, error)
PostDetectPiiLanguageWithBodyWithResponse request with arbitrary body returning *PostDetectPiiLanguageResponse
func (*ClientWithResponses) PostDetectPiiLanguageWithResponse ¶
func (c *ClientWithResponses) PostDetectPiiLanguageWithResponse(ctx context.Context, language string, body PostDetectPiiLanguageJSONRequestBody, reqEditors ...RequestEditorFn) (*PostDetectPiiLanguageResponse, error)
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface { // PostDetectPiiLanguage request with any body PostDetectPiiLanguageWithBodyWithResponse(ctx context.Context, language string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostDetectPiiLanguageResponse, error) PostDetectPiiLanguageWithResponse(ctx context.Context, language string, body PostDetectPiiLanguageJSONRequestBody, reqEditors ...RequestEditorFn) (*PostDetectPiiLanguageResponse, error) }
ClientWithResponsesInterface is the interface specification for the client with responses above.
type Dependency ¶
type Dependency struct { // Number of the head token Head *int64 `json:"head,omitempty"` // Zero-based cardinal number of the token Id *int64 `json:"id,omitempty"` // <a href='https://universaldependencies.org/u/dep/#universal-dependency-relations' target='_blank'>Dependency relation</a> between the token and the head token Label *string `json:"label,omitempty"` }
Dependency info
type DocumentPosition ¶
type DocumentPosition struct { // Zero-based position of the character after the last End *int64 `json:"end,omitempty"` // Zero-based position of the first character Start *int64 `json:"start,omitempty"` }
Position
type Entity ¶
type Entity struct { // Entity attributes inferred from the context or from the Knowledge Graph Attributes *[]InferredAttribute `json:"attributes,omitempty"` // Base form (lemma) of the entity name Lemma *string `json:"lemma,omitempty"` // Positions of the entity's mentions Positions *[]DocumentPosition `json:"positions,omitempty"` // Entity relevance Relevance *int64 `json:"relevance,omitempty"` // ID used to look up Knowledge Graph data in the `knowledge` array Syncon *int64 `json:"syncon,omitempty"` // Entity type Type *string `json:"type,omitempty"` }
Entity info
type Extraction ¶
type Extraction struct { // Extraction record fields Fields *[]struct { // Field name Name *string `json:"name,omitempty"` // Positions of parts of the text corresponding to the field value Positions *[]DocumentPosition `json:"positions,omitempty"` // Field value Value *string `json:"value,omitempty"` } `json:"fields,omitempty"` // Software package name Namespace *string `json:"namespace,omitempty"` // Extraction record template Template *string `json:"template,omitempty"` }
Extraction record
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type InferredAttribute ¶
type InferredAttribute struct { // Attribute name Attribute *string `json:"attribute,omitempty"` // Attribute's attributes Attributes *[]InferredAttribute `json:"attributes,omitempty"` // Lemma Lemma *string `json:"lemma,omitempty"` // ID used to look up Knowledge Graph data in the `knowledge` array Syncon *int64 `json:"syncon,omitempty"` // Attribute type Type *string `json:"type,omitempty"` }
Inferred attribute
type KnowledgeEntry ¶
type KnowledgeEntry struct { // Textual rendering of the general conceptual category for the token in the Knowledge Graph Label *string `json:"label,omitempty"` // Syncon extended properties Properties *[]Property `json:"properties,omitempty"` // Syncon ID Syncon *int64 `json:"syncon,omitempty"` }
Knowledge Graph data for a syncon
type PIIBankAccount ¶
type PIIBankAccount struct { // JSON-LD graph item id Id *string `json:"@id,omitempty"` // JSON-LD graph item type Type *string `json:"@type,omitempty"` IBAN *string `json:"IBAN,omitempty"` IBANcountry *string `json:"IBANcountry,omitempty"` // Text matches of items' properties Matches *[]struct { // Property value in the text, zero-based position of the character after the last End *int64 `json:"end,omitempty"` // Property name Name *string `json:"name,omitempty"` // Property value in the text, zero-based position of the first character Start *int64 `json:"start,omitempty"` // Property value Value *string `json:"value,omitempty"` } `json:"matches,omitempty"` }
PIIBankAccount defines model for PIIBankAccount.
type PIIBaseItem ¶
type PIIBaseItem struct { // JSON-LD graph item id Id *string `json:"@id,omitempty"` // JSON-LD graph item type Type *string `json:"@type,omitempty"` // Text matches of items' properties Matches *[]struct { // Property value in the text, zero-based position of the character after the last End *int64 `json:"end,omitempty"` // Property name Name *string `json:"name,omitempty"` // Property value in the text, zero-based position of the first character Start *int64 `json:"start,omitempty"` // Property value Value *string `json:"value,omitempty"` } `json:"matches,omitempty"` }
Type with properties inherited by all JSON-LD graph PII types
type PIIFinancialProduct ¶
type PIIFinancialProduct struct { // JSON-LD graph item id Id *string `json:"@id,omitempty"` // JSON-LD graph item type Type *string `json:"@type,omitempty"` CVV *string `json:"CVV,omitempty"` CreditDebitNumber *string `json:"creditDebitNumber,omitempty"` ExpirationDate *string `json:"expirationDate,omitempty"` // Text matches of items' properties Matches *[]struct { // Property value in the text, zero-based position of the character after the last End *int64 `json:"end,omitempty"` // Property name Name *string `json:"name,omitempty"` // Property value in the text, zero-based position of the first character Start *int64 `json:"start,omitempty"` // Property value Value *string `json:"value,omitempty"` } `json:"matches,omitempty"` }
PIIFinancialProduct defines model for PIIFinancialProduct.
type PIIIP ¶
type PIIIP struct { // JSON-LD graph item id Id *string `json:"@id,omitempty"` // JSON-LD graph item type Type *string `json:"@type,omitempty"` IP *string `json:"IP,omitempty"` // Text matches of items' properties Matches *[]struct { // Property value in the text, zero-based position of the character after the last End *int64 `json:"end,omitempty"` // Property name Name *string `json:"name,omitempty"` // Property value in the text, zero-based position of the first character Start *int64 `json:"start,omitempty"` // Property value Value *string `json:"value,omitempty"` } `json:"matches,omitempty"` }
PIIIP defines model for PIIIP.
type PIIPerson ¶
type PIIPerson struct { // JSON-LD graph item id Id *string `json:"@id,omitempty"` // JSON-LD graph item type Type *string `json:"@type,omitempty"` Age *string `json:"age,omitempty"` BirthDate *string `json:"birthDate,omitempty"` BirthPlace *string `json:"birthPlace,omitempty"` DateTime *[]string `json:"dateTime,omitempty"` DeathDate *string `json:"deathDate,omitempty"` DeathPlace *string `json:"deathPlace,omitempty"` FamilyName *string `json:"familyName,omitempty"` Gender *string `json:"gender,omitempty"` GivenName *string `json:"givenName,omitempty"` // Text matches of items' properties Matches *[]struct { // Property value in the text, zero-based position of the character after the last End *int64 `json:"end,omitempty"` // Property name Name *string `json:"name,omitempty"` // Property value in the text, zero-based position of the first character Start *int64 `json:"start,omitempty"` // Property value Value *string `json:"value,omitempty"` } `json:"matches,omitempty"` Nationality *string `json:"nationality,omitempty"` Person *string `json:"person,omitempty"` }
PIIPerson defines model for PIIPerson.
type PIIPostalAddress ¶
type PIIPostalAddress struct { // JSON-LD graph item id Id *string `json:"@id,omitempty"` // JSON-LD graph item type Type *string `json:"@type,omitempty"` Address *string `json:"address,omitempty"` AddressCountry *string `json:"addressCountry,omitempty"` AddressLocality *string `json:"addressLocality,omitempty"` AddressRegion *string `json:"addressRegion,omitempty"` // Text matches of items' properties Matches *[]struct { // Property value in the text, zero-based position of the character after the last End *int64 `json:"end,omitempty"` // Property name Name *string `json:"name,omitempty"` // Property value in the text, zero-based position of the first character Start *int64 `json:"start,omitempty"` // Property value Value *string `json:"value,omitempty"` } `json:"matches,omitempty"` PostOfficeBoxNumber *string `json:"postOfficeBoxNumber,omitempty"` PostalCode *string `json:"postalCode,omitempty"` StreetAddress *string `json:"streetAddress,omitempty"` }
PIIPostalAddress defines model for PIIPostalAddress.
type PIIURL ¶
type PIIURL struct { // JSON-LD graph item id Id *string `json:"@id,omitempty"` // JSON-LD graph item type Type *string `json:"@type,omitempty"` URL *string `json:"URL,omitempty"` // Text matches of items' properties Matches *[]struct { // Property value in the text, zero-based position of the character after the last End *int64 `json:"end,omitempty"` // Property name Name *string `json:"name,omitempty"` // Property value in the text, zero-based position of the first character Start *int64 `json:"start,omitempty"` // Property value Value *string `json:"value,omitempty"` } `json:"matches,omitempty"` }
PIIURL defines model for PIIURL.
type PIIemail ¶
type PIIemail struct { // JSON-LD graph item id Id *string `json:"@id,omitempty"` // JSON-LD graph item type Type *string `json:"@type,omitempty"` Email *string `json:"email,omitempty"` // Text matches of items' properties Matches *[]struct { // Property value in the text, zero-based position of the character after the last End *int64 `json:"end,omitempty"` // Property name Name *string `json:"name,omitempty"` // Property value in the text, zero-based position of the first character Start *int64 `json:"start,omitempty"` // Property value Value *string `json:"value,omitempty"` } `json:"matches,omitempty"` }
PIIemail defines model for PIIemail.
type PIItelephone ¶
type PIItelephone struct { // JSON-LD graph item id Id *string `json:"@id,omitempty"` // JSON-LD graph item type Type *string `json:"@type,omitempty"` // Text matches of items' properties Matches *[]struct { // Property value in the text, zero-based position of the character after the last End *int64 `json:"end,omitempty"` // Property name Name *string `json:"name,omitempty"` // Property value in the text, zero-based position of the first character Start *int64 `json:"start,omitempty"` // Property value Value *string `json:"value,omitempty"` } `json:"matches,omitempty"` Telephone *string `json:"telephone,omitempty"` }
PIItelephone defines model for PIItelephone.
type Paragraph ¶
type Paragraph struct { // Zero-based position of the first character after the paragraph End *int64 `json:"end,omitempty"` // Indexes (in the `sentences` array) of the sentences that make up the paragraph Sentences *[]int64 `json:"sentences,omitempty"` // Zero-based position of the first character of the paragraph Start *int64 `json:"start,omitempty"` }
Paragraph info
type Phrase ¶
type Phrase struct { // Zero-based position of the first character after the phrase End *int64 `json:"end,omitempty"` // Zero-based position of the first character of the phrase Start *int64 `json:"start,omitempty"` // Indexes (in the `tokens` array) of the tokens that make up the phrase Tokens *[]int64 `json:"tokens,omitempty"` // Phrase type Type *string `json:"type,omitempty"` }
Phrase info
type PostDetectPiiLanguageJSONBody ¶
type PostDetectPiiLanguageJSONBody = Request
PostDetectPiiLanguageJSONBody defines parameters for PostDetectPiiLanguage.
type PostDetectPiiLanguageJSONRequestBody ¶
type PostDetectPiiLanguageJSONRequestBody = PostDetectPiiLanguageJSONBody
PostDetectPiiLanguageJSONRequestBody defines body for PostDetectPiiLanguage for application/json ContentType.
type PostDetectPiiLanguageResponse ¶
type PostDetectPiiLanguageResponse struct { Body []byte HTTPResponse *http.Response JSON200 *Response }
func ParsePostDetectPiiLanguageResponse ¶
func ParsePostDetectPiiLanguageResponse(rsp *http.Response) (*PostDetectPiiLanguageResponse, error)
ParsePostDetectPiiLanguageResponse parses an HTTP response from a PostDetectPiiLanguageWithResponse call
func (PostDetectPiiLanguageResponse) Status ¶
func (r PostDetectPiiLanguageResponse) Status() string
Status returns HTTPResponse.Status
func (PostDetectPiiLanguageResponse) StatusCode ¶
func (r PostDetectPiiLanguageResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type Property ¶
type Property struct { // Property type Type *string `json:"type,omitempty"` // Property value Value *string `json:"value,omitempty"` }
Syncon property
type Request ¶
type Request struct { // Document to analyze Document *struct { // Document's text Text *string `json:"text,omitempty"` } `json:"document,omitempty"` }
Request
type RequestEditorFn ¶
RequestEditorFn is the function signature for the RequestEditor callback function
type Response ¶
type Response struct { Data *struct { // Analyzed text Content *string `json:"content,omitempty"` // Entities Entities *[]Entity `json:"entities,omitempty"` // PII detector specific output ExtraData *struct { // JSON-LD format output JSONLD *struct { // JSON-LD context Context *struct { Version *json.Number `json:"@version,omitempty"` CVV *string `json:"CVV,omitempty"` IBAN *string `json:"IBAN,omitempty"` IBANcountry *string `json:"IBANcountry,omitempty"` IP *string `json:"IP,omitempty"` URL *string `json:"URL,omitempty"` AdditionalProperty *string `json:"additionalProperty,omitempty"` Address *string `json:"address,omitempty"` AddressCountry *string `json:"addressCountry,omitempty"` AddressLocality *string `json:"addressLocality,omitempty"` AddressRegion *string `json:"addressRegion,omitempty"` Age *string `json:"age,omitempty"` BirthDate *string `json:"birthDate,omitempty"` BirthPlace *string `json:"birthPlace,omitempty"` CreditDebitNumber *string `json:"creditDebitNumber,omitempty"` DateTime *string `json:"dateTime,omitempty"` DeathDate *string `json:"deathDate,omitempty"` DeathPlace *string `json:"deathPlace,omitempty"` Email *string `json:"email,omitempty"` End *struct { Id *string `json:"@id,omitempty"` } `json:"end,omitempty"` ExpirationDate *string `json:"expirationDate,omitempty"` FamilyName *string `json:"familyName,omitempty"` Gender *string `json:"gender,omitempty"` GivenName *string `json:"givenName,omitempty"` Matches *string `json:"matches,omitempty"` Nationality *string `json:"nationality,omitempty"` Person *string `json:"person,omitempty"` PostOfficeBoxNumber *string `json:"postOfficeBoxNumber,omitempty"` PostalAddress *string `json:"postalAddress,omitempty"` PostalCode *string `json:"postalCode,omitempty"` Schema *string `json:"schema,omitempty"` Start *struct { Id *string `json:"@id,omitempty"` } `json:"start,omitempty"` StreetAddress *string `json:"streetAddress,omitempty"` Telephone *string `json:"telephone,omitempty"` Text *string `json:"text,omitempty"` Type *string `json:"type,omitempty"` } `json:"@context,omitempty"` // JSON-LD graph data Graph *[]PIIItem `json:"@graph,omitempty"` } `json:"JSON-LD,omitempty"` } `json:"extraData,omitempty"` // Extracted information Extractions *[]Extraction `json:"extractions,omitempty"` // Knowledge Graph syncons' data Knowledge *[]KnowledgeEntry `json:"knowledge,omitempty"` // Text language Language *string `json:"language,omitempty"` // Paragraphs Paragraphs *[]Paragraph `json:"paragraphs,omitempty"` // Phrases Phrases *[]Phrase `json:"phrases,omitempty"` // Sentences Sentences *[]Sentence `json:"sentences,omitempty"` // Tokens Tokens *[]Token `json:"tokens,omitempty"` // Service version Version *string `json:"version,omitempty"` } `json:"data,omitempty"` // Error description Error *struct { // Error code Code *string `json:"code,omitempty"` // Error message Message *string `json:"message,omitempty"` } `json:"error,omitempty"` // Success flag Success *bool `json:"success,omitempty"` }
Detector's response
type Sentence ¶
type Sentence struct { // Zero-based position of the first character after the sentence End *int64 `json:"end,omitempty"` // Indexes (in the `phrases` array) of the phrases that make up the sentence Phrases *[]int64 `json:"phrases,omitempty"` // Zero-based position of the first character of the sentence Start *int64 `json:"start,omitempty"` }
Sentence info
type Token ¶
type Token struct { // Atoms that make up the token Atoms *[]Atom `json:"atoms,omitempty"` // Dependency info Dependency *Dependency `json:"dependency,omitempty"` // Zero-based position of the first character after the token End *int64 `json:"end,omitempty"` // Lemma Lemma *string `json:"lemma,omitempty"` // A semicolon separated list of <a href='https://universaldependencies.org/format.html#morphological-annotation'>CoNLL-U format</a> morphological features Morphology *string `json:"morphology,omitempty"` // Paragraph index in the `paragraphs` array Paragraph *int64 `json:"paragraph,omitempty"` // Phrase index in the `phrases` array Phrase *int64 `json:"phrase,omitempty"` // <a href='https://universaldependencies.org/u/pos/'>Universal Dependencies part-of-speech tag</a> Pos *string `json:"pos,omitempty"` // Sentence index in the `sentences` array Sentence *int64 `json:"sentence,omitempty"` // Zero-based position of the first character of the token Start *int64 `json:"start,omitempty"` // ID used to look up Knowledge Graph data in the `knowledge` array Syncon *int64 `json:"syncon,omitempty"` // expert.ai type Type *string `json:"type,omitempty"` // A concept that does not exist in the Knowledge Graph but heuristics recognized as a type of a known parent concept Vsyn *VirtualSyncon `json:"vsyn,omitempty"` }
Token info
type VirtualSyncon ¶
type VirtualSyncon struct { // ID used to mark all the occurrences of the virtual concept in the text Id *int64 `json:"id,omitempty"` // Parent concept; ID is used to look up Knowledge Graph data in the `knowledge` array Parent *int64 `json:"parent,omitempty"` }
A concept that does not exist in the Knowledge Graph but heuristics recognized as a type of a known parent concept