UpdateKbOperationDTO 類別

包含要更新的 QnA 清單。

繼承
UpdateKbOperationDTO

建構函式

UpdateKbOperationDTO(*, add=None, delete=None, update=None, enable_hierarchical_extraction: bool = None, default_answer_used_for_extraction: str = None, **kwargs)

參數

add
UpdateKbOperationDTOAdd
必要

用於新增作業的 CreateKbInputDTO 實例

delete
UpdateKbOperationDTODelete
必要

刪除作業的 DeleteKbContentsDTO 實例

update
UpdateKbOperationDTOUpdate
必要

UpdateKbContentsDTO for Update Operation 的實例

enable_hierarchical_extraction
bool
必要

從檔案和 URL 啟用 Q-A 的階層式擷取。 如果此欄位不存在,則會使用 KB 建立期間設定的值。

default_answer_used_for_extraction
str
必要

任何 Q-A 中沒有從檔擷取答案,但具有階層的文字字串作為答案。 EnableHierarchicalExtraction 欄位設定為 True 時為必要項。

方法

as_dict

使用 json.dump 傳回可以是 JSONify 的聽寫。

進階用法可以選擇性地使用回呼作為參數:

索引鍵是 Python 中使用的屬性名稱。 Attr_desc是中繼資料的聽寫。 目前包含具有 msrest 類型的 'type',以及具有 RestAPI 編碼金鑰的 'key'。 Value 是這個 物件中的目前值。

傳回的字串將用來序列化索引鍵。 如果傳回類型是清單,則會將此視為階層式結果聽寫。

請參閱此檔案中的三個範例:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

如果您想要 XML 序列化,您可以傳遞 kwargs is_xml=True。

deserialize

使用 RestAPI 語法剖析 str 並傳回模型。

enable_additional_properties_sending
from_dict

使用指定的金鑰擷取器剖析聽寫會傳回模型。

根據預設,請考慮金鑰擷取器 (rest_key_case_insensitive_extractor、attribute_key_case_insensitive_extractor和last_rest_key_case_insensitive_extractor)

is_xml_model
serialize

傳回會從此模型傳送至 Azure 的 JSON。

這是 as_dict (full_restapi_key_transformer別名,keep_readonly=False)

如果您想要 XML 序列化,您可以傳遞 kwargs is_xml=True。

validate

以遞迴方式驗證此模型,並傳回 ValidationError 的清單。

as_dict

使用 json.dump 傳回可以是 JSONify 的聽寫。

進階用法可以選擇性地使用回呼作為參數:

索引鍵是 Python 中使用的屬性名稱。 Attr_desc是中繼資料的聽寫。 目前包含具有 msrest 類型的 'type',以及具有 RestAPI 編碼金鑰的 'key'。 Value 是這個 物件中的目前值。

傳回的字串將用來序列化索引鍵。 如果傳回類型是清單,則會將此視為階層式結果聽寫。

請參閱此檔案中的三個範例:

  • attribute_transformer

  • full_restapi_key_transformer

  • last_restapi_key_transformer

如果您想要 XML 序列化,您可以傳遞 kwargs is_xml=True。

as_dict(keep_readonly=True, key_transformer=<function attribute_transformer>, **kwargs)

參數

key_transformer
<xref:function>

金鑰轉換器函式。

keep_readonly
預設值: True

傳回

與聽寫 JSON 相容的物件

傳回類型

deserialize

使用 RestAPI 語法剖析 str 並傳回模型。

deserialize(data, content_type=None)

參數

data
str
必要

使用 RestAPI 結構的 str。 JSON 預設為 。

content_type
str
預設值: None

JSON 預設會設定 application/xml if XML。

傳回

此模型的實例

例外狀況

DeserializationError if something went wrong

enable_additional_properties_sending

enable_additional_properties_sending()

from_dict

使用指定的金鑰擷取器剖析聽寫會傳回模型。

根據預設,請考慮金鑰擷取器 (rest_key_case_insensitive_extractor、attribute_key_case_insensitive_extractor和last_rest_key_case_insensitive_extractor)

from_dict(data, key_extractors=None, content_type=None)

參數

data
dict
必要

使用 RestAPI 結構的聽寫

content_type
str
預設值: None

JSON 預設會設定 application/xml if XML。

key_extractors
預設值: None

傳回

此模型的實例

例外狀況

DeserializationError if something went wrong

is_xml_model

is_xml_model()

serialize

傳回會從此模型傳送至 Azure 的 JSON。

這是 as_dict (full_restapi_key_transformer別名,keep_readonly=False)

如果您想要 XML 序列化,您可以傳遞 kwargs is_xml=True。

serialize(keep_readonly=False, **kwargs)

參數

keep_readonly
bool
預設值: False

如果您想要序列化唯讀屬性

傳回

與聽寫 JSON 相容的物件

傳回類型

validate

以遞迴方式驗證此模型,並傳回 ValidationError 的清單。

validate()

傳回

驗證錯誤清單

傳回類型