apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: servicedomainbindings.mercury.redhat.io
spec:
  group: mercury.redhat.io
  names:
    kind: ServiceDomainBinding
    plural: servicedomainbindings
  scope: Namespaced
  versions:
    - name: v1alpha1
      served: true
      storage: true
      schema:
        openAPIV3Schema:
          type: object
          properties:
            spec:
              type: object
              properties:
                exposedScopes:
                  type: array
                  items:
                    type: object
                    required:
                      - scopeRef
                      - action
                    properties:
                      scopeRef:
                        type: string
                      action:
                        type: string
                        enum:
                          - query
                          - command
                bindings:
                  type: array
                  items:
                    type: object
                    required:
                      - serviceDomain
                      - scopeRef
                      - action
                    properties:
                      serviceDomain:
                        type: string
                      scopeRef:
                        type: string
                      action:
                        type: string
                        enum:
                          - query
                          - command
                subscriptions:
                  type: array
                  items:
                    type: object
                    required:
                      - serviceDomain
                      - events
                    properties:
                      serviceDomain:
                        type: string
                      events:
                        type: array
                        items:
                          type: string

