{
  "description": "Subscriber is the Schema for the subscribers API.\nIt represents an event subscription registration in the configuration backend.\nSubscriber resources are created and managed by the EventSubscription handler in the event domain.",
  "properties": {
    "apiVersion": {
      "type": "string",
      "description": "Must be \"pubsub.cp.ei.telekom.de/v1\".",
      "const": "pubsub.cp.ei.telekom.de/v1"
    },
    "kind": {
      "type": "string",
      "description": "Must be \"Subscriber\".",
      "const": "Subscriber"
    },
    "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": "SubscriberSpec defines the desired state of Subscriber.\nSubscriber represents an event subscription registration in the configuration backend.\nIt is created by the EventSubscription handler in the event domain.",
      "properties": {
        "appliedScopes": {
          "description": "AppliedScopes lists the scope names that are applied to this subscription.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "delivery": {
          "description": "Delivery configures how events are delivered to the subscriber.",
          "properties": {
            "callback": {
              "description": "Callback is the URL where events are delivered.\nRequired when type is \"callback\", must not be set for \"ServerSentEvent\".",
              "type": "string"
            },
            "circuitBreakerOptOut": {
              "description": "CircuitBreakerOptOut disables the circuit breaker for this subscription.",
              "type": "boolean"
            },
            "enforceGetHttpRequestMethodForHealthCheck": {
              "description": "EnforceGetHttpRequestMethodForHealthCheck forces GET for health check probes instead of HEAD.",
              "type": "boolean"
            },
            "eventRetentionTime": {
              "description": "EventRetentionTime defines how long events are retained for this subscriber.",
              "type": "string"
            },
            "payload": {
              "default": "Data",
              "description": "Payload defines the event payload format.",
              "enum": [
                "Data",
                "DataRef"
              ],
              "type": "string"
            },
            "redeliveriesPerSecond": {
              "description": "RedeliveriesPerSecond limits the rate of event redeliveries.",
              "type": "integer"
            },
            "retryableStatusCodes": {
              "description": "RetryableStatusCodes defines HTTP status codes that should trigger a retry.",
              "items": {
                "type": "integer"
              },
              "type": "array"
            },
            "type": {
              "default": "Callback",
              "description": "Type defines the delivery mechanism.",
              "enum": [
                "Callback",
                "ServerSentEvent"
              ],
              "type": "string"
            }
          },
          "required": [
            "payload",
            "type"
          ],
          "type": "object",
          "x-kubernetes-validations": [
            {
              "message": "callback is required for deliveryType 'Callback' and must not be set for 'ServerSentEvent'",
              "rule": "self.type == 'Callback' ? self.callback != \"\" : !has(self.callback)"
            }
          ]
        },
        "publisher": {
          "description": "Publisher references the Publisher CR that this subscriber subscribes to.\nThe Subscriber controller resolves the Publisher at runtime to obtain\nEventType, PublisherId, AdditionalPublisherIds, and EventStore details.",
          "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"
        },
        "publisherTrigger": {
          "description": "PublisherTrigger defines publisher-side filtering criteria for event delivery.",
          "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"
        },
        "subscriberId": {
          "description": "SubscriberId is the unique identifier for this subscriber in the configuration backend.\nTypically derived from the consuming application's identifier.",
          "minLength": 1,
          "type": "string"
        },
        "trigger": {
          "description": "Trigger defines subscriber-side filtering criteria for event delivery.",
          "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": [
        "delivery",
        "publisher",
        "subscriberId"
      ],
      "type": "object"
    },
    "status": {
      "description": "SubscriberStatus defines the observed state of Subscriber.",
      "properties": {
        "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"
        },
        "subscriptionId": {
          "description": "SubscriptionId is the self-assigned subscription identifier.\nPopulated after the subscription is successfully registered with the configuration backend.",
          "type": "string"
        }
      },
      "type": "object"
    }
  },
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://telekom.github.io/controlplane/schemas/pubsub.cp.ei.telekom.de/subscriber_v1.json",
  "title": "Subscriber",
  "required": [
    "apiVersion",
    "kind",
    "metadata"
  ]
}
