{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$ref": "#/definitions/strmprivacy.api.entities.v1.Stream",
  "definitions": {
    "strmprivacy.api.entities.v1.ConsentLevelType": {
      "enum": [
        "CONSENT_LEVEL_TYPE_UNSPECIFIED",
        0,
        "CUMULATIVE",
        1,
        "GRANULAR",
        2
      ],
      "description": "Consent level is meant to interpret the consent-levels of an event for decryption purposes only.\n\nCumulative means that the highest consent-level in an event must be greater than or equal to the single requested level\nfor the decrypted stream.\n\nGranular means that the set of consent-levels in an event must enclose the set of requested event levels for the\ndecrypted stream.",
      "markdownEnumDescriptions": [
        "(or 0) ",
        "(or \"CONSENT_LEVEL_TYPE_UNSPECIFIED\") ",
        "(or 1) ",
        "(or \"CUMULATIVE\") ",
        "(or 2) ",
        "(or \"GRANULAR\") "
      ]
    },
    "strmprivacy.api.entities.v1.Credentials": {
      "type": "object",
      "properties": {
        "billingId": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.Credentials/definitions/billing_id"
        },
        "clientId": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.Credentials/definitions/client_id"
        },
        "clientSecret": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.Credentials/definitions/client_secret"
        },
        "projectId": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.Credentials/definitions/project_id"
        }
      },
      "patternProperties": {
        "^billing_id$": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.Credentials/definitions/billing_id"
        },
        "^client_id$": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.Credentials/definitions/client_id"
        },
        "^client_secret$": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.Credentials/definitions/client_secret"
        },
        "^project_id$": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.Credentials/definitions/project_id"
        }
      },
      "additionalProperties": {
        "title": "Unknown field"
      },
      "definitions": {
        "billing_id": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "string billing_id = 1;",
          "default": ""
        },
        "client_id": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "string client_id = 2;",
          "default": ""
        },
        "client_secret": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "string client_secret = 3;",
          "description": "as this property is secret, it is not always returned",
          "default": ""
        },
        "project_id": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "string project_id = 4;",
          "default": ""
        }
      },
      "description": "Credentials to produce to the event-gateway, or to consume from egress."
    },
    "strmprivacy.api.entities.v1.Limits": {
      "type": "object",
      "properties": {
        "eventCount": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.Limits/definitions/event_count"
        },
        "eventRate": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.Limits/definitions/event_rate"
        }
      },
      "patternProperties": {
        "^event_count$": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.Limits/definitions/event_count"
        },
        "^event_rate$": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.Limits/definitions/event_rate"
        }
      },
      "additionalProperties": {
        "title": "Unknown field"
      },
      "definitions": {
        "event_count": {
          "oneOf": [
            {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "int64 event_count = 2;",
          "description": "filled in from customer profile",
          "default": 0
        },
        "event_rate": {
          "oneOf": [
            {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "int64 event_rate = 1;",
          "description": "filled in from customer profile",
          "default": 0
        }
      }
    },
    "strmprivacy.api.entities.v1.MaskedFields": {
      "type": "object",
      "properties": {
        "fieldPatterns": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.MaskedFields/definitions/field_patterns"
        },
        "hashType": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.MaskedFields/definitions/hash_type"
        },
        "seed": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.MaskedFields/definitions/seed"
        }
      },
      "patternProperties": {
        "^field_patterns$": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.MaskedFields/definitions/field_patterns"
        },
        "^hash_type$": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.MaskedFields/definitions/hash_type"
        }
      },
      "additionalProperties": {
        "title": "Unknown field"
      },
      "definitions": {
        "field_patterns": {
          "oneOf": [
            {
              "type": "object",
              "additionalProperties": {
                "oneOf": [
                  {
                    "$ref": "#/definitions/strmprivacy.api.entities.v1.MaskedFields.PatternList"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "strmprivacy.api.entities.v1.MaskedFields.PatternList",
                "default": {
                  
                }
              }
            },
            {
              "type": "null"
            }
          ],
          "title": "map<string, strmprivacy.api.entities.v1.MaskedFields.PatternList> field_patterns = 3;",
          "description": "map of event-contract-ref vs field patterns\n\nconstraints:\n data-contract-refs should be existing data contracts\n field_patterns should be valid values (checked by events-core)\n the field_patterns list should have no duplicates.",
          "default": {
            
          }
        },
        "hash_type": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "string hash_type = 1;",
          "description": "Default Murmurhash3 if empty",
          "default": ""
        },
        "seed": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "string seed = 2;",
          "description": "hashing seed",
          "default": ""
        }
      }
    },
    "strmprivacy.api.entities.v1.MaskedFields.PatternList": {
      "type": "object",
      "properties": {
        "fieldPatterns": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.MaskedFields.PatternList/definitions/field_patterns"
        }
      },
      "patternProperties": {
        "^field_patterns$": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.MaskedFields.PatternList/definitions/field_patterns"
        }
      },
      "additionalProperties": {
        "title": "Unknown field"
      },
      "definitions": {
        "field_patterns": {
          "oneOf": [
            {
              "type": "array",
              "items": {
                "type": "string",
                "title": "string"
              }
            },
            {
              "type": "null"
            }
          ],
          "title": "repeated string field_patterns = 1;",
          "default": null
        }
      }
    },
    "strmprivacy.api.entities.v1.Stream": {
      "type": "object",
      "properties": {
        "enabled": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.Stream/definitions/enabled"
        },
        "maskedFields": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.Stream/definitions/masked_fields"
        },
        "kafkaTopic": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.Stream/definitions/kafka_topic"
        },
        "description": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.Stream/definitions/description"
        },
        "limits": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.Stream/definitions/limits"
        },
        "ref": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.Stream/definitions/ref"
        },
        "tags": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.Stream/definitions/tags"
        },
        "consentLevelType": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.Stream/definitions/consent_level_type"
        },
        "linkedStream": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.Stream/definitions/linked_stream"
        },
        "policyId": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.Stream/definitions/policy_id"
        },
        "credentials": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.Stream/definitions/credentials"
        },
        "consentLevels": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.Stream/definitions/consent_levels"
        }
      },
      "patternProperties": {
        "^consent_level_type$": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.Stream/definitions/consent_level_type"
        },
        "^consent_levels$": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.Stream/definitions/consent_levels"
        },
        "^kafka_topic$": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.Stream/definitions/kafka_topic"
        },
        "^linked_stream$": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.Stream/definitions/linked_stream"
        },
        "^masked_fields$": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.Stream/definitions/masked_fields"
        },
        "^policy_id$": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.Stream/definitions/policy_id"
        }
      },
      "additionalProperties": {
        "title": "Unknown field"
      },
      "definitions": {
        "enabled": {
          "oneOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "bool enabled = 5;",
          "description": "whether or not this stream is enabled.",
          "default": false
        },
        "consent_levels": {
          "oneOf": [
            {
              "type": "array",
              "items": {
                "oneOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "integer"
                  }
                ],
                "title": "int32"
              }
            },
            {
              "type": "null"
            }
          ],
          "title": "repeated int32 consent_levels = 3;",
          "description": "consent levels for derived streams\n\nconstraints:\nif consent_level_type ==  CUMULATIVE then\nsize = 1\nendif",
          "default": null
        },
        "description": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "string description = 2;",
          "description": "Stream description",
          "default": ""
        },
        "limits": {
          "oneOf": [
            {
              "$ref": "#/definitions/strmprivacy.api.entities.v1.Limits"
            },
            {
              "type": "null"
            }
          ],
          "title": "strmprivacy.api.entities.v1.Limits limits = 6;",
          "description": "stream limits",
          "default": {
            
          }
        },
        "ref": {
          "oneOf": [
            {
              "$ref": "#/definitions/strmprivacy.api.entities.v1.StreamRef"
            },
            {
              "type": "null"
            }
          ],
          "title": "strmprivacy.api.entities.v1.StreamRef ref = 1;",
          "default": {
            
          }
        },
        "tags": {
          "oneOf": [
            {
              "type": "array",
              "items": {
                "type": "string",
                "title": "string"
              }
            },
            {
              "type": "null"
            }
          ],
          "title": "repeated string tags = 8;",
          "description": "tags are meant for customers to tag their streams",
          "default": null
        },
        "consent_level_type": {
          "oneOf": [
            {
              "$ref": "#/definitions/strmprivacy.api.entities.v1.ConsentLevelType"
            },
            {
              "type": "null"
            }
          ],
          "title": "strmprivacy.api.entities.v1.ConsentLevelType consent_level_type = 4;",
          "description": "how event consent-levels are interpreted by decrypters.",
          "default": "CONSENT_LEVEL_TYPE_UNSPECIFIED"
        },
        "linked_stream": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "string linked_stream = 7;",
          "description": "null for source streams",
          "default": ""
        },
        "policy_id": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "string policy_id = 12;",
          "description": "The id of the policy that should be applied to this stream's data",
          "default": ""
        },
        "credentials": {
          "oneOf": [
            {
              "type": "array",
              "items": {
                "$ref": "#/definitions/strmprivacy.api.entities.v1.Credentials",
                "title": "strmprivacy.api.entities.v1.Credentials",
                "default": {
                  
                }
              }
            },
            {
              "type": "null"
            }
          ],
          "title": "repeated strmprivacy.api.entities.v1.Credentials credentials = 9;",
          "default": [
            {
              
            }
          ]
        },
        "kafka_topic": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "string kafka_topic = 11;",
          "description": "Kafka topic of the stream. Deprecated in favor of topic in message ExtendedStream",
          "default": "",
          "deprecationMessage": "Field \"kafka_topic\" is marked as deprecated"
        },
        "masked_fields": {
          "oneOf": [
            {
              "$ref": "#/definitions/strmprivacy.api.entities.v1.MaskedFields"
            },
            {
              "type": "null"
            }
          ],
          "title": "strmprivacy.api.entities.v1.MaskedFields masked_fields = 10;",
          "description": "field masking is defined per OUTPUT stream and event-contract ref. combination\n\nThe default empty map means no masking. Otherwise, the algorithm in the decrypter is as follows.\n\n A source stream is (partially) decrypted, and events that don't have enough permissions are dropped.\n the event contract ref string is used to find a MaskedFields instance.\n if present, for all field patterns in the MaskedFields instance, the hash with the specified seed is applied.",
          "default": {
            
          }
        }
      },
      "description": "Streams are source or derived streams depending on whether or not linked_stream is null.\nKey streams are a separate entity in the api."
    },
    "strmprivacy.api.entities.v1.StreamRef": {
      "type": "object",
      "properties": {
        "billingId": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.StreamRef/definitions/billing_id"
        },
        "name": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.StreamRef/definitions/name"
        },
        "projectId": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.StreamRef/definitions/project_id"
        }
      },
      "patternProperties": {
        "^billing_id$": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.StreamRef/definitions/billing_id"
        },
        "^project_id$": {
          "$ref": "#/definitions/strmprivacy.api.entities.v1.StreamRef/definitions/project_id"
        }
      },
      "additionalProperties": {
        "title": "Unknown field"
      },
      "definitions": {
        "billing_id": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "string billing_id = 1;",
          "default": "",
          "deprecationMessage": "Field \"billing_id\" is marked as deprecated"
        },
        "name": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "string name = 2;",
          "description": "the name of the stream\nconstraints: generic name",
          "default": ""
        },
        "project_id": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "string project_id = 3;",
          "default": ""
        }
      },
      "description": "refers to a event stream."
    }
  },
  "title": "strmprivacy.api.entities.v1.Stream"
}