{
  "description": "ApprovalRequest is the Schema for the approvalrequests API",
  "properties": {
    "apiVersion": {
      "type": "string",
      "description": "Must be \"approval.cp.ei.telekom.de/v1\".",
      "const": "approval.cp.ei.telekom.de/v1"
    },
    "kind": {
      "type": "string",
      "description": "Must be \"ApprovalRequest\".",
      "const": "ApprovalRequest"
    },
    "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": "ApprovalRequestSpec defines the desired state of ApprovalRequest",
      "properties": {
        "action": {
          "default": "unknown",
          "description": "Action defines the action that is requested to be performed on the target object",
          "type": "string"
        },
        "decider": {
          "description": "Decider contains the information about the entity that owns the requested object",
          "properties": {
            "applicationRef": {
              "description": "ApplicationRef is a reference to the application that decides on the approval request",
              "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"
            },
            "teamEmail": {
              "description": "TeamEmail is the email address of the team that decides on the approval request",
              "type": "string"
            },
            "teamName": {
              "description": "TeamName is the name of the team that decides on the approval request",
              "type": "string"
            }
          },
          "type": "object"
        },
        "decisions": {
          "default": [],
          "description": "Decisions contains information about who or what changed this approval",
          "items": {
            "properties": {
              "comment": {
                "description": "Comment provided by the person making the decision",
                "type": "string"
              },
              "email": {
                "description": "Email of the person making the decision",
                "type": "string"
              },
              "name": {
                "description": "Name of the person making the decision",
                "type": "string"
              },
              "resultingState": {
                "description": "ResultingState is the state the resource transitioned to as a result of this decision.\nAutomatically set by the defaulting webhook to match Spec.State when not provided.",
                "enum": [
                  "Pending",
                  "Semigranted",
                  "Granted",
                  "Rejected",
                  "Suspended",
                  "Expired"
                ],
                "type": "string"
              },
              "timestamp": {
                "description": "Timestamp of when the decision was made",
                "format": "date-time",
                "type": "string"
              }
            },
            "required": [
              "name",
              "resultingState"
            ],
            "type": "object"
          },
          "type": "array"
        },
        "requester": {
          "description": "Requester contains the information about the entity that is requesting access",
          "properties": {
            "applicationRef": {
              "description": "ApplicationRef is a reference to the application that is requesting access",
              "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"
            },
            "properties": {
              "description": "Properties contains detailed information about the access that was requested",
              "type": "object",
              "x-kubernetes-preserve-unknown-fields": true
            },
            "reason": {
              "description": "Reason is the reason for requesting access",
              "type": "string"
            },
            "teamEmail": {
              "description": "TeamEmail is the email address of the team requesting access",
              "type": "string"
            },
            "teamName": {
              "description": "TeamName is the name of the team requesting access",
              "type": "string"
            }
          },
          "required": [
            "reason",
            "teamEmail",
            "teamName"
          ],
          "type": "object"
        },
        "state": {
          "default": "Pending",
          "description": "State defines the state of the approval",
          "enum": [
            "Pending",
            "Granted",
            "Semigranted",
            "Rejected"
          ],
          "type": "string"
        },
        "strategy": {
          "default": "Auto",
          "description": "Strategy defines the strategy that was used to approve the request",
          "enum": [
            "Auto",
            "Simple",
            "FourEyes"
          ],
          "type": "string"
        },
        "target": {
          "description": "Target contains the reference to the object that wants to access another object",
          "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"
        }
      },
      "required": [
        "action",
        "decisions",
        "requester",
        "state",
        "strategy",
        "target"
      ],
      "type": "object"
    },
    "status": {
      "description": "ApprovalRequestStatus defines the observed state of ApprovalRequest",
      "properties": {
        "approval": {
          "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"
        },
        "availableTransitions": {
          "items": {
            "properties": {
              "action": {
                "type": "string"
              },
              "to": {
                "type": "string"
              }
            },
            "required": [
              "action",
              "to"
            ],
            "type": "object"
          },
          "type": "array"
        },
        "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"
        },
        "lastState": {
          "default": "Pending",
          "description": "LastState defines the last state of the approval request",
          "enum": [
            "Pending",
            "Granted",
            "Semigranted",
            "Rejected"
          ],
          "type": "string"
        },
        "notificationRefs": {
          "description": "NotificationRefs is a reference to the notifications that were sent for this approval request",
          "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"
        }
      },
      "required": [
        "approval"
      ],
      "type": "object"
    }
  },
  "type": "object",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://telekom.github.io/controlplane/schemas/approval.cp.ei.telekom.de/approvalrequest_v1.json",
  "title": "ApprovalRequest",
  "required": [
    "apiVersion",
    "kind",
    "metadata"
  ]
}
