internal static ContainerRegistryArtifactEventData DeserializeContainerRegistryArtifactEventData(JsonElement element)
        {
            Optional <string>         id        = default;
            Optional <DateTimeOffset> timestamp = default;
            Optional <string>         action    = default;
            Optional <string>         location  = default;
            Optional <ContainerRegistryArtifactEventTarget>    target            = default;
            Optional <ContainerRegistryEventConnectedRegistry> connectedRegistry = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("timestamp"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    timestamp = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("action"))
                {
                    action = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("location"))
                {
                    location = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("target"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    target = ContainerRegistryArtifactEventTarget.DeserializeContainerRegistryArtifactEventTarget(property.Value);
                    continue;
                }
                if (property.NameEquals("connectedRegistry"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    connectedRegistry = ContainerRegistryEventConnectedRegistry.DeserializeContainerRegistryEventConnectedRegistry(property.Value);
                    continue;
                }
            }
            return(new ContainerRegistryArtifactEventData(id.Value, Optional.ToNullable(timestamp), action.Value, location.Value, target.Value, connectedRegistry.Value));
        }
 internal ContainerRegistryArtifactEventData(string id, DateTimeOffset?timestamp, string action, string location, ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry)
 {
     Id                = id;
     Timestamp         = timestamp;
     Action            = action;
     Location          = location;
     Target            = target;
     ConnectedRegistry = connectedRegistry;
 }
Beispiel #3
0
 internal ContainerRegistryEventData(string id, DateTimeOffset?timestamp, string action, string location, ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry)
 {
     Id                = id;
     Timestamp         = timestamp;
     Action            = action;
     Location          = location;
     Target            = target;
     Request           = request;
     Actor             = actor;
     Source            = source;
     ConnectedRegistry = connectedRegistry;
 }
 internal ContainerRegistryChartDeletedEventData(string id, DateTimeOffset?timestamp, string action, string location, ContainerRegistryArtifactEventTarget target, ContainerRegistryEventConnectedRegistry connectedRegistry) : base(id, timestamp, action, location, target, connectedRegistry)
 {
 }
Beispiel #5
0
 internal ContainerRegistryImageDeletedEventData(string id, DateTimeOffset?timestamp, string action, string location, ContainerRegistryEventTarget target, ContainerRegistryEventRequest request, ContainerRegistryEventActor actor, ContainerRegistryEventSource source, ContainerRegistryEventConnectedRegistry connectedRegistry) : base(id, timestamp, action, location, target, request, actor, source, connectedRegistry)
 {
 }