EventsCustomMetricResult 類別

自訂計量結果。

必須填入所有必要的參數,才能傳送至 Azure。

繼承
EventsCustomMetricResult

建構函式

EventsCustomMetricResult(**kwargs)

參數

id
str
必要

此事件的唯一識別碼。

count
<xref:long>
必要

事件的計數

timestamp
datetime
必要

事件的時間戳記

custom_dimensions
EventsResultDataCustomDimensions
必要

事件的自訂維度

custom_measurements
EventsResultDataCustomMeasurements
必要

事件的自訂度量

operation
EventsOperationInfo
必要

事件的作業資訊

session
EventsSessionInfo
必要

事件的會話資訊

user
EventsUserInfo
必要

事件的使用者資訊

cloud
EventsCloudInfo
必要

事件的雲端資訊

ai
EventsAiInfo
必要

事件的 AI 資訊

application
EventsApplicationInfo
必要

事件的應用程式資訊

client
EventsClientInfo
必要

事件的用戶端資訊

type
str
必要

必要。 由伺服器填入的常數。

custom_metric
EventsCustomMetricInfo
必要

方法

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()

傳回

驗證錯誤清單

傳回類型