Skip to content

Commit

Permalink
Patch Attempt Azure#3
Browse files Browse the repository at this point in the history
  • Loading branch information
Graham Thomas committed Jul 3, 2024
1 parent c2ee2cb commit 38279e9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,29 @@
"""
from typing import TYPE_CHECKING, List, Optional, Union
from ._models import DeidentificationContent as DeidentificationContentGenerated
from models import StringIndexType

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from .. import models as _models


class DeidentificationContent(DeidentificationContentGenerated):
"""Request for synchronous De-Identify operation.
All required parameters must be populated in order to send to server.
:ivar input_text: Input text to deidentify. Required.
:vartype input_text: str
:ivar operation: Operation to perform on the input. Required. Known values are: "Redact",
"Surrogate", and "Tag".
:vartype operation: str or ~azure.health.deidentification.models.OperationType
:ivar data_type: Data type of the input. Required. "Plaintext"
:vartype data_type: str or ~azure.health.deidentification.models.DocumentDataType
:ivar redaction_format: Format of the redacted output. Only valid when OperationType is Redact.
:vartype redaction_format: str
"""

# This isn't a perfect solution as it still allows customers to update the stringIndexType manually without the constructor.
def __init__(
self,
*,
Expand All @@ -28,7 +43,7 @@ def __init__(
input_text=input_text,
operation=operation,
data_type=data_type,
string_index_type=StringIndexType.UNICODE_CODE_POINT,
string_index_type=_models.StringIndexType.UNICODE_CODE_POINT,
redaction_format=redaction_format,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_hello_world(self, healthdataaiservices_deid_service_endpoint):
content = DeidentificationContent(
input_text="Hello, my name is John Smith.",
operation=OperationType.SURROGATE,
data_type=DocumentDataType.PLAIN_TEXT,
data_type=DocumentDataType.PLAINTEXT,
)

result: DeidentificationResult = client.deidentify(content)
Expand Down

0 comments on commit 38279e9

Please sign in to comment.