{
  "description": "DocumentAIProcessorVersion is the Schema for the DocumentAIProcessorVersion API",
  "properties": {
    "apiVersion": {
      "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More 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. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
      "type": "string"
    },
    "metadata": {
      "type": "object"
    },
    "spec": {
      "description": "DocumentAIProcessorVersionSpec defines the desired state of DocumentAIProcessorVersion",
      "properties": {
        "deprecationInfo": {
          "description": "If set, information about the eventual deprecation of this version.",
          "properties": {
            "deprecationTime": {
              "description": "The time at which this processor version will be deprecated.",
              "type": "string"
            },
            "replacementProcessorVersion": {
              "description": "If set, the processor version that will be used as a replacement.",
              "type": "string"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "displayName": {
          "description": "The display name of the processor version.",
          "type": "string"
        },
        "kmsKeyNameRef": {
          "description": "The KMS key name used for encryption.",
          "oneOf": [
            {
              "not": {
                "required": [
                  "external"
                ]
              },
              "required": [
                "name"
              ]
            },
            {
              "not": {
                "anyOf": [
                  {
                    "required": [
                      "name"
                    ]
                  },
                  {
                    "required": [
                      "namespace"
                    ]
                  }
                ]
              },
              "required": [
                "external"
              ]
            }
          ],
          "properties": {
            "external": {
              "description": "A reference to an externally managed KMSCryptoKey. Should be in the format `projects/[kms_project_id]/locations/[region]/keyRings/[key_ring_id]/cryptoKeys/[key]`.",
              "type": "string"
            },
            "name": {
              "description": "The `name` of a `KMSCryptoKey` resource.",
              "type": "string"
            },
            "namespace": {
              "description": "The `namespace` of a `KMSCryptoKey` resource.",
              "type": "string"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "kmsKeyVersionNameRef": {
          "description": "The KMS key version with which data is encrypted.",
          "properties": {
            "external": {
              "description": "A reference to an externally managed cryptoKeyVersion. Should be in the format `projects/{{kms_project_id}}/locations/{{region}}/keyRings/{{key_ring_id}}/cryptoKeys/{{key}}/cryptoKeyVersions/{{version}}`.",
              "type": "string"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "processorRef": {
          "description": "ProcessorRef defines the resource reference to DocumentAIProcessor, which \"External\" field holds the GCP identifier for the KRM object.",
          "oneOf": [
            {
              "not": {
                "required": [
                  "external"
                ]
              },
              "required": [
                "name"
              ]
            },
            {
              "not": {
                "anyOf": [
                  {
                    "required": [
                      "name"
                    ]
                  },
                  {
                    "required": [
                      "namespace"
                    ]
                  }
                ]
              },
              "required": [
                "external"
              ]
            }
          ],
          "properties": {
            "external": {
              "description": "A reference to an externally managed DocumentAIProcessor resource. Should be in the format \"projects/{{projectID}}/locations/{{location}}/processors/{{processorID}}\".",
              "type": "string"
            },
            "name": {
              "description": "The name of a DocumentAIProcessor resource.",
              "type": "string"
            },
            "namespace": {
              "description": "The namespace of a DocumentAIProcessor resource.",
              "type": "string"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "resourceID": {
          "description": "The DocumentAIProcessorVersion name. If not given, the metadata.name will be used.",
          "type": "string"
        }
      },
      "required": [
        "processorRef"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "status": {
      "description": "DocumentAIProcessorVersionStatus defines the config connector machine state of DocumentAIProcessorVersion",
      "properties": {
        "conditions": {
          "description": "Conditions represent the latest available observations of the object's current state.",
          "items": {
            "properties": {
              "lastTransitionTime": {
                "description": "Last time the condition transitioned from one status to another.",
                "type": "string"
              },
              "message": {
                "description": "Human-readable message indicating details about last transition.",
                "type": "string"
              },
              "reason": {
                "description": "Unique, one-word, CamelCase reason for the condition's last transition.",
                "type": "string"
              },
              "status": {
                "description": "Status is the status of the condition. Can be True, False, Unknown.",
                "type": "string"
              },
              "type": {
                "description": "Type is the type of the condition.",
                "type": "string"
              }
            },
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        },
        "externalRef": {
          "description": "A unique specifier for the DocumentAI resource in GCP.",
          "type": "string"
        },
        "observedGeneration": {
          "description": "ObservedGeneration is the generation of the resource that was most recently observed by the Config Connector controller. If this is equal to metadata.generation, then that means that the current reported status reflects the most recent desired state of the resource.",
          "format": "int64",
          "type": "integer"
        },
        "observedState": {
          "description": "ObservedState is the state of the resource as most recently observed in GCP.",
          "properties": {
            "create_time": {
              "description": "The time the processor version was created.",
              "type": "string"
            },
            "document_schema": {
              "description": "The schema of the processor version. Describes the output.",
              "properties": {
                "description": {
                  "description": "Description of the schema.",
                  "type": "string"
                },
                "displayName": {
                  "description": "Display name to show to users.",
                  "type": "string"
                },
                "entityTypes": {
                  "description": "Entity types of the schema.",
                  "items": {
                    "properties": {
                      "baseTypes": {
                        "description": "The entity type that this type is derived from.  For now, one and only one should be set.",
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "displayName": {
                        "description": "User defined name for the type.",
                        "type": "string"
                      },
                      "enumValues": {
                        "description": "If specified, lists all the possible values for this entity.  This should not be more than a handful of values.  If the number of values is >10 or could change frequently use the `EntityType.value_ontology` field and specify a list of all possible values in a value ontology file.",
                        "properties": {
                          "values": {
                            "description": "The individual values that this enum values type can include.",
                            "items": {
                              "type": "string"
                            },
                            "type": "array"
                          }
                        },
                        "type": "object",
                        "additionalProperties": false
                      },
                      "name": {
                        "description": "Name of the type. It must be unique within the schema file and\n cannot be a \"Common Type\".  The following naming conventions are used:\n\n - Use `snake_casing`.\n - Name matching is case-sensitive.\n - Maximum 64 characters.\n - Must start with a letter.\n - Allowed characters: ASCII letters `[a-z0-9_-]`.  (For backward\n   compatibility internal infrastructure and tooling can handle any ascii\n   character.)\n - The `/` is sometimes used to denote a property of a type.  For example\n   `line_item/amount`.  This convention is deprecated, but will still be\n   honored for backward compatibility.",
                        "type": "string"
                      },
                      "properties": {
                        "description": "Description the nested structure, or composition of an entity.",
                        "items": {
                          "properties": {
                            "displayName": {
                              "description": "User defined name for the property.",
                              "type": "string"
                            },
                            "method": {
                              "description": "Specifies how the entity's value is obtained.",
                              "type": "string"
                            },
                            "name": {
                              "description": "The name of the property.  Follows the same guidelines as the EntityType name.",
                              "type": "string"
                            },
                            "occurrenceType": {
                              "description": "Occurrence type limits the number of instances an entity type appears in the document.",
                              "type": "string"
                            },
                            "valueType": {
                              "description": "A reference to the value type of the property.  This type is subject to the same conventions as the `Entity.base_types` field.",
                              "type": "string"
                            }
                          },
                          "type": "object",
                          "additionalProperties": false
                        },
                        "type": "array"
                      },
                      "additionalProperties": false
                    },
                    "type": "object",
                    "additionalProperties": false
                  },
                  "type": "array"
                },
                "metadata": {
                  "description": "Metadata of the schema.",
                  "properties": {
                    "documentAllowMultipleLabels": {
                      "description": "If true, on a given page, there can be multiple `document` annotations covering it.",
                      "type": "boolean"
                    },
                    "documentSplitter": {
                      "description": "If true, a `document` entity type can be applied to subdocument (splitting). Otherwise, it can only be applied to the entire document (classification).",
                      "type": "boolean"
                    },
                    "prefixedNamingOnProperties": {
                      "description": "If set, all the nested entities must be prefixed with the parents.",
                      "type": "boolean"
                    },
                    "skipNamingValidation": {
                      "description": "If set, we will skip the naming format validation in the schema. So the string values in `DocumentSchema.EntityType.name` and `DocumentSchema.EntityType.Property.name` will not be checked.",
                      "type": "boolean"
                    }
                  },
                  "type": "object",
                  "additionalProperties": false
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "gen_ai_model_info": {
              "description": "Output only. Information about Generative AI model-based processor versions.",
              "properties": {
                "customGenAiModelInfo": {
                  "description": "Information for a custom Generative AI model created by the user.",
                  "properties": {
                    "baseProcessorVersionID": {
                      "description": "The base processor version ID for the custom model.",
                      "type": "string"
                    },
                    "customModelType": {
                      "description": "The type of custom model created by the user.",
                      "type": "string"
                    }
                  },
                  "type": "object",
                  "additionalProperties": false
                },
                "foundationGenAiModelInfo": {
                  "description": "Information for a pretrained Google-managed foundation model.",
                  "properties": {
                    "finetuningAllowed": {
                      "description": "Whether finetuning is allowed for this base processor version.",
                      "type": "boolean"
                    },
                    "minTrainLabeledDocuments": {
                      "description": "The minimum number of labeled documents in the training dataset required for finetuning.",
                      "format": "int32",
                      "type": "integer"
                    }
                  },
                  "type": "object",
                  "additionalProperties": false
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "google_managed": {
              "description": "Output only. Denotes that this `ProcessorVersion` is managed by Google.",
              "type": "boolean"
            },
            "latest_evaluation": {
              "description": "The most recently invoked evaluation for the processor version.",
              "properties": {
                "aggregateMetrics": {
                  "description": "An aggregate of the statistics for the evaluation with fuzzy matching on.",
                  "properties": {
                    "f1Score": {
                      "description": "The calculated f1 score.",
                      "type": "number"
                    },
                    "falseNegativesCount": {
                      "description": "The amount of false negatives.",
                      "format": "int32",
                      "type": "integer"
                    },
                    "falsePositivesCount": {
                      "description": "The amount of false positives.",
                      "format": "int32",
                      "type": "integer"
                    },
                    "groundTruthDocumentCount": {
                      "description": "The amount of documents with a ground truth occurrence.",
                      "format": "int32",
                      "type": "integer"
                    },
                    "groundTruthOccurrencesCount": {
                      "description": "The amount of occurrences in ground truth documents.",
                      "format": "int32",
                      "type": "integer"
                    },
                    "precision": {
                      "description": "The calculated precision.",
                      "type": "number"
                    },
                    "predictedDocumentCount": {
                      "description": "The amount of documents with a predicted occurrence.",
                      "format": "int32",
                      "type": "integer"
                    },
                    "predictedOccurrencesCount": {
                      "description": "The amount of occurrences in predicted documents.",
                      "format": "int32",
                      "type": "integer"
                    },
                    "recall": {
                      "description": "The calculated recall.",
                      "type": "number"
                    },
                    "totalDocumentsCount": {
                      "description": "The amount of documents that had an occurrence of this label.",
                      "format": "int32",
                      "type": "integer"
                    },
                    "truePositivesCount": {
                      "description": "The amount of true positives.",
                      "format": "int32",
                      "type": "integer"
                    }
                  },
                  "type": "object",
                  "additionalProperties": false
                },
                "aggregateMetricsExact": {
                  "description": "An aggregate of the statistics for the evaluation with fuzzy matching off.",
                  "properties": {
                    "f1Score": {
                      "description": "The calculated f1 score.",
                      "type": "number"
                    },
                    "falseNegativesCount": {
                      "description": "The amount of false negatives.",
                      "format": "int32",
                      "type": "integer"
                    },
                    "falsePositivesCount": {
                      "description": "The amount of false positives.",
                      "format": "int32",
                      "type": "integer"
                    },
                    "groundTruthDocumentCount": {
                      "description": "The amount of documents with a ground truth occurrence.",
                      "format": "int32",
                      "type": "integer"
                    },
                    "groundTruthOccurrencesCount": {
                      "description": "The amount of occurrences in ground truth documents.",
                      "format": "int32",
                      "type": "integer"
                    },
                    "precision": {
                      "description": "The calculated precision.",
                      "type": "number"
                    },
                    "predictedDocumentCount": {
                      "description": "The amount of documents with a predicted occurrence.",
                      "format": "int32",
                      "type": "integer"
                    },
                    "predictedOccurrencesCount": {
                      "description": "The amount of occurrences in predicted documents.",
                      "format": "int32",
                      "type": "integer"
                    },
                    "recall": {
                      "description": "The calculated recall.",
                      "type": "number"
                    },
                    "totalDocumentsCount": {
                      "description": "The amount of documents that had an occurrence of this label.",
                      "format": "int32",
                      "type": "integer"
                    },
                    "truePositivesCount": {
                      "description": "The amount of true positives.",
                      "format": "int32",
                      "type": "integer"
                    }
                  },
                  "type": "object",
                  "additionalProperties": false
                },
                "evaluation": {
                  "description": "The resource name of the evaluation.",
                  "type": "string"
                },
                "operation": {
                  "description": "The resource name of the Long Running Operation for the evaluation.",
                  "type": "string"
                }
              },
              "type": "object",
              "additionalProperties": false
            },
            "model_type": {
              "description": "Output only. The model type of this processor version.",
              "type": "string"
            },
            "satisfies_pzi": {
              "description": "Output only. Reserved for future use.",
              "type": "boolean"
            },
            "satisfies_pzs": {
              "description": "Output only. Reserved for future use.",
              "type": "boolean"
            },
            "state": {
              "description": "Output only. The state of the processor version.",
              "type": "string"
            }
          },
          "type": "object",
          "additionalProperties": false
        }
      },
      "type": "object",
      "additionalProperties": false
    }
  },
  "required": [
    "spec"
  ],
  "type": "object"
}
