{
  "description": "NotificationChannel is the Schema for the notificationchannels API",
  "properties": {
    "apiVersion": {
      "type": "string",
      "description": "Must be \"notification.cp.ei.telekom.de/v1\".",
      "const": "notification.cp.ei.telekom.de/v1"
    },
    "kind": {
      "type": "string",
      "description": "Must be \"NotificationChannel\".",
      "const": "NotificationChannel"
    },
    "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": "spec defines the desired state of NotificationChannel",
      "properties": {
        "email": {
          "description": "Mail configuration, required if Type is Mail",
          "properties": {
            "authentication": {
              "description": "Authentication configuration",
              "properties": {
                "none": {
                  "description": "NoneAuth represents no authentication",
                  "type": "object"
                },
                "oauth2": {
                  "properties": {
                    "clientId": {
                      "description": "ClientID is the OAuth2 client ID",
                      "type": "string"
                    },
                    "clientSecret": {
                      "description": "ClientSecret is the OAuth2 client secret",
                      "type": "string"
                    },
                    "scopes": {
                      "description": "Scopes are the OAuth2 scopes",
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "tokenUrl": {
                      "description": "TokenURL is the URL to obtain the OAuth2 token",
                      "pattern": "^https?://[^\\s/$.?#].[^\\s]*$",
                      "type": "string"
                    }
                  },
                  "required": [
                    "clientId",
                    "clientSecret",
                    "tokenUrl"
                  ],
                  "type": "object"
                }
              },
              "type": "object"
            },
            "from": {
              "description": "From email address",
              "format": "email",
              "type": "string"
            },
            "recipients": {
              "description": "Recipients of this email",
              "items": {
                "format": "email",
                "type": "string"
              },
              "type": "array"
            }
          },
          "required": [
            "recipients"
          ],
          "type": "object"
        },
        "ignore": {
          "description": "A set of purposes this channel ignores",
          "items": {
            "type": "string"
          },
          "maxItems": 100,
          "type": "array",
          "x-kubernetes-list-type": "set"
        },
        "msTeams": {
          "description": "Chat configuration, required if Type is Chat",
          "properties": {
            "authentication": {
              "description": "Authentication configuration",
              "properties": {
                "none": {
                  "description": "NoneAuth represents no authentication",
                  "type": "object"
                },
                "oauth2": {
                  "properties": {
                    "clientId": {
                      "description": "ClientID is the OAuth2 client ID",
                      "type": "string"
                    },
                    "clientSecret": {
                      "description": "ClientSecret is the OAuth2 client secret",
                      "type": "string"
                    },
                    "scopes": {
                      "description": "Scopes are the OAuth2 scopes",
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "tokenUrl": {
                      "description": "TokenURL is the URL to obtain the OAuth2 token",
                      "pattern": "^https?://[^\\s/$.?#].[^\\s]*$",
                      "type": "string"
                    }
                  },
                  "required": [
                    "clientId",
                    "clientSecret",
                    "tokenUrl"
                  ],
                  "type": "object"
                }
              },
              "type": "object"
            },
            "webhookUrl": {
              "description": "Webhook URL for the Microsoft Teams channel",
              "format": "uri",
              "type": "string"
            }
          },
          "required": [
            "webhookUrl"
          ],
          "type": "object"
        },
        "webhook": {
          "description": "Callback configuration, required if Type is Callback",
          "properties": {
            "authentication": {
              "description": "Authentication configuration",
              "properties": {
                "none": {
                  "description": "NoneAuth represents no authentication",
                  "type": "object"
                },
                "oauth2": {
                  "properties": {
                    "clientId": {
                      "description": "ClientID is the OAuth2 client ID",
                      "type": "string"
                    },
                    "clientSecret": {
                      "description": "ClientSecret is the OAuth2 client secret",
                      "type": "string"
                    },
                    "scopes": {
                      "description": "Scopes are the OAuth2 scopes",
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "tokenUrl": {
                      "description": "TokenURL is the URL to obtain the OAuth2 token",
                      "pattern": "^https?://[^\\s/$.?#].[^\\s]*$",
                      "type": "string"
                    }
                  },
                  "required": [
                    "clientId",
                    "clientSecret",
                    "tokenUrl"
                  ],
                  "type": "object"
                }
              },
              "type": "object"
            },
            "headers": {
              "additionalProperties": {
                "type": "string"
              },
              "description": "Headers to include in the request",
              "type": "object"
            },
            "method": {
              "default": "POST",
              "description": "HTTP method to use",
              "enum": [
                "POST"
              ],
              "type": "string"
            },
            "url": {
              "description": "URL of the webhook endpoint",
              "pattern": "^https?://[^\\s/$.?#].[^\\s]*$",
              "type": "string"
            }
          },
          "required": [
            "method",
            "url"
          ],
          "type": "object"
        }
      },
      "type": "object",
      "x-kubernetes-validations": [
        {
          "message": "Exactly one of email, msTeams, webhook must be specified",
          "rule": "(has(self.email) ? 1 : 0) + (has(self.msTeams) ? 1 : 0) + (has(self.webhook) ? 1 : 0) == 1"
        }
      ]
    },
    "status": {
      "description": "status defines the observed state of NotificationChannel",
      "properties": {
        "conditions": {
          "description": "Conditions represent the latest available observations of the Rover's state",
          "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"
        }
      },
      "type": "object"
    }
  },
  "required": [
    "spec",
    "apiVersion",
    "kind",
    "metadata"
  ],
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://telekom.github.io/controlplane/schemas/notification.cp.ei.telekom.de/notificationchannel_v1.json",
  "title": "NotificationChannel"
}
