{
  "description": "AtlasStreamConnection is the Schema for the atlasstreamconnections API",
  "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"
    },
    "metadata": {
      "type": "object"
    },
    "spec": {
      "description": "AtlasStreamConnectionSpec defines the target state of AtlasStreamConnection.",
      "properties": {
        "clusterConfig": {
          "description": "The configuration to be used to connect to an Atlas Cluster.",
          "properties": {
            "name": {
              "description": "Name of the cluster configured for this connection.",
              "type": "string"
            },
            "role": {
              "description": "The name of a built-in or Custom DB Role to connect to an Atlas Cluster.",
              "properties": {
                "name": {
                  "description": "The name of the role to use. Can be a built-in role or a custom role.",
                  "type": "string"
                },
                "type": {
                  "description": "Type of the DB role. Can be either BUILT_IN or CUSTOM.",
                  "enum": [
                    "BUILT_IN",
                    "CUSTOM"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "name",
                "type"
              ],
              "type": "object",
              "additionalProperties": false
            }
          },
          "required": [
            "name",
            "role"
          ],
          "type": "object",
          "additionalProperties": false
        },
        "kafkaConfig": {
          "description": "The configuration to be used to connect to a Kafka Cluster.",
          "properties": {
            "authentication": {
              "description": "User credentials required to connect to a Kafka Cluster. Includes the authentication type, as well as the parameters for that authentication mode.",
              "properties": {
                "credentials": {
                  "description": "Reference to the secret containing th Username and Password of the account to connect to the Kafka cluster.",
                  "properties": {
                    "name": {
                      "description": "Name of the Kubernetes Resource",
                      "type": "string"
                    },
                    "namespace": {
                      "description": "Namespace of the Kubernetes Resource",
                      "type": "string"
                    }
                  },
                  "required": [
                    "name"
                  ],
                  "type": "object",
                  "additionalProperties": false
                },
                "mechanism": {
                  "description": "Style of authentication. Can be one of PLAIN, SCRAM-256, or SCRAM-512.",
                  "enum": [
                    "PLAIN",
                    "SCRAM-256",
                    "SCRAM-512"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "credentials",
                "mechanism"
              ],
              "type": "object",
              "additionalProperties": false
            },
            "bootstrapServers": {
              "description": "Comma separated list of server addresses",
              "type": "string"
            },
            "config": {
              "additionalProperties": {
                "type": "string"
              },
              "description": "A map of Kafka key-value pairs for optional configuration. This is a flat object, and keys can have '.' characters.",
              "type": "object"
            },
            "security": {
              "description": "Properties for the secure transport connection to Kafka. For SSL, this can include the trusted certificate to use.",
              "properties": {
                "certificate": {
                  "description": "A trusted, public x509 certificate for connecting to Kafka over SSL.",
                  "properties": {
                    "name": {
                      "description": "Name of the Kubernetes Resource",
                      "type": "string"
                    },
                    "namespace": {
                      "description": "Namespace of the Kubernetes Resource",
                      "type": "string"
                    }
                  },
                  "required": [
                    "name"
                  ],
                  "type": "object",
                  "additionalProperties": false
                },
                "protocol": {
                  "description": "Describes the transport type. Can be either PLAINTEXT or SSL.",
                  "enum": [
                    "PLAINTEXT",
                    "SSL"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "protocol"
              ],
              "type": "object",
              "additionalProperties": false
            }
          },
          "required": [
            "authentication",
            "bootstrapServers",
            "security"
          ],
          "type": "object",
          "additionalProperties": false
        },
        "name": {
          "description": "Human-readable label that uniquely identifies the stream connection.",
          "type": "string"
        },
        "type": {
          "description": "Type of the connection. Can be either Cluster or Kafka.",
          "enum": [
            "Kafka",
            "Cluster",
            "Sample"
          ],
          "type": "string"
        }
      },
      "required": [
        "name",
        "type"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "status": {
      "description": "AtlasStreamConnectionStatus defines the observed state of AtlasStreamConnection.",
      "properties": {
        "conditions": {
          "description": "Conditions is the list of statuses showing the current state of the Atlas Custom Resource",
          "items": {
            "description": "Condition describes the state of an Atlas Custom Resource at a certain point.",
            "properties": {
              "lastTransitionTime": {
                "description": "Last time the condition transitioned from one status to another.\nRepresented in ISO 8601 format.",
                "format": "date-time",
                "type": "string"
              },
              "message": {
                "description": "A message providing details about the transition.",
                "type": "string"
              },
              "reason": {
                "description": "The reason for the condition's last transition.",
                "type": "string"
              },
              "status": {
                "description": "Status of the condition; one of True, False, Unknown.",
                "type": "string"
              },
              "type": {
                "description": "Type of Atlas Custom Resource condition.",
                "type": "string"
              }
            },
            "required": [
              "status",
              "type"
            ],
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        },
        "instances": {
          "description": "List of instances using the connection configuration",
          "items": {
            "description": "ResourceRefNamespaced is a reference to a Kubernetes Resource that allows to configure the namespace",
            "properties": {
              "name": {
                "description": "Name of the Kubernetes Resource",
                "type": "string"
              },
              "namespace": {
                "description": "Namespace of the Kubernetes Resource",
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        },
        "observedGeneration": {
          "description": "ObservedGeneration indicates the generation of the resource specification of which the Atlas Operator is aware.\nThe Atlas Operator updates this field to the value of 'metadata.generation' as soon as it starts reconciliation of the resource.",
          "format": "int64",
          "type": "integer"
        }
      },
      "required": [
        "conditions"
      ],
      "type": "object",
      "additionalProperties": false
    }
  },
  "type": "object"
}
