mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-30 04:20:53 +00:00
Update Go AWS SDK to the latest version
This commit is contained in:
committed by
Andrey Smirnov
parent
d08be990ef
commit
94a72b23ff
+763
@@ -0,0 +1,763 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package comprehendmedical
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/awsutil"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
)
|
||||
|
||||
const opDetectEntities = "DetectEntities"
|
||||
|
||||
// DetectEntitiesRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the DetectEntities operation. The "output" return
|
||||
// value will be populated with the request's response once the request completes
|
||||
// successfully.
|
||||
//
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
//
|
||||
// See DetectEntities for more information on using the DetectEntities
|
||||
// API call, and error handling.
|
||||
//
|
||||
// This method is useful when you want to inject custom logic or configuration
|
||||
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
|
||||
//
|
||||
//
|
||||
// // Example sending a request using the DetectEntitiesRequest method.
|
||||
// req, resp := client.DetectEntitiesRequest(params)
|
||||
//
|
||||
// err := req.Send()
|
||||
// if err == nil { // resp is now filled
|
||||
// fmt.Println(resp)
|
||||
// }
|
||||
//
|
||||
// See also, https://docs.aws.amazon.com/goto/WebAPI/comprehendmedical-2018-10-30/DetectEntities
|
||||
func (c *ComprehendMedical) DetectEntitiesRequest(input *DetectEntitiesInput) (req *request.Request, output *DetectEntitiesOutput) {
|
||||
op := &request.Operation{
|
||||
Name: opDetectEntities,
|
||||
HTTPMethod: "POST",
|
||||
HTTPPath: "/",
|
||||
}
|
||||
|
||||
if input == nil {
|
||||
input = &DetectEntitiesInput{}
|
||||
}
|
||||
|
||||
output = &DetectEntitiesOutput{}
|
||||
req = c.newRequest(op, input, output)
|
||||
return
|
||||
}
|
||||
|
||||
// DetectEntities API operation for AWS Comprehend Medical.
|
||||
//
|
||||
// Inspects the clinical text for a variety of medical entities and returns
|
||||
// specific information about them such as entity category, location, and confidence
|
||||
// score on that information .
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
//
|
||||
// See the AWS API reference guide for AWS Comprehend Medical's
|
||||
// API operation DetectEntities for usage and error information.
|
||||
//
|
||||
// Returned Error Codes:
|
||||
// * ErrCodeInternalServerException "InternalServerException"
|
||||
// An internal server error occurred. Retry your request.
|
||||
//
|
||||
// * ErrCodeServiceUnavailableException "ServiceUnavailableException"
|
||||
// The Comprehend Medical service is temporarily unavailable. Please wait and
|
||||
// then retry your request.
|
||||
//
|
||||
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
|
||||
// You have made too many requests within a short period of time. Wait for a
|
||||
// short time and then try your request again. Contact customer support for
|
||||
// more information about a service limit increase.
|
||||
//
|
||||
// * ErrCodeInvalidRequestException "InvalidRequestException"
|
||||
// The request that you made is invalid. Check your request to determine why
|
||||
// it's invalid and then retry the request.
|
||||
//
|
||||
// * ErrCodeInvalidEncodingException "InvalidEncodingException"
|
||||
// The input text was not in valid UTF-8 character encoding. Check your text
|
||||
// then retry your request.
|
||||
//
|
||||
// * ErrCodeTextSizeLimitExceededException "TextSizeLimitExceededException"
|
||||
// The size of the text you submitted exceeds the size limit. Reduce the size
|
||||
// of the text or use a smaller document and then retry your request.
|
||||
//
|
||||
// See also, https://docs.aws.amazon.com/goto/WebAPI/comprehendmedical-2018-10-30/DetectEntities
|
||||
func (c *ComprehendMedical) DetectEntities(input *DetectEntitiesInput) (*DetectEntitiesOutput, error) {
|
||||
req, out := c.DetectEntitiesRequest(input)
|
||||
return out, req.Send()
|
||||
}
|
||||
|
||||
// DetectEntitiesWithContext is the same as DetectEntities with the addition of
|
||||
// the ability to pass a context and additional request options.
|
||||
//
|
||||
// See DetectEntities for details on how to use this API operation.
|
||||
//
|
||||
// The context must be non-nil and will be used for request cancellation. If
|
||||
// the context is nil a panic will occur. In the future the SDK may create
|
||||
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
||||
// for more information on using Contexts.
|
||||
func (c *ComprehendMedical) DetectEntitiesWithContext(ctx aws.Context, input *DetectEntitiesInput, opts ...request.Option) (*DetectEntitiesOutput, error) {
|
||||
req, out := c.DetectEntitiesRequest(input)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return out, req.Send()
|
||||
}
|
||||
|
||||
const opDetectPHI = "DetectPHI"
|
||||
|
||||
// DetectPHIRequest generates a "aws/request.Request" representing the
|
||||
// client's request for the DetectPHI operation. The "output" return
|
||||
// value will be populated with the request's response once the request completes
|
||||
// successfully.
|
||||
//
|
||||
// Use "Send" method on the returned Request to send the API call to the service.
|
||||
// the "output" return value is not valid until after Send returns without error.
|
||||
//
|
||||
// See DetectPHI for more information on using the DetectPHI
|
||||
// API call, and error handling.
|
||||
//
|
||||
// This method is useful when you want to inject custom logic or configuration
|
||||
// into the SDK's request lifecycle. Such as custom headers, or retry logic.
|
||||
//
|
||||
//
|
||||
// // Example sending a request using the DetectPHIRequest method.
|
||||
// req, resp := client.DetectPHIRequest(params)
|
||||
//
|
||||
// err := req.Send()
|
||||
// if err == nil { // resp is now filled
|
||||
// fmt.Println(resp)
|
||||
// }
|
||||
//
|
||||
// See also, https://docs.aws.amazon.com/goto/WebAPI/comprehendmedical-2018-10-30/DetectPHI
|
||||
func (c *ComprehendMedical) DetectPHIRequest(input *DetectPHIInput) (req *request.Request, output *DetectPHIOutput) {
|
||||
op := &request.Operation{
|
||||
Name: opDetectPHI,
|
||||
HTTPMethod: "POST",
|
||||
HTTPPath: "/",
|
||||
}
|
||||
|
||||
if input == nil {
|
||||
input = &DetectPHIInput{}
|
||||
}
|
||||
|
||||
output = &DetectPHIOutput{}
|
||||
req = c.newRequest(op, input, output)
|
||||
return
|
||||
}
|
||||
|
||||
// DetectPHI API operation for AWS Comprehend Medical.
|
||||
//
|
||||
// Inspects the clinical text for personal health information (PHI) entities
|
||||
// and entity category, location, and confidence score on that information.
|
||||
//
|
||||
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
|
||||
// with awserr.Error's Code and Message methods to get detailed information about
|
||||
// the error.
|
||||
//
|
||||
// See the AWS API reference guide for AWS Comprehend Medical's
|
||||
// API operation DetectPHI for usage and error information.
|
||||
//
|
||||
// Returned Error Codes:
|
||||
// * ErrCodeInternalServerException "InternalServerException"
|
||||
// An internal server error occurred. Retry your request.
|
||||
//
|
||||
// * ErrCodeServiceUnavailableException "ServiceUnavailableException"
|
||||
// The Comprehend Medical service is temporarily unavailable. Please wait and
|
||||
// then retry your request.
|
||||
//
|
||||
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
|
||||
// You have made too many requests within a short period of time. Wait for a
|
||||
// short time and then try your request again. Contact customer support for
|
||||
// more information about a service limit increase.
|
||||
//
|
||||
// * ErrCodeInvalidRequestException "InvalidRequestException"
|
||||
// The request that you made is invalid. Check your request to determine why
|
||||
// it's invalid and then retry the request.
|
||||
//
|
||||
// * ErrCodeInvalidEncodingException "InvalidEncodingException"
|
||||
// The input text was not in valid UTF-8 character encoding. Check your text
|
||||
// then retry your request.
|
||||
//
|
||||
// * ErrCodeTextSizeLimitExceededException "TextSizeLimitExceededException"
|
||||
// The size of the text you submitted exceeds the size limit. Reduce the size
|
||||
// of the text or use a smaller document and then retry your request.
|
||||
//
|
||||
// See also, https://docs.aws.amazon.com/goto/WebAPI/comprehendmedical-2018-10-30/DetectPHI
|
||||
func (c *ComprehendMedical) DetectPHI(input *DetectPHIInput) (*DetectPHIOutput, error) {
|
||||
req, out := c.DetectPHIRequest(input)
|
||||
return out, req.Send()
|
||||
}
|
||||
|
||||
// DetectPHIWithContext is the same as DetectPHI with the addition of
|
||||
// the ability to pass a context and additional request options.
|
||||
//
|
||||
// See DetectPHI for details on how to use this API operation.
|
||||
//
|
||||
// The context must be non-nil and will be used for request cancellation. If
|
||||
// the context is nil a panic will occur. In the future the SDK may create
|
||||
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
|
||||
// for more information on using Contexts.
|
||||
func (c *ComprehendMedical) DetectPHIWithContext(ctx aws.Context, input *DetectPHIInput, opts ...request.Option) (*DetectPHIOutput, error) {
|
||||
req, out := c.DetectPHIRequest(input)
|
||||
req.SetContext(ctx)
|
||||
req.ApplyOptions(opts...)
|
||||
return out, req.Send()
|
||||
}
|
||||
|
||||
// An extracted segment of the text that is an attribute of an entity, or otherwise
|
||||
// related to an entity, such as the dosage of a medication taken. It contains
|
||||
// information about the attribute such as id, begin and end offset within the
|
||||
// input text, and the segment of the input text.
|
||||
type Attribute struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
// The 0-based character offset in the input text that shows where the attribute
|
||||
// begins. The offset returns the UTF-8 code point in the string.
|
||||
BeginOffset *int64 `type:"integer"`
|
||||
|
||||
// The 0-based character offset in the input text that shows where the attribute
|
||||
// ends. The offset returns the UTF-8 code point in the string.
|
||||
EndOffset *int64 `type:"integer"`
|
||||
|
||||
// The numeric identifier for this attribute. This is a monotonically increasing
|
||||
// id unique within this response rather than a global unique identifier.
|
||||
Id *int64 `type:"integer"`
|
||||
|
||||
// The level of confidence that Comprehend Medical has that this attribute is
|
||||
// correctly related to this entity.
|
||||
RelationshipScore *float64 `type:"float"`
|
||||
|
||||
// The level of confidence that Comprehend Medical has that the segment of text
|
||||
// is correctly recognized as an attribute.
|
||||
Score *float64 `type:"float"`
|
||||
|
||||
// The segment of input text extracted as this attribute.
|
||||
Text *string `min:"1" type:"string"`
|
||||
|
||||
// Contextual information for this attribute.
|
||||
Traits []*Trait `type:"list"`
|
||||
|
||||
// The type of attribute.
|
||||
Type *string `type:"string" enum:"EntitySubType"`
|
||||
}
|
||||
|
||||
// String returns the string representation
|
||||
func (s Attribute) String() string {
|
||||
return awsutil.Prettify(s)
|
||||
}
|
||||
|
||||
// GoString returns the string representation
|
||||
func (s Attribute) GoString() string {
|
||||
return s.String()
|
||||
}
|
||||
|
||||
// SetBeginOffset sets the BeginOffset field's value.
|
||||
func (s *Attribute) SetBeginOffset(v int64) *Attribute {
|
||||
s.BeginOffset = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetEndOffset sets the EndOffset field's value.
|
||||
func (s *Attribute) SetEndOffset(v int64) *Attribute {
|
||||
s.EndOffset = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetId sets the Id field's value.
|
||||
func (s *Attribute) SetId(v int64) *Attribute {
|
||||
s.Id = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetRelationshipScore sets the RelationshipScore field's value.
|
||||
func (s *Attribute) SetRelationshipScore(v float64) *Attribute {
|
||||
s.RelationshipScore = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetScore sets the Score field's value.
|
||||
func (s *Attribute) SetScore(v float64) *Attribute {
|
||||
s.Score = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetText sets the Text field's value.
|
||||
func (s *Attribute) SetText(v string) *Attribute {
|
||||
s.Text = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetTraits sets the Traits field's value.
|
||||
func (s *Attribute) SetTraits(v []*Trait) *Attribute {
|
||||
s.Traits = v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetType sets the Type field's value.
|
||||
func (s *Attribute) SetType(v string) *Attribute {
|
||||
s.Type = &v
|
||||
return s
|
||||
}
|
||||
|
||||
type DetectEntitiesInput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
// A UTF-8 text string containing the clinical content being examined for entities.
|
||||
// Each string must contain fewer than 20,000 bytes of characters.
|
||||
//
|
||||
// Text is a required field
|
||||
Text *string `min:"1" type:"string" required:"true"`
|
||||
}
|
||||
|
||||
// String returns the string representation
|
||||
func (s DetectEntitiesInput) String() string {
|
||||
return awsutil.Prettify(s)
|
||||
}
|
||||
|
||||
// GoString returns the string representation
|
||||
func (s DetectEntitiesInput) GoString() string {
|
||||
return s.String()
|
||||
}
|
||||
|
||||
// Validate inspects the fields of the type to determine if they are valid.
|
||||
func (s *DetectEntitiesInput) Validate() error {
|
||||
invalidParams := request.ErrInvalidParams{Context: "DetectEntitiesInput"}
|
||||
if s.Text == nil {
|
||||
invalidParams.Add(request.NewErrParamRequired("Text"))
|
||||
}
|
||||
if s.Text != nil && len(*s.Text) < 1 {
|
||||
invalidParams.Add(request.NewErrParamMinLen("Text", 1))
|
||||
}
|
||||
|
||||
if invalidParams.Len() > 0 {
|
||||
return invalidParams
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// SetText sets the Text field's value.
|
||||
func (s *DetectEntitiesInput) SetText(v string) *DetectEntitiesInput {
|
||||
s.Text = &v
|
||||
return s
|
||||
}
|
||||
|
||||
type DetectEntitiesOutput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
// The collection of medical entities extracted from the input text and their
|
||||
// associated information. For each entity, the response provides the entity
|
||||
// text, the entity category, where the entity text begins and ends, and the
|
||||
// level of confidence that Comprehend Medical has in the detection and analysis.
|
||||
// Attributes and traits of the entity are also returned.
|
||||
//
|
||||
// Entities is a required field
|
||||
Entities []*Entity `type:"list" required:"true"`
|
||||
|
||||
// If the result of the previous request to DetectEntities was truncated, include
|
||||
// the Paginationtoken to fetch the next page of entities.
|
||||
PaginationToken *string `min:"1" type:"string"`
|
||||
|
||||
// Attributes extracted from the input text that we were unable to relate to
|
||||
// an entity.
|
||||
UnmappedAttributes []*UnmappedAttribute `type:"list"`
|
||||
}
|
||||
|
||||
// String returns the string representation
|
||||
func (s DetectEntitiesOutput) String() string {
|
||||
return awsutil.Prettify(s)
|
||||
}
|
||||
|
||||
// GoString returns the string representation
|
||||
func (s DetectEntitiesOutput) GoString() string {
|
||||
return s.String()
|
||||
}
|
||||
|
||||
// SetEntities sets the Entities field's value.
|
||||
func (s *DetectEntitiesOutput) SetEntities(v []*Entity) *DetectEntitiesOutput {
|
||||
s.Entities = v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetPaginationToken sets the PaginationToken field's value.
|
||||
func (s *DetectEntitiesOutput) SetPaginationToken(v string) *DetectEntitiesOutput {
|
||||
s.PaginationToken = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetUnmappedAttributes sets the UnmappedAttributes field's value.
|
||||
func (s *DetectEntitiesOutput) SetUnmappedAttributes(v []*UnmappedAttribute) *DetectEntitiesOutput {
|
||||
s.UnmappedAttributes = v
|
||||
return s
|
||||
}
|
||||
|
||||
type DetectPHIInput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
// A UTF-8 text string containing the clinical content being examined for PHI
|
||||
// entities. Each string must contain fewer than 20,000 bytes of characters.
|
||||
//
|
||||
// Text is a required field
|
||||
Text *string `min:"1" type:"string" required:"true"`
|
||||
}
|
||||
|
||||
// String returns the string representation
|
||||
func (s DetectPHIInput) String() string {
|
||||
return awsutil.Prettify(s)
|
||||
}
|
||||
|
||||
// GoString returns the string representation
|
||||
func (s DetectPHIInput) GoString() string {
|
||||
return s.String()
|
||||
}
|
||||
|
||||
// Validate inspects the fields of the type to determine if they are valid.
|
||||
func (s *DetectPHIInput) Validate() error {
|
||||
invalidParams := request.ErrInvalidParams{Context: "DetectPHIInput"}
|
||||
if s.Text == nil {
|
||||
invalidParams.Add(request.NewErrParamRequired("Text"))
|
||||
}
|
||||
if s.Text != nil && len(*s.Text) < 1 {
|
||||
invalidParams.Add(request.NewErrParamMinLen("Text", 1))
|
||||
}
|
||||
|
||||
if invalidParams.Len() > 0 {
|
||||
return invalidParams
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// SetText sets the Text field's value.
|
||||
func (s *DetectPHIInput) SetText(v string) *DetectPHIInput {
|
||||
s.Text = &v
|
||||
return s
|
||||
}
|
||||
|
||||
type DetectPHIOutput struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
// The collection of PHI entities extracted from the input text and their associated
|
||||
// information. For each entity, the response provides the entity text, the
|
||||
// entity category, where the entity text begins and ends, and the level of
|
||||
// confidence that Comprehend Medical has in its detection.
|
||||
//
|
||||
// Entities is a required field
|
||||
Entities []*Entity `type:"list" required:"true"`
|
||||
|
||||
// If the result of the previous request to DetectPHI was truncated, include
|
||||
// the Paginationtoken to fetch the next page of PHI entities.
|
||||
PaginationToken *string `min:"1" type:"string"`
|
||||
}
|
||||
|
||||
// String returns the string representation
|
||||
func (s DetectPHIOutput) String() string {
|
||||
return awsutil.Prettify(s)
|
||||
}
|
||||
|
||||
// GoString returns the string representation
|
||||
func (s DetectPHIOutput) GoString() string {
|
||||
return s.String()
|
||||
}
|
||||
|
||||
// SetEntities sets the Entities field's value.
|
||||
func (s *DetectPHIOutput) SetEntities(v []*Entity) *DetectPHIOutput {
|
||||
s.Entities = v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetPaginationToken sets the PaginationToken field's value.
|
||||
func (s *DetectPHIOutput) SetPaginationToken(v string) *DetectPHIOutput {
|
||||
s.PaginationToken = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// Provides information about an extracted medical entity.
|
||||
type Entity struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
// The extracted attributes that relate to this entity.
|
||||
Attributes []*Attribute `type:"list"`
|
||||
|
||||
// The 0-based character offset in the input text that shows where the entity
|
||||
// begins. The offset returns the UTF-8 code point in the string.
|
||||
BeginOffset *int64 `type:"integer"`
|
||||
|
||||
// The category of the entity.
|
||||
Category *string `type:"string" enum:"EntityType"`
|
||||
|
||||
// The 0-based character offset in the input text that shows where the entity
|
||||
// ends. The offset returns the UTF-8 code point in the string.
|
||||
EndOffset *int64 `type:"integer"`
|
||||
|
||||
// The numeric identifier for the entity. This is a monotonically increasing
|
||||
// id unique within this response rather than a global unique identifier.
|
||||
Id *int64 `type:"integer"`
|
||||
|
||||
// The level of confidence that Comprehend Medical has in the accuracy of the
|
||||
// detection.
|
||||
Score *float64 `type:"float"`
|
||||
|
||||
// The segment of input text extracted as this entity.
|
||||
Text *string `min:"1" type:"string"`
|
||||
|
||||
// Contextual information for the entity
|
||||
Traits []*Trait `type:"list"`
|
||||
|
||||
// Describes the specific type of entity with category of entities.
|
||||
Type *string `type:"string" enum:"EntitySubType"`
|
||||
}
|
||||
|
||||
// String returns the string representation
|
||||
func (s Entity) String() string {
|
||||
return awsutil.Prettify(s)
|
||||
}
|
||||
|
||||
// GoString returns the string representation
|
||||
func (s Entity) GoString() string {
|
||||
return s.String()
|
||||
}
|
||||
|
||||
// SetAttributes sets the Attributes field's value.
|
||||
func (s *Entity) SetAttributes(v []*Attribute) *Entity {
|
||||
s.Attributes = v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetBeginOffset sets the BeginOffset field's value.
|
||||
func (s *Entity) SetBeginOffset(v int64) *Entity {
|
||||
s.BeginOffset = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetCategory sets the Category field's value.
|
||||
func (s *Entity) SetCategory(v string) *Entity {
|
||||
s.Category = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetEndOffset sets the EndOffset field's value.
|
||||
func (s *Entity) SetEndOffset(v int64) *Entity {
|
||||
s.EndOffset = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetId sets the Id field's value.
|
||||
func (s *Entity) SetId(v int64) *Entity {
|
||||
s.Id = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetScore sets the Score field's value.
|
||||
func (s *Entity) SetScore(v float64) *Entity {
|
||||
s.Score = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetText sets the Text field's value.
|
||||
func (s *Entity) SetText(v string) *Entity {
|
||||
s.Text = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetTraits sets the Traits field's value.
|
||||
func (s *Entity) SetTraits(v []*Trait) *Entity {
|
||||
s.Traits = v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetType sets the Type field's value.
|
||||
func (s *Entity) SetType(v string) *Entity {
|
||||
s.Type = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// Provides contextual information about the extracted entity.
|
||||
type Trait struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
// Provides a name or contextual description about the trait.
|
||||
Name *string `type:"string" enum:"AttributeName"`
|
||||
|
||||
// The level of confidence that Comprehend Medical has in the accuracy of this
|
||||
// trait.
|
||||
Score *float64 `type:"float"`
|
||||
}
|
||||
|
||||
// String returns the string representation
|
||||
func (s Trait) String() string {
|
||||
return awsutil.Prettify(s)
|
||||
}
|
||||
|
||||
// GoString returns the string representation
|
||||
func (s Trait) GoString() string {
|
||||
return s.String()
|
||||
}
|
||||
|
||||
// SetName sets the Name field's value.
|
||||
func (s *Trait) SetName(v string) *Trait {
|
||||
s.Name = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetScore sets the Score field's value.
|
||||
func (s *Trait) SetScore(v float64) *Trait {
|
||||
s.Score = &v
|
||||
return s
|
||||
}
|
||||
|
||||
// An attribute that we extracted, but were unable to relate to an entity.
|
||||
type UnmappedAttribute struct {
|
||||
_ struct{} `type:"structure"`
|
||||
|
||||
// The specific attribute that has been extracted but not mapped to an entity.
|
||||
Attribute *Attribute `type:"structure"`
|
||||
|
||||
// The type of the attribute, could be one of the following values: "MEDICATION",
|
||||
// "MEDICAL_CONDITION", "ANATOMY", "TEST_AND_TREATMENT_PROCEDURE" or "PERSONAL_HEALTH_INFORMATION".
|
||||
Type *string `type:"string" enum:"EntityType"`
|
||||
}
|
||||
|
||||
// String returns the string representation
|
||||
func (s UnmappedAttribute) String() string {
|
||||
return awsutil.Prettify(s)
|
||||
}
|
||||
|
||||
// GoString returns the string representation
|
||||
func (s UnmappedAttribute) GoString() string {
|
||||
return s.String()
|
||||
}
|
||||
|
||||
// SetAttribute sets the Attribute field's value.
|
||||
func (s *UnmappedAttribute) SetAttribute(v *Attribute) *UnmappedAttribute {
|
||||
s.Attribute = v
|
||||
return s
|
||||
}
|
||||
|
||||
// SetType sets the Type field's value.
|
||||
func (s *UnmappedAttribute) SetType(v string) *UnmappedAttribute {
|
||||
s.Type = &v
|
||||
return s
|
||||
}
|
||||
|
||||
const (
|
||||
// AttributeNameSign is a AttributeName enum value
|
||||
AttributeNameSign = "SIGN"
|
||||
|
||||
// AttributeNameSymptom is a AttributeName enum value
|
||||
AttributeNameSymptom = "SYMPTOM"
|
||||
|
||||
// AttributeNameDiagnosis is a AttributeName enum value
|
||||
AttributeNameDiagnosis = "DIAGNOSIS"
|
||||
|
||||
// AttributeNameNegation is a AttributeName enum value
|
||||
AttributeNameNegation = "NEGATION"
|
||||
)
|
||||
|
||||
const (
|
||||
// EntitySubTypeName is a EntitySubType enum value
|
||||
EntitySubTypeName = "NAME"
|
||||
|
||||
// EntitySubTypeDosage is a EntitySubType enum value
|
||||
EntitySubTypeDosage = "DOSAGE"
|
||||
|
||||
// EntitySubTypeRouteOrMode is a EntitySubType enum value
|
||||
EntitySubTypeRouteOrMode = "ROUTE_OR_MODE"
|
||||
|
||||
// EntitySubTypeForm is a EntitySubType enum value
|
||||
EntitySubTypeForm = "FORM"
|
||||
|
||||
// EntitySubTypeFrequency is a EntitySubType enum value
|
||||
EntitySubTypeFrequency = "FREQUENCY"
|
||||
|
||||
// EntitySubTypeDuration is a EntitySubType enum value
|
||||
EntitySubTypeDuration = "DURATION"
|
||||
|
||||
// EntitySubTypeGenericName is a EntitySubType enum value
|
||||
EntitySubTypeGenericName = "GENERIC_NAME"
|
||||
|
||||
// EntitySubTypeBrandName is a EntitySubType enum value
|
||||
EntitySubTypeBrandName = "BRAND_NAME"
|
||||
|
||||
// EntitySubTypeStrength is a EntitySubType enum value
|
||||
EntitySubTypeStrength = "STRENGTH"
|
||||
|
||||
// EntitySubTypeRate is a EntitySubType enum value
|
||||
EntitySubTypeRate = "RATE"
|
||||
|
||||
// EntitySubTypeAcuity is a EntitySubType enum value
|
||||
EntitySubTypeAcuity = "ACUITY"
|
||||
|
||||
// EntitySubTypeTestName is a EntitySubType enum value
|
||||
EntitySubTypeTestName = "TEST_NAME"
|
||||
|
||||
// EntitySubTypeTestValue is a EntitySubType enum value
|
||||
EntitySubTypeTestValue = "TEST_VALUE"
|
||||
|
||||
// EntitySubTypeTestUnits is a EntitySubType enum value
|
||||
EntitySubTypeTestUnits = "TEST_UNITS"
|
||||
|
||||
// EntitySubTypeProcedureName is a EntitySubType enum value
|
||||
EntitySubTypeProcedureName = "PROCEDURE_NAME"
|
||||
|
||||
// EntitySubTypeTreatmentName is a EntitySubType enum value
|
||||
EntitySubTypeTreatmentName = "TREATMENT_NAME"
|
||||
|
||||
// EntitySubTypeDate is a EntitySubType enum value
|
||||
EntitySubTypeDate = "DATE"
|
||||
|
||||
// EntitySubTypeAge is a EntitySubType enum value
|
||||
EntitySubTypeAge = "AGE"
|
||||
|
||||
// EntitySubTypeContactPoint is a EntitySubType enum value
|
||||
EntitySubTypeContactPoint = "CONTACT_POINT"
|
||||
|
||||
// EntitySubTypeEmail is a EntitySubType enum value
|
||||
EntitySubTypeEmail = "EMAIL"
|
||||
|
||||
// EntitySubTypeIdentifier is a EntitySubType enum value
|
||||
EntitySubTypeIdentifier = "IDENTIFIER"
|
||||
|
||||
// EntitySubTypeUrl is a EntitySubType enum value
|
||||
EntitySubTypeUrl = "URL"
|
||||
|
||||
// EntitySubTypeAddress is a EntitySubType enum value
|
||||
EntitySubTypeAddress = "ADDRESS"
|
||||
|
||||
// EntitySubTypeProfession is a EntitySubType enum value
|
||||
EntitySubTypeProfession = "PROFESSION"
|
||||
|
||||
// EntitySubTypeSystemOrganSite is a EntitySubType enum value
|
||||
EntitySubTypeSystemOrganSite = "SYSTEM_ORGAN_SITE"
|
||||
|
||||
// EntitySubTypeDirection is a EntitySubType enum value
|
||||
EntitySubTypeDirection = "DIRECTION"
|
||||
|
||||
// EntitySubTypeQuality is a EntitySubType enum value
|
||||
EntitySubTypeQuality = "QUALITY"
|
||||
|
||||
// EntitySubTypeQuantity is a EntitySubType enum value
|
||||
EntitySubTypeQuantity = "QUANTITY"
|
||||
)
|
||||
|
||||
const (
|
||||
// EntityTypeMedication is a EntityType enum value
|
||||
EntityTypeMedication = "MEDICATION"
|
||||
|
||||
// EntityTypeMedicalCondition is a EntityType enum value
|
||||
EntityTypeMedicalCondition = "MEDICAL_CONDITION"
|
||||
|
||||
// EntityTypeProtectedHealthInformation is a EntityType enum value
|
||||
EntityTypeProtectedHealthInformation = "PROTECTED_HEALTH_INFORMATION"
|
||||
|
||||
// EntityTypeTestTreatmentProcedure is a EntityType enum value
|
||||
EntityTypeTestTreatmentProcedure = "TEST_TREATMENT_PROCEDURE"
|
||||
|
||||
// EntityTypeAnatomy is a EntityType enum value
|
||||
EntityTypeAnatomy = "ANATOMY"
|
||||
)
|
||||
Generated
Vendored
+72
@@ -0,0 +1,72 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package comprehendmedicaliface provides an interface to enable mocking the AWS Comprehend Medical service client
|
||||
// for testing your code.
|
||||
//
|
||||
// It is important to note that this interface will have breaking changes
|
||||
// when the service model is updated and adds new API operations, paginators,
|
||||
// and waiters.
|
||||
package comprehendmedicaliface
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/service/comprehendmedical"
|
||||
)
|
||||
|
||||
// ComprehendMedicalAPI provides an interface to enable mocking the
|
||||
// comprehendmedical.ComprehendMedical service client's API operation,
|
||||
// paginators, and waiters. This make unit testing your code that calls out
|
||||
// to the SDK's service client's calls easier.
|
||||
//
|
||||
// The best way to use this interface is so the SDK's service client's calls
|
||||
// can be stubbed out for unit testing your code with the SDK without needing
|
||||
// to inject custom request handlers into the SDK's request pipeline.
|
||||
//
|
||||
// // myFunc uses an SDK service client to make a request to
|
||||
// // AWS Comprehend Medical.
|
||||
// func myFunc(svc comprehendmedicaliface.ComprehendMedicalAPI) bool {
|
||||
// // Make svc.DetectEntities request
|
||||
// }
|
||||
//
|
||||
// func main() {
|
||||
// sess := session.New()
|
||||
// svc := comprehendmedical.New(sess)
|
||||
//
|
||||
// myFunc(svc)
|
||||
// }
|
||||
//
|
||||
// In your _test.go file:
|
||||
//
|
||||
// // Define a mock struct to be used in your unit tests of myFunc.
|
||||
// type mockComprehendMedicalClient struct {
|
||||
// comprehendmedicaliface.ComprehendMedicalAPI
|
||||
// }
|
||||
// func (m *mockComprehendMedicalClient) DetectEntities(input *comprehendmedical.DetectEntitiesInput) (*comprehendmedical.DetectEntitiesOutput, error) {
|
||||
// // mock response/functionality
|
||||
// }
|
||||
//
|
||||
// func TestMyFunc(t *testing.T) {
|
||||
// // Setup Test
|
||||
// mockSvc := &mockComprehendMedicalClient{}
|
||||
//
|
||||
// myfunc(mockSvc)
|
||||
//
|
||||
// // Verify myFunc's functionality
|
||||
// }
|
||||
//
|
||||
// It is important to note that this interface will have breaking changes
|
||||
// when the service model is updated and adds new API operations, paginators,
|
||||
// and waiters. Its suggested to use the pattern above for testing, or using
|
||||
// tooling to generate mocks to satisfy the interfaces.
|
||||
type ComprehendMedicalAPI interface {
|
||||
DetectEntities(*comprehendmedical.DetectEntitiesInput) (*comprehendmedical.DetectEntitiesOutput, error)
|
||||
DetectEntitiesWithContext(aws.Context, *comprehendmedical.DetectEntitiesInput, ...request.Option) (*comprehendmedical.DetectEntitiesOutput, error)
|
||||
DetectEntitiesRequest(*comprehendmedical.DetectEntitiesInput) (*request.Request, *comprehendmedical.DetectEntitiesOutput)
|
||||
|
||||
DetectPHI(*comprehendmedical.DetectPHIInput) (*comprehendmedical.DetectPHIOutput, error)
|
||||
DetectPHIWithContext(aws.Context, *comprehendmedical.DetectPHIInput, ...request.Option) (*comprehendmedical.DetectPHIOutput, error)
|
||||
DetectPHIRequest(*comprehendmedical.DetectPHIInput) (*request.Request, *comprehendmedical.DetectPHIOutput)
|
||||
}
|
||||
|
||||
var _ ComprehendMedicalAPI = (*comprehendmedical.ComprehendMedical)(nil)
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
// Package comprehendmedical provides the client and types for making API
|
||||
// requests to AWS Comprehend Medical.
|
||||
//
|
||||
// Comprehend Medical extracts structured information from unstructured clinical
|
||||
// text. Use these actions to gain insight in your documents.
|
||||
//
|
||||
// See https://docs.aws.amazon.com/goto/WebAPI/comprehendmedical-2018-10-30 for more information on this service.
|
||||
//
|
||||
// See comprehendmedical package documentation for more information.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/comprehendmedical/
|
||||
//
|
||||
// Using the Client
|
||||
//
|
||||
// To contact AWS Comprehend Medical with the SDK use the New function to create
|
||||
// a new service client. With that client you can make API requests to the service.
|
||||
// These clients are safe to use concurrently.
|
||||
//
|
||||
// See the SDK's documentation for more information on how to use the SDK.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/
|
||||
//
|
||||
// See aws.Config documentation for more information on configuring SDK clients.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config
|
||||
//
|
||||
// See the AWS Comprehend Medical client ComprehendMedical for more
|
||||
// information on creating client for this service.
|
||||
// https://docs.aws.amazon.com/sdk-for-go/api/service/comprehendmedical/#New
|
||||
package comprehendmedical
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package comprehendmedical
|
||||
|
||||
const (
|
||||
|
||||
// ErrCodeInternalServerException for service response error code
|
||||
// "InternalServerException".
|
||||
//
|
||||
// An internal server error occurred. Retry your request.
|
||||
ErrCodeInternalServerException = "InternalServerException"
|
||||
|
||||
// ErrCodeInvalidEncodingException for service response error code
|
||||
// "InvalidEncodingException".
|
||||
//
|
||||
// The input text was not in valid UTF-8 character encoding. Check your text
|
||||
// then retry your request.
|
||||
ErrCodeInvalidEncodingException = "InvalidEncodingException"
|
||||
|
||||
// ErrCodeInvalidRequestException for service response error code
|
||||
// "InvalidRequestException".
|
||||
//
|
||||
// The request that you made is invalid. Check your request to determine why
|
||||
// it's invalid and then retry the request.
|
||||
ErrCodeInvalidRequestException = "InvalidRequestException"
|
||||
|
||||
// ErrCodeServiceUnavailableException for service response error code
|
||||
// "ServiceUnavailableException".
|
||||
//
|
||||
// The Comprehend Medical service is temporarily unavailable. Please wait and
|
||||
// then retry your request.
|
||||
ErrCodeServiceUnavailableException = "ServiceUnavailableException"
|
||||
|
||||
// ErrCodeTextSizeLimitExceededException for service response error code
|
||||
// "TextSizeLimitExceededException".
|
||||
//
|
||||
// The size of the text you submitted exceeds the size limit. Reduce the size
|
||||
// of the text or use a smaller document and then retry your request.
|
||||
ErrCodeTextSizeLimitExceededException = "TextSizeLimitExceededException"
|
||||
|
||||
// ErrCodeTooManyRequestsException for service response error code
|
||||
// "TooManyRequestsException".
|
||||
//
|
||||
// You have made too many requests within a short period of time. Wait for a
|
||||
// short time and then try your request again. Contact customer support for
|
||||
// more information about a service limit increase.
|
||||
ErrCodeTooManyRequestsException = "TooManyRequestsException"
|
||||
)
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
|
||||
|
||||
package comprehendmedical
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/client"
|
||||
"github.com/aws/aws-sdk-go/aws/client/metadata"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/aws/signer/v4"
|
||||
"github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
|
||||
)
|
||||
|
||||
// ComprehendMedical provides the API operation methods for making requests to
|
||||
// AWS Comprehend Medical. See this package's package overview docs
|
||||
// for details on the service.
|
||||
//
|
||||
// ComprehendMedical methods are safe to use concurrently. It is not safe to
|
||||
// modify mutate any of the struct's properties though.
|
||||
type ComprehendMedical struct {
|
||||
*client.Client
|
||||
}
|
||||
|
||||
// Used for custom client initialization logic
|
||||
var initClient func(*client.Client)
|
||||
|
||||
// Used for custom request initialization logic
|
||||
var initRequest func(*request.Request)
|
||||
|
||||
// Service information constants
|
||||
const (
|
||||
ServiceName = "ComprehendMedical" // Name of service.
|
||||
EndpointsID = "comprehendmedical" // ID to lookup a service endpoint with.
|
||||
ServiceID = "ComprehendMedical" // ServiceID is a unique identifer of a specific service.
|
||||
)
|
||||
|
||||
// New creates a new instance of the ComprehendMedical client with a session.
|
||||
// If additional configuration is needed for the client instance use the optional
|
||||
// aws.Config parameter to add your extra config.
|
||||
//
|
||||
// Example:
|
||||
// // Create a ComprehendMedical client from just a session.
|
||||
// svc := comprehendmedical.New(mySession)
|
||||
//
|
||||
// // Create a ComprehendMedical client with additional configuration
|
||||
// svc := comprehendmedical.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
|
||||
func New(p client.ConfigProvider, cfgs ...*aws.Config) *ComprehendMedical {
|
||||
c := p.ClientConfig(EndpointsID, cfgs...)
|
||||
if c.SigningNameDerived || len(c.SigningName) == 0 {
|
||||
c.SigningName = "comprehendmedical"
|
||||
}
|
||||
return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName)
|
||||
}
|
||||
|
||||
// newClient creates, initializes and returns a new service client instance.
|
||||
func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *ComprehendMedical {
|
||||
svc := &ComprehendMedical{
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: ServiceName,
|
||||
ServiceID: ServiceID,
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
APIVersion: "2018-10-30",
|
||||
JSONVersion: "1.1",
|
||||
TargetPrefix: "ComprehendMedical_20181030",
|
||||
},
|
||||
handlers,
|
||||
),
|
||||
}
|
||||
|
||||
// Handlers
|
||||
svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
|
||||
svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler)
|
||||
svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler)
|
||||
svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler)
|
||||
svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler)
|
||||
|
||||
// Run custom client initialization if present
|
||||
if initClient != nil {
|
||||
initClient(svc.Client)
|
||||
}
|
||||
|
||||
return svc
|
||||
}
|
||||
|
||||
// newRequest creates a new request for a ComprehendMedical operation and runs any
|
||||
// custom request initialization.
|
||||
func (c *ComprehendMedical) newRequest(op *request.Operation, params, data interface{}) *request.Request {
|
||||
req := c.NewRequest(op, params, data)
|
||||
|
||||
// Run custom request initialization if present
|
||||
if initRequest != nil {
|
||||
initRequest(req)
|
||||
}
|
||||
|
||||
return req
|
||||
}
|
||||
Reference in New Issue
Block a user