internal FlowLogData(string id, string name, string resourceType, string location, IDictionary <string, string> tags, string etag, string targetResourceId, string targetResourceGuid, string storageId, bool?enabled, RetentionPolicyParameters retentionPolicy, FlowLogFormatParameters format, TrafficAnalyticsProperties flowAnalyticsConfiguration, ProvisioningState?provisioningState) : base(id, name, resourceType, location, tags) { Etag = etag; TargetResourceId = targetResourceId; TargetResourceGuid = targetResourceGuid; StorageId = storageId; Enabled = enabled; RetentionPolicy = retentionPolicy; Format = format; FlowAnalyticsConfiguration = flowAnalyticsConfiguration; ProvisioningState = provisioningState; }
internal static FlowLogData DeserializeFlowLogData(JsonElement element) { Optional <string> etag = default; Optional <string> name = default; Optional <string> type = default; Optional <string> location = default; Optional <IDictionary <string, string> > tags = default; ResourceIdentifier id = default; Optional <string> targetResourceId = default; Optional <string> targetResourceGuid = default; Optional <string> storageId = default; Optional <bool> enabled = default; Optional <RetentionPolicyParameters> retentionPolicy = default; Optional <FlowLogFormatParameters> format = default; Optional <TrafficAnalyticsProperties> flowAnalyticsConfiguration = default; Optional <ProvisioningState> provisioningState = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("etag")) { etag = property.Value.GetString(); continue; } if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("type")) { type = property.Value.GetString(); continue; } if (property.NameEquals("location")) { location = property.Value.GetString(); continue; } if (property.NameEquals("tags")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } Dictionary <string, string> dictionary = new Dictionary <string, string>(); foreach (var property0 in property.Value.EnumerateObject()) { dictionary.Add(property0.Name, property0.Value.GetString()); } tags = dictionary; continue; } if (property.NameEquals("id")) { id = property.Value.GetString(); continue; } if (property.NameEquals("properties")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } foreach (var property0 in property.Value.EnumerateObject()) { if (property0.NameEquals("targetResourceId")) { targetResourceId = property0.Value.GetString(); continue; } if (property0.NameEquals("targetResourceGuid")) { targetResourceGuid = property0.Value.GetString(); continue; } if (property0.NameEquals("storageId")) { storageId = property0.Value.GetString(); continue; } if (property0.NameEquals("enabled")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } enabled = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("retentionPolicy")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } retentionPolicy = RetentionPolicyParameters.DeserializeRetentionPolicyParameters(property0.Value); continue; } if (property0.NameEquals("format")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } format = FlowLogFormatParameters.DeserializeFlowLogFormatParameters(property0.Value); continue; } if (property0.NameEquals("flowAnalyticsConfiguration")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } flowAnalyticsConfiguration = TrafficAnalyticsProperties.DeserializeTrafficAnalyticsProperties(property0.Value); continue; } if (property0.NameEquals("provisioningState")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } provisioningState = new ProvisioningState(property0.Value.GetString()); continue; } } continue; } } return(new FlowLogData(id, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), etag.Value, targetResourceId.Value, targetResourceGuid.Value, storageId.Value, Optional.ToNullable(enabled), retentionPolicy.Value, format.Value, flowAnalyticsConfiguration.Value, Optional.ToNullable(provisioningState))); }