Class LogSettings
java.lang.Object
com.azure.resourcemanager.monitor.models.LogSettings
- All Implemented Interfaces:
com.azure.json.JsonSerializable<LogSettings>
public final class LogSettings
extends Object
implements com.azure.json.JsonSerializable<LogSettings>
Part of MultiTenantDiagnosticSettings. Specifies the settings for a particular log.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncategory()
Get the category property: Name of a Diagnostic Log category for a resource type this setting is applied to.Get the categoryGroup property: Name of a Diagnostic Log category group for a resource type this setting is applied to.boolean
enabled()
Get the enabled property: a value indicating whether this log is enabled.static LogSettings
fromJson
(com.azure.json.JsonReader jsonReader) Reads an instance of LogSettings from the JsonReader.Get the retentionPolicy property: the retention policy for this log.com.azure.json.JsonWriter
toJson
(com.azure.json.JsonWriter jsonWriter) void
validate()
Validates the instance.withCategory
(String category) Set the category property: Name of a Diagnostic Log category for a resource type this setting is applied to.withCategoryGroup
(String categoryGroup) Set the categoryGroup property: Name of a Diagnostic Log category group for a resource type this setting is applied to.withEnabled
(boolean enabled) Set the enabled property: a value indicating whether this log is enabled.withRetentionPolicy
(RetentionPolicy retentionPolicy) Set the retentionPolicy property: the retention policy for this log.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
LogSettings
public LogSettings()Creates an instance of LogSettings class.
-
-
Method Details
-
category
Get the category property: Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation.- Returns:
- the category value.
-
withCategory
Set the category property: Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation.- Parameters:
category
- the category value to set.- Returns:
- the LogSettings object itself.
-
categoryGroup
Get the categoryGroup property: Name of a Diagnostic Log category group for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation.- Returns:
- the categoryGroup value.
-
withCategoryGroup
Set the categoryGroup property: Name of a Diagnostic Log category group for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation.- Parameters:
categoryGroup
- the categoryGroup value to set.- Returns:
- the LogSettings object itself.
-
enabled
public boolean enabled()Get the enabled property: a value indicating whether this log is enabled.- Returns:
- the enabled value.
-
withEnabled
Set the enabled property: a value indicating whether this log is enabled.- Parameters:
enabled
- the enabled value to set.- Returns:
- the LogSettings object itself.
-
retentionPolicy
Get the retentionPolicy property: the retention policy for this log.- Returns:
- the retentionPolicy value.
-
withRetentionPolicy
Set the retentionPolicy property: the retention policy for this log.- Parameters:
retentionPolicy
- the retentionPolicy value to set.- Returns:
- the LogSettings object itself.
-
validate
public void validate()Validates the instance.- Throws:
IllegalArgumentException
- thrown if the instance is not valid.
-
toJson
- Specified by:
toJson
in interfacecom.azure.json.JsonSerializable<LogSettings>
- Throws:
IOException
-
fromJson
Reads an instance of LogSettings from the JsonReader.- Parameters:
jsonReader
- The JsonReader being read.- Returns:
- An instance of LogSettings if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IllegalStateException
- If the deserialized JSON object was missing any required properties.IOException
- If an error occurs while reading the LogSettings.
-