{
  "description": "EventExposure is the Schema for the eventexposures API.\nIt represents a declaration that an application publishes events of a specific type,\nmaking them available for subscription by other applications.",
  "properties": {
    "apiVersion": {
      "type": "string",
      "description": "Must be \"event.cp.ei.telekom.de/v1\".",
      "const": "event.cp.ei.telekom.de/v1"
    },
    "kind": {
      "type": "string",
      "description": "Must be \"EventExposure\".",
      "const": "EventExposure"
    },
    "metadata": {
      "type": "object",
      "description": "Standard Kubernetes object metadata. See https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/object-meta/",
      "properties": {
        "name": {
          "type": "string",
          "description": "Name must be unique within a namespace. Is required when creating resources."
        },
        "namespace": {
          "type": "string",
          "description": "Namespace defines the space within which each name must be unique."
        },
        "labels": {
          "type": "object",
          "description": "Map of string keys and values that can be used to organize and categorize objects.",
          "additionalProperties": {
            "type": "string"
          }
        },
        "annotations": {
          "type": "object",
          "description": "Annotations is an unstructured key value map stored with a resource that may be set by external tools.",
          "additionalProperties": {
            "type": "string"
          }
        },
        "generateName": {
          "type": "string",
          "description": "GenerateName is an optional prefix, used by the server, to generate a unique name only if the Name field has not been provided."
        }
      }
    },
    "spec": {
      "description": "EventExposureSpec defines the desired state of EventExposure.",
      "properties": {
        "additionalPublisherIds": {
          "description": "AdditionalPublisherIds allows multiple application IDs to publish to the same event type.\nTodo: rethink this approach and consider a decoupling",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "approval": {
          "description": "Approval configures how subscriptions to this event are approved.",
          "properties": {
            "strategy": {
              "default": "Auto",
              "description": "Strategy defines the approval mode.",
              "enum": [
                "Auto",
                "Simple",
                "FourEyes"
              ],
              "type": "string"
            },
            "trustedTeams": {
              "description": "TrustedTeams identifies teams that are trusted for approving subscriptions.\nBy default your own team is trusted.",
              "items": {
                "type": "string"
              },
              "maxItems": 10,
              "minItems": 0,
              "type": "array"
            }
          },
          "required": [
            "strategy"
          ],
          "type": "object"
        },
        "eventType": {
          "description": "EventType is the dot-separated event type identifier (e.g. \"de.telekom.eni.quickstart.v1\").\nReferences the EventType CR via MakeEventTypeName() conversion.",
          "minLength": 1,
          "type": "string"
        },
        "provider": {
          "description": "Provider identifies the providing application.",
          "properties": {
            "apiVersion": {
              "description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
              "type": "string"
            },
            "kind": {
              "description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
              "type": "string"
            },
            "name": {
              "type": "string"
            },
            "namespace": {
              "type": "string"
            },
            "uid": {
              "description": "UID is a type that holds unique ID values, including UUIDs.  Because we\ndon't ONLY use UUIDs, this is an alias to string.  Being a type captures\nintent and helps make sure that UIDs and names do not get conflated.",
              "type": "string"
            }
          },
          "required": [
            "name",
            "namespace"
          ],
          "type": "object"
        },
        "scopes": {
          "description": "Scopes defines named scopes with optional publisher-side trigger filtering.",
          "items": {
            "description": "EventScope defines a named scope with required trigger-based filtering for event exposure.\nScopes allow publishers to partition their events and apply publisher-side filters.\nEach scope must define a trigger that specifies which events belong to it.",
            "properties": {
              "name": {
                "description": "Name is the unique identifier for this scope.",
                "minLength": 1,
                "type": "string"
              },
              "trigger": {
                "description": "Trigger defines publisher-side filtering criteria for this scope.\nEvery scope must define a trigger.",
                "properties": {
                  "responseFilter": {
                    "description": "ResponseFilter controls payload shaping (which fields to return).",
                    "properties": {
                      "mode": {
                        "default": "Include",
                        "description": "Mode controls whether the listed paths are included or excluded.",
                        "enum": [
                          "Include",
                          "Exclude"
                        ],
                        "type": "string"
                      },
                      "paths": {
                        "description": "Paths lists the JSON paths to include or exclude from the event payload.",
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      }
                    },
                    "type": "object"
                  },
                  "selectionFilter": {
                    "description": "SelectionFilter controls event matching (which events to deliver).",
                    "properties": {
                      "attributes": {
                        "additionalProperties": {
                          "type": "string"
                        },
                        "description": "Attributes defines simple key-value equality matches on CloudEvents attributes.\nAll entries are AND-ed together.",
                        "type": "object"
                      },
                      "expression": {
                        "description": "Expression contains an arbitrary JSON filter expression tree\nusing logical operators (and, or) and comparisons (eq, ge, gt, le, lt, ne)\nthat is passed through to the configuration backend without structural validation.",
                        "x-kubernetes-preserve-unknown-fields": true
                      }
                    },
                    "type": "object"
                  }
                },
                "type": "object"
              }
            },
            "required": [
              "name",
              "trigger"
            ],
            "type": "object"
          },
          "type": "array"
        },
        "visibility": {
          "default": "Enterprise",
          "description": "Visibility defines who can see and subscribe to this event.",
          "enum": [
            "World",
            "Zone",
            "Enterprise"
          ],
          "type": "string"
        },
        "zone": {
          "description": "Zone references the Zone CR where this event is exposed.",
          "properties": {
            "name": {
              "type": "string"
            },
            "namespace": {
              "type": "string"
            },
            "uid": {
              "description": "UID is a type that holds unique ID values, including UUIDs.  Because we\ndon't ONLY use UUIDs, this is an alias to string.  Being a type captures\nintent and helps make sure that UIDs and names do not get conflated.",
              "type": "string"
            }
          },
          "required": [
            "name",
            "namespace"
          ],
          "type": "object"
        }
      },
      "required": [
        "approval",
        "eventType",
        "provider",
        "visibility",
        "zone"
      ],
      "type": "object"
    },
    "status": {
      "description": "EventExposureStatus defines the observed state of EventExposure.",
      "properties": {
        "active": {
          "description": "Active indicates whether this EventExposure is the active one for its event type.",
          "type": "boolean"
        },
        "callbackURL": {
          "description": "CallbackURL is the URL of callback gateway in the provider zone.",
          "type": "string"
        },
        "conditions": {
          "items": {
            "description": "Condition contains details for one aspect of the current state of this API Resource.",
            "properties": {
              "lastTransitionTime": {
                "description": "lastTransitionTime is the last time the condition transitioned from one status to another.\nThis should be when the underlying condition changed.  If that is not known, then using the time when the API field changed is acceptable.",
                "format": "date-time",
                "type": "string"
              },
              "message": {
                "description": "message is a human readable message indicating details about the transition.\nThis may be an empty string.",
                "maxLength": 32768,
                "type": "string"
              },
              "observedGeneration": {
                "description": "observedGeneration represents the .metadata.generation that the condition was set based upon.\nFor instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date\nwith respect to the current state of the instance.",
                "format": "int64",
                "minimum": 0,
                "type": "integer"
              },
              "reason": {
                "description": "reason contains a programmatic identifier indicating the reason for the condition's last transition.\nProducers of specific condition types may define expected values and meanings for this field,\nand whether the values are considered a guaranteed API.\nThe value should be a CamelCase string.\nThis field may not be empty.",
                "maxLength": 1024,
                "minLength": 1,
                "pattern": "^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$",
                "type": "string"
              },
              "status": {
                "description": "status of the condition, one of True, False, Unknown.",
                "enum": [
                  "True",
                  "False",
                  "Unknown"
                ],
                "type": "string"
              },
              "type": {
                "description": "type of condition in CamelCase or in foo.example.com/CamelCase.",
                "maxLength": 316,
                "pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$",
                "type": "string"
              }
            },
            "required": [
              "lastTransitionTime",
              "message",
              "reason",
              "status",
              "type"
            ],
            "type": "object"
          },
          "type": "array",
          "x-kubernetes-list-map-keys": [
            "type"
          ],
          "x-kubernetes-list-type": "map"
        },
        "proxyRoutes": {
          "description": "ProxyRoutes references proxy gateway Route CRs for cross-zone SSE delivery.",
          "items": {
            "description": "ObjectRef is a reference to a Kubernetes object\nIt is similar to types.NamespacedName but has the required json tags for serialization",
            "properties": {
              "name": {
                "type": "string"
              },
              "namespace": {
                "type": "string"
              },
              "uid": {
                "description": "UID is a type that holds unique ID values, including UUIDs.  Because we\ndon't ONLY use UUIDs, this is an alias to string.  Being a type captures\nintent and helps make sure that UIDs and names do not get conflated.",
                "type": "string"
              }
            },
            "required": [
              "name",
              "namespace"
            ],
            "type": "object"
          },
          "type": "array"
        },
        "publisher": {
          "description": "Publisher references the Publisher CR in the pubsub domain.",
          "properties": {
            "name": {
              "type": "string"
            },
            "namespace": {
              "type": "string"
            },
            "uid": {
              "description": "UID is a type that holds unique ID values, including UUIDs.  Because we\ndon't ONLY use UUIDs, this is an alias to string.  Being a type captures\nintent and helps make sure that UIDs and names do not get conflated.",
              "type": "string"
            }
          },
          "required": [
            "name",
            "namespace"
          ],
          "type": "object"
        },
        "route": {
          "description": "Route references the primary gateway Route CR created for this exposure.",
          "properties": {
            "name": {
              "type": "string"
            },
            "namespace": {
              "type": "string"
            },
            "uid": {
              "description": "UID is a type that holds unique ID values, including UUIDs.  Because we\ndon't ONLY use UUIDs, this is an alias to string.  Being a type captures\nintent and helps make sure that UIDs and names do not get conflated.",
              "type": "string"
            }
          },
          "required": [
            "name",
            "namespace"
          ],
          "type": "object"
        },
        "sseUrls": {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object"
        }
      },
      "required": [
        "active"
      ],
      "type": "object"
    }
  },
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://telekom.github.io/controlplane/schemas/event.cp.ei.telekom.de/eventexposure_v1.json",
  "title": "EventExposure",
  "required": [
    "apiVersion",
    "kind",
    "metadata"
  ]
}
