Constant TINC_ANNOTATIONS

Source
pub const TINC_ANNOTATIONS: &str = "syntax = \"proto3\";\n\npackage tinc;\n\nimport \"google/protobuf/descriptor.proto\";\n\nextend google.protobuf.MessageOptions {\n  // See `MessageOptions` for what options can be added onto messages.\n  MessageOptions message = 15501;\n}\n\nextend google.protobuf.FieldOptions {\n  // See `FieldOptions` for all the options that can be applied to fields.\n  FieldOptions field = 15502;\n  // Predefined is used to construct custom field cel expression templates.\n  // For more information refer to the see the `PredefinedConstraint`\n  optional PredefinedConstraints predefined = 15508;\n}\n\nextend google.protobuf.EnumOptions {\n  // See `EnumOptions` for all the options that can be applied to enums.\n  EnumOptions enum = 15503;\n}\n\nextend google.protobuf.EnumValueOptions {\n  // See `EnumVariantOptions` for all the options that can be applied to enum variants.\n  EnumVariantOptions variant = 15504;\n}\n\nextend google.protobuf.MethodOptions {\n  // See `MethodOptions` for all the options that can be applied to methods.\n  MethodOptions method = 15505;\n}\n\nextend google.protobuf.ServiceOptions {\n  // See `ServiceOptions` for all the options that can be applied to services.\n  ServiceOptions service = 15506;\n}\n\nextend google.protobuf.OneofOptions {\n  // See `OneofOptions` for all the options that can be applied to oneofs.\n  OneofOptions oneof = 15507;\n}\n\nmessage ServiceOptions {\n  // By default service routes are defined in the method, however if you want\n  // all routes in this service to be prefixed this is\n  // how you would apply such a prefix.\n  optional string prefix = 1;\n}\n\n// Enum to define how to rename fields or enum variants.\nenum RenameAll {\n  // protolint:disable ENUM_FIELD_NAMES_PREFIX\n  RENAME_ALL_UNSPECIFIED = 0;\n  // Rename to lowercase.\n  LOWER_CASE = 1;\n  // Rename to UPPERCASE.\n  UPPER_CASE = 2;\n  // Rename to PascalCase.\n  PASCAL_CASE = 3;\n  // Rename to camelCase.\n  CAMEL_CASE = 4;\n  // Rename to snake_case.\n  SNAKE_CASE = 5;\n  // Rename to SCREAMING_SNAKE_CASE.\n  SCREAMING_SNAKE_CASE = 6;\n  // Rename to kebab-case.\n  KEBAB_CASE = 7;\n  // Rename to SCREAMING-KEBAB-CASE.\n  SCREAMING_KEBAB_CASE = 8;\n}\n\nmessage MethodOptions {\n  // A list of endpoints to be built from this method.\n  repeated HttpEndpointOptions endpoint = 1;\n  // A list of cel expressions to apply to the input of this message.\n  repeated CelExpression cel = 2;\n}\n\nmessage MessageOptions {\n  // If false, this message will not be generated even if its depended on by a method.\n  // If true, this message will always be generated.\n  // By default: this message is only generated if its depended on by a method.\n  optional bool generate = 1;\n  // Rename all fields in the message.\n  optional RenameAll rename_all = 2;\n  // Disable cel-validation generation.\n  optional bool skip_validation = 101;\n\n  // A list of custom cel expressions that apply to the message in its entirety\n  // You can use this to create expressions that depend on multiple field values.\n  repeated CelExpression cel = 100;\n}\n\n// Change the visibility of a field or enum variant\nenum Visibility {\n  VISIBILITY_UNSPECIFIED = 0;\n  // Skipped fields will not be deserialized or serialized.\n  SKIP = 1;\n  // Fields marked as input only will only be deserialized and will not be\n  // serialized.\n  INPUT_ONLY = 2;\n  // Fields marked as output only will not be deserialized and only will be\n  // serialized.\n  OUTPUT_ONLY = 3;\n}\n\n// Predefined constraints allow us to extend the validation system\n// by defining our own custom message extensions with validation\n// constraints.\nmessage PredefinedConstraints {\n  // The set of constraints that should be applied.\n  repeated CelExpression cel = 1;\n\n  // The type of the target of the expression\n  enum Type {\n    TYPE_UNSPECIFIED = 0;\n    // Only apply all sub items to repeated items\n    WRAPPER_REPEATED_ITEM = 1;\n    // Only apply all sub items to map keys\n    WRAPPER_MAP_KEY = 2;\n    // Only apply all sub items to map values\n    WRAPPER_MAP_VALUE = 3;\n    // Unlike the others, this can only be applied\n    // to lists of `CelExpression`\n    CUSTOM_EXPRESSION = 4;\n  }\n  Type type = 2;\n}\n\n// JsonOmittable is the notion of leaving out fields, and\n// how we behave when a field is missing.\nenum JsonOmittable {\n  JSON_OMITTABLE_UNSPECIFIED = 0;\n  // If true the field will just be defaulted if not provided.\n  // The field will also not be serialized if its the default value.\n  TRUE = 1;\n  // If false we will raise an error when the field is not provided.\n  FALSE = 2;\n  // Same as true, except always serialize the field even if its a default value.\n  TRUE_BUT_STILL_SERIALIZE = 3;\n}\n\nmessage FieldOptions {\n  // Rename this specific field to another name.\n  optional string rename = 1;\n\n  // Deserialization:\n  // This flag dictates how we handle fields which are\n  // not provided in the json representation of the message.\n  // If this is true, then no error will be returned\n  // if the field is not provided.\n  // If this is false then not providing a value for this field\n  // will result in an error.\n  //\n  // Serialization:\n  // This flag dictates if we should skip serializing the field\n  // in the json representation of the message if the field\n  // is equal to the default value for its type.\n  //\n  // By default if the value depends on the type of field.\n  // If the field is an option then the default value is\n  // `TRUE_BUT_SERIALIZE` which means that the option does not\n  // need to be provided but a `null` value will always be serialized.\n  // If the field is not an option then it will be required so `FALSE`.\n  JsonOmittable json_omittable = 200;\n\n  // Flatten this field into the parent message.\n  // This only works on messages.\n  optional bool flatten = 205;\n  // Change the visibility of the field. By Default all fields are visible.\n  optional Visibility visibility = 202;\n\n  // Add some constraints to the field.\n  optional FieldConstraints constraint = 101;\n}\n\nmessage FloatConstraints {\n  oneof greater {\n    // Requires the input value is greater than the value provided.\n    float gt = 1 [(predefined).cel = {\n      message: \"value must be greater than `{this}`\"\n      expression: \"input > this\"\n      jsonschemas: \'{ \"exclusiveMinimum\": this }\'\n    }];\n    // Requires the input value is greater than or equal to the value provided.\n    float gte = 2 [(predefined).cel = {\n      message: \"value must be greater than or equal to `{this}`\"\n      expression: \"input >= this\"\n      jsonschemas: \'{ \"minimum\": this }\'\n    }];\n  }\n\n  oneof less {\n    // Requires the input value is less than the value provided.\n    float lt = 3 [(predefined).cel = {\n      message: \"value must be less than `{this}`\"\n      expression: \"input < this\"\n      jsonschemas: \'{ \"exclusiveMaximum\": this }\'\n    }];\n    // Requires the input value is less than or equal to the value provided.\n    float lte = 4 [(predefined).cel = {\n      message: \"value must be less than or equal to {this}\"\n      expression: \"input <= this\"\n      jsonschemas: \'{ \"maximum\": this }\'\n    }];\n  }\n\n  // Requires the input value be one of the values in the list\n  repeated float in = 5 [(predefined).cel = {\n    message: \"value must be one of `{this}`\"\n    expression: \"this.contains(input)\"\n    jsonschemas: \'{ \"enum\": this }\'\n  }];\n  // Requires the input value not be one of the values in the list.\n  repeated float not_in = 6 [(predefined).cel = {\n    message: \"value must not be one of `{this}`\"\n    expression: \"!this.contains(input)\"\n    jsonschemas: \'{ \"not\": { \"enum\": this }}\'\n  }];\n  // Requires the input value be exactly equal to the value provided.\n  optional float const = 8 [(predefined).cel = {\n    message: \"value must be equal to `{this}`\"\n    expression: \"input == this\"\n    jsonschemas: \'{ \"const\": this }\'\n  }];\n  // If true, NaN values are not allowed.\n  optional bool disallow_nan = 9 [(predefined).cel = {\n    message: \"value must not be NaN\"\n    expression: \"!this || !input.isNaN()\"\n    jsonschemas: \'this ? { \"not\": { \"enum\": [\"NaN\"] }} : {}\'\n  }];\n  // If true, pos/neg Infinity values are not allowed.\n  optional bool disallow_infinity = 10 [(predefined).cel = {\n    message: \"value must not be of infinity kind\"\n    expression: \"!this || !input.isInf()\"\n    jsonschemas: \'this ? { \"not\": { \"enum\": [\"Infinity\", \"-Infinity\"] }} : {}\'\n  }];\n}\n\nmessage DoubleConstraints {\n  oneof greater {\n    // Requires the input value is greater than the value provided.\n    double gt = 1 [(predefined).cel = {\n      message: \"value must be greater than `{this}`\"\n      expression: \"input > this\"\n      jsonschemas: \'{ \"exclusiveMinimum\": this }\'\n    }];\n    // Requires the input value is greater than or equal to the value provided.\n    double gte = 2 [(predefined).cel = {\n      message: \"value must be greater than or equal to `{this}`\"\n      expression: \"input >= this\"\n      jsonschemas: \'{ \"minimum\": this }\'\n    }];\n  }\n\n  oneof less {\n    // Requires the input value is less than the value provided.\n    double lt = 3 [(predefined).cel = {\n      message: \"value must be less than `{this}`\"\n      expression: \"input < this\"\n      jsonschemas: \'{ \"exclusiveMaximum\": this }\'\n    }];\n    // Requires the input value is less than or equal to the value provided.\n    double lte = 4 [(predefined).cel = {\n      message: \"value must be less than or equal to `{this}`\"\n      expression: \"input <= this\"\n      jsonschemas: \'{ \"maximum\": this }\'\n    }];\n  }\n\n  // Requires the input value be one of the values in the list\n  repeated double in = 5 [(predefined).cel = {\n    message: \"value must be one of `{this}`\"\n    expression: \"this.contains(input)\"\n    jsonschemas: \'{ \"enum\": this }\'\n  }];\n  // Requires the input value not be one of the values in the list.\n  repeated double not_in = 6 [(predefined).cel = {\n    message: \"value must not be one of `{this}`\"\n    expression: \"!this.contains(input)\"\n    jsonschemas: \'{ \"not\": { \"enum\": this }}\'\n  }];\n  // Requires the input value be exactly equal to the value provided.\n  optional double const = 8 [(predefined).cel = {\n    message: \"value must be equal to `{this}`\"\n    expression: \"input == this\"\n    jsonschemas: \'{ \"const\": this }\'\n  }];\n  // If true, NaN values are not allowed.\n  optional bool disallow_nan = 9 [(predefined).cel = {\n    message: \"value must not be NaN\"\n    expression: \"!this || !input.isNaN()\"\n    jsonschemas: \'this ? { \"not\": { \"enum\": [\"NaN\"] }} : {}\'\n  }];\n  // If true, pos/neg Infinity values are not allowed.\n  optional bool disallow_infinity = 10 [(predefined).cel = {\n    message: \"value must not be of infinity kind\"\n    expression: \"!this || !input.isInf()\"\n    jsonschemas: \'this ? { \"not\": { \"enum\": [\"Infinity\", \"-Infinity\"] }} : {}\'\n  }];\n}\n\nmessage Int32Constraints {\n  oneof greater {\n    // Requires the input value is greater than the value provided.\n    int32 gt = 1 [(predefined).cel = {\n      message: \"value must be greater than `{this}`\"\n      expression: \"input > this\"\n      jsonschemas: \'{ \"exclusiveMinimum\": this }\'\n    }];\n    // Requires the input value is greater than or equal to the value provided.\n    int32 gte = 2 [(predefined).cel = {\n      message: \"value must be greater than or equal to `{this}`\"\n      expression: \"input >= this\"\n      jsonschemas: \'{ \"minimum\": this }\'\n    }];\n  }\n\n  oneof less {\n    // Requires the input value is less than the value provided.\n    int32 lt = 3 [(predefined).cel = {\n      message: \"value must be less than `{this}`\"\n      expression: \"input < this\"\n      jsonschemas: \'{ \"exclusiveMaximum\": this }\'\n    }];\n    // Requires the input value is less than or equal to the value provided.\n    int32 lte = 4 [(predefined).cel = {\n      message: \"value must be less than or equal to `{this}`\"\n      expression: \"input <= this\"\n      jsonschemas: \'{ \"maximum\": this }\'\n    }];\n  }\n  // Requires the input value be one of the values in the list\n  repeated int32 in = 5 [(predefined).cel = {\n    message: \"value must be one of `{this}`\"\n    expression: \"this.contains(input)\"\n    jsonschemas: \'{ \"enum\": this }\'\n  }];\n  // Requires the input value not be one of the values in the list.\n  repeated int32 not_in = 6 [(predefined).cel = {\n    message: \"value must not be one of `{this}`\"\n    expression: \"!this.contains(input)\"\n    jsonschemas: \'{ \"not\": { \"enum\": this }}\'\n  }];\n  // Requires the input value be exactly equal to the value provided.\n  optional int32 const = 8 [(predefined).cel = {\n    message: \"value must be equal to `{this}`\"\n    expression: \"input == this\"\n    jsonschemas: \'{ \"const\": this }\'\n  }];\n}\n\nmessage Int64Constraints {\n  oneof greater {\n    // Requires the input value is greater than the value provided.\n    int64 gt = 1 [(predefined).cel = {\n      message: \"value must be greater than `{this}`\"\n      expression: \"input > this\"\n      jsonschemas: \'{ \"exclusiveMinimum\": this }\'\n    }];\n    // Requires the input value is greater than or equal to the value provided.\n    int64 gte = 2 [(predefined).cel = {\n      message: \"value must be greater than or equal to `{this}`\"\n      expression: \"input >= this\"\n      jsonschemas: \'{ \"minimum\": this }\'\n    }];\n  }\n\n  oneof less {\n    // Requires the input value is less than the value provided.\n    int64 lt = 3 [(predefined).cel = {\n      message: \"value must be less than `{this}`\"\n      expression: \"input < this\"\n      jsonschemas: \'{ \"exclusiveMaximum\": this }\'\n    }];\n    // Requires the input value is less than or equal to the value provided.\n    int64 lte = 4 [(predefined).cel = {\n      message: \"value must be less than or equal to `{this}`\"\n      expression: \"input <= this\"\n      jsonschemas: \'{ \"maximum\": this }\'\n    }];\n  }\n  // Requires the input value be one of the values in the list\n  repeated int64 in = 5 [(predefined).cel = {\n    message: \"value must be one of `{this}`\"\n    expression: \"this.contains(input)\"\n    jsonschemas: \'{ \"enum\": this }\'\n  }];\n  // Requires the input value not be one of the values in the list.\n  repeated int64 not_in = 6 [(predefined).cel = {\n    message: \"value must not be one of `{this}`\"\n    expression: \"!this.contains(input)\"\n    jsonschemas: \'{ \"not\": { \"enum\": this }}\'\n  }];\n  // Requires the input value be exactly equal to the value provided.\n  optional int64 const = 8 [(predefined).cel = {\n    message: \"value must be equal to `{this}`\"\n    expression: \"input == this\"\n    jsonschemas: \'{ \"const\": this }\'\n  }];\n}\n\nmessage UInt32Constraints {\n  oneof greater {\n    // Requires the input value is greater than the value provided.\n    uint32 gt = 1 [(predefined).cel = {\n      message: \"value must be greater than `{this}`\"\n      expression: \"input > this\"\n      jsonschemas: \'{ \"exclusiveMinimum\": this }\'\n    }];\n    // Requires the input value is greater than or equal to the value provided.\n    uint32 gte = 2 [(predefined).cel = {\n      message: \"value must be greater than or equal to `{this}`\"\n      expression: \"input >= this\"\n      jsonschemas: \'{ \"minimum\": this }\'\n    }];\n  }\n\n  oneof less {\n    // Requires the input value is less than the value provided.\n    uint32 lt = 3 [(predefined).cel = {\n      message: \"value must be less than `{this}`\"\n      expression: \"input < this\"\n      jsonschemas: \'{ \"exclusiveMaximum\": this }\'\n    }];\n    // Requires the input value is less than or equal to the value provided.\n    uint32 lte = 4 [(predefined).cel = {\n      message: \"value must be less than or equal to `{this}`\"\n      expression: \"input <= this\"\n      jsonschemas: \'{ \"maximum\": this }\'\n    }];\n  }\n  // Requires the input value be one of the values in the list\n  repeated uint32 in = 5 [(predefined).cel = {\n    message: \"value must be one of `{this}`\"\n    expression: \"this.contains(input)\"\n    jsonschemas: \'{ \"enum\": this }\'\n  }];\n  // Requires the input value not be one of the values in the list.\n  repeated uint32 not_in = 6 [(predefined).cel = {\n    message: \"value must not be one of `{this}`\"\n    expression: \"!this.contains(input)\"\n    jsonschemas: \'{ \"not\": { \"enum\": this }}\'\n  }];\n  // Requires the input value be exactly equal to the value provided.\n  optional uint32 const = 8 [(predefined).cel = {\n    message: \"value must be equal to `{this}`\"\n    expression: \"input == this\"\n    jsonschemas: \'{ \"const\": this }\'\n  }];\n}\n\nmessage UInt64Constraints {\n  oneof greater {\n    // Requires the input value is greater than the value provided.\n    int64 gt = 1 [(predefined).cel = {\n      message: \"value must be greater than `{this}`\"\n      expression: \"input > this\"\n      jsonschemas: \'{ \"exclusiveMinimum\": this }\'\n    }];\n    // Requires the input value is greater than or equal to the value provided.\n    uint64 gte = 2 [(predefined).cel = {\n      message: \"value must be greater than or equal to `{this}`\"\n      expression: \"input >= this\"\n      jsonschemas: \'{ \"minimum\": this }\'\n    }];\n  }\n\n  oneof less {\n    // Requires the input value is less than the value provided.\n    uint64 lt = 3 [(predefined).cel = {\n      message: \"value must be less than `{this}`\"\n      expression: \"input < this\"\n      jsonschemas: \'{ \"exclusiveMaximum\": this }\'\n    }];\n    // Requires the input value is less than or equal to the value provided.\n    uint64 lte = 4 [(predefined).cel = {\n      message: \"value must be less than or equal to `{this}`\"\n      expression: \"input <= this\"\n      jsonschemas: \'{ \"maximum\": this }\'\n    }];\n  }\n  // Requires the input value be one of the values in the list\n  repeated uint64 in = 5 [(predefined).cel = {\n    message: \"value must be one of `{this}`\"\n    expression: \"this.contains(input)\"\n    jsonschemas: \'{ \"enum\": this }\'\n  }];\n  // Requires the input value not be one of the values in the list.\n  repeated uint64 not_in = 6 [(predefined).cel = {\n    message: \"value must not be one of `{this}`\"\n    expression: \"!this.contains(input)\"\n    jsonschemas: \'{ \"not\": { \"enum\": this }}\'\n  }];\n  // Requires the input value be exactly equal to the value provided.\n  optional uint64 const = 8 [(predefined).cel = {\n    message: \"value must be equal to `{this}`\"\n    expression: \"input == this\"\n    jsonschemas: \'{ \"const\": this }\'\n  }];\n}\n\nmessage StringConstraints {\n  // Requires the input value be exactly equal to the value provided.\n  optional string const = 1 [(predefined).cel = {\n    message: \"value must equal `{this}`\"\n    expression: \"input == this\"\n    jsonschemas: \'{\"const\": this }\'\n  }];\n  // Requires the input value length be exactly equal to the value provided.\n  optional uint64 len = 2 [(predefined).cel = {\n    message: \"value must be exactly `{this}` characters long\"\n    expression: \"input.size() == this\"\n    jsonschemas: \'{ \"maxLength\": this }\'\n    jsonschemas: \'{ \"minLength\": this }\'\n  }];\n  // Requires the input value length be greater then or equal to the value provided.\n  optional uint64 min_len = 3 [(predefined).cel = {\n    message: \"value must be at least `{this}` characters long\"\n    expression: \"input.size() >= this\"\n    jsonschemas: \'{ \"minLength\": this }\'\n  }];\n  // Requires the input value length be less then or equal to the value provided.\n  optional uint64 max_len = 4 [(predefined).cel = {\n    message: \"value must be at most `{this}` characters long\"\n    expression: \"input.size() <= this\"\n    jsonschemas: \'{ \"maxLength\": this }\'\n  }];\n  // Requires the input value to match against regex provided.\n  optional string match = 5 [(predefined).cel = {\n    message: \"value must match the pattern `{this}`\"\n    expression: \"input.matches(this)\"\n    jsonschemas: \'{ \"pattern\": this }\'\n  }];\n  // Requires the input value not match against the regex provided.\n  optional string not_match = 6 [(predefined).cel = {\n    message: \"value must not match the pattern `{this}`\"\n    expression: \"!(input.matches(this))\"\n    jsonschemas: \'{ \"not\": { \"pattern\": this }}\'\n  }];\n  // Requires the input value to start with the value provided.\n  optional string prefix = 7 [(predefined).cel = {\n    message: \"value must start with `{this}`\"\n    expression: \"input.startsWith(this)\"\n    jsonschemas: \'{ \"pattern\": \"^\" + this }\'\n  }];\n  // Requires the input value to end with the value provided.\n  optional string suffix = 8 [(predefined).cel = {\n    message: \"value must end with `{this}`\"\n    expression: \"input.endsWith(this)\"\n    jsonschemas: \'{ \"pattern\": this + \"$\" }\'\n  }];\n  // Requires the input value to contain this sub string.\n  optional string contains = 9 [(predefined).cel = {\n    message: \"value must contain `{this}`\"\n    expression: \"input.contains(this)\"\n    jsonschemas: \'{ \"pattern\": this }\'\n  }];\n  // Requires the input value to not contain this sub string.\n  optional string not_contains = 10 [(predefined).cel = {\n    message: \"value must not contain `{this}`\"\n    expression: \"!input.contains(this)\"\n    jsonschemas: \'{ \"not\": { \"pattern\": this }}\'\n  }];\n  // Requires the input value to be one of the values in the list.\n  repeated string in = 11 [(predefined).cel = {\n    message: \"value must be one of `{this}`\"\n    expression: \"this.contains(input)\"\n    jsonschemas: \'{ \"enum\": this }\'\n  }];\n  // Requires the input value to not be in the list.\n  repeated string not_in = 12 [(predefined).cel = {\n    message: \"value must not be one of `{this}`\"\n    expression: \"!this.contains(input)\"\n    jsonschemas: \'{ \"not\": { \"enum\": this }}\'\n  }];\n  oneof well_known {\n    // Ensure the value is a valid email address format\n    bool email = 13 [(predefined).cel = {\n      message: \"value must be a valid email address\"\n      expression: \"!this || input.isEmail()\"\n      jsonschemas: \'this ? { \"format\": \"email\" } : {}\'\n    }];\n    // Requires the input value to be a valid ipv4 or ipv6 address.\n    bool ip = 14 [(predefined).cel = {\n      message: \"value must be a valid ipv4 or ipv6 address\"\n      expression: \"!this || input.isIpv4() || input.isIpv6()\"\n      jsonschemas: \'this ? { \"anyOf\": [ { \"format\": \"ipv4\" }, { \"format\": \"ipv6\" } ] } : {}\'\n    }];\n    // Requires the input value to be a valid ipv4 address.\n    bool ipv4 = 15 [(predefined).cel = {\n      message: \"value must be a valid ipv4 address\"\n      expression: \"!this || input.isIpv4()\"\n      jsonschemas: \'this ? { \"format\": \"ipv4\" } : {}\'\n    }];\n    // Requires the input value to be a valid ipv6 address.\n    bool ipv6 = 16 [(predefined).cel = {\n      message: \"value must be a valid ipv6 address\"\n      expression: \"!this || input.isIpv6()\"\n      jsonschemas: \'this ? { \"format\": \"ipv6\" } : {}\'\n    }];\n    // Requires the input value to be a valid uuid.\n    bool uuid = 17 [(predefined).cel = {\n      message: \"value must be a valid uuid\"\n      expression: \"!this || input.isUuid()\"\n      jsonschemas: \'this ? { \"format\": \"uuid\" } : {}\'\n    }];\n    // Requires the input value to be a valid hostname.\n    bool hostname = 18 [(predefined).cel = {\n      message: \"value must be a valid hostname\"\n      expression: \"!this || input.isHostname()\"\n      jsonschemas: \'this ? { \"format\": \"hostname\" } : {}\'\n    }];\n    // Requires the input value to be a valid uri.\n    bool uri = 19 [(predefined).cel = {\n      message: \"value must be a valid uri\"\n      expression: \"!this || input.isUri()\"\n      jsonschemas: \'this ? { \"format\": \"uri\" } : {}\'\n    }];\n  }\n}\n\nmessage BytesConstraints {\n  // Requires the input value be exactly equal to the value provided.\n  optional bytes const = 1 [(predefined).cel = {\n    message: \"value must equal `{this}`\"\n    expression: \"input == this\"\n    jsonschemas: \'{\"const\": this }\'\n  }];\n  // Requires the input value length be exactly equal to the value provided.\n  optional uint64 len = 2 [(predefined).cel = {\n    message: \"value must be exactly `{this}` bytes long\"\n    expression: \"input.size() == this\"\n    jsonschemas: \'{ \"minLength\": this }\'\n    jsonschemas: \'{ \"maxLength\": this }\'\n  }];\n  // Requires the input value length be greater then or equal to the value provided.\n  optional uint64 min_len = 3 [(predefined).cel = {\n    message: \"value must be at least `{this}` bytes long\"\n    expression: \"input.size() >= this\"\n    jsonschemas: \'{ \"minLength\": this }\'\n  }];\n  // Requires the input value length be less then or equal to the value provided.\n  optional uint64 max_len = 4 [(predefined).cel = {\n    message: \"value must be at most `{this}` bytes long\"\n    expression: \"input.size() <= this\"\n    jsonschemas: \'{ \"maxLength\": this }\'\n  }];\n}\n\nmessage EnumConstraints {\n  // Requires the input value to be equal to the enum value where the tag is the value provided.\n  optional int32 const = 1 [(predefined).cel = {\n    message: \"value must be equal to `{this.enum()}`\"\n    expression: \"input == this\"\n    jsonschemas: \'{ \"const\": this.enum() }\'\n  }];\n  // Requires the input to be a valid value for this enum.\n  optional bool defined = 2 [(predefined).cel = {\n    message: \"value must be defined in the enum\"\n    expression: \"!this || input.enum()\"\n  }];\n  // Requires the input to be one of the enum\'s provided.\n  repeated int32 in = 3 [(predefined).cel = {\n    message: \"value must be one of `{this.map(e, e.enum())}`\"\n    expression: \"this.contains(input)\"\n    jsonschemas: \'{ \"enum\": this.map(e, e.enum()) }\'\n  }];\n  // Requires the input to not be one of the enums provided.\n  repeated int32 not_in = 4 [(predefined).cel = {\n    message: \"value must not be one of `{this.map(e, e.enum())}`\"\n    expression: \"!this.contains(input)\"\n    jsonschemas: \'{ \"not\": { \"enum\": this.map(e, e.enum()) }}\'\n  }];\n}\n\nmessage RepeatedConstraints {\n  // Requires the length of the list be greater than or equal to the value provided.\n  optional uint64 min_len = 1 [(predefined).cel = {\n    message: \"value must have at least `{this}` elements\"\n    expression: \"input.size() >= this\"\n    jsonschemas: \'{ \"minItems\": this }\'\n  }];\n  // Requires the length of the list be less than or equal to the value provided.\n  optional uint64 max_len = 2 [(predefined).cel = {\n    message: \"value must have at most `{this}` elements\"\n    expression: \"input.size() <= this\"\n    jsonschemas: \'{ \"maxItems\": this }\'\n  }];\n  // Requires the length of the list be equal to the value provided.\n  optional uint64 len = 3 [(predefined).cel = {\n    message: \"value must have exactly `{this}` elements\"\n    expression: \"input.size() == this\"\n    jsonschemas: \'{ \"maxItems\": this }\'\n    jsonschemas: \'{ \"minItems\": this }\'\n  }];\n\n  // Requires all items in the list are unique\n  // optional bool unique = 4 [(predefined).cel = {\n  //     message: \"value must be unique\"\n  //     expression: \"!this || input.isUnique()\"\n  //     jsonschemas: \'this ? { \"uniqueItems\": this } : {}\'\n  // }];\n\n  // Apply a constraints to the items in the list.\n  optional PrimitiveConstraints item = 5 [(predefined).type = WRAPPER_REPEATED_ITEM];\n}\n\nmessage MapConstraints {\n  // Requires the length of the map be greater than or equal to the value provided.\n  optional uint64 min_len = 1 [(predefined).cel = {\n    message: \"value must have at least `{this}` elements\"\n    expression: \"input.size() >= this\"\n    jsonschemas: \'{ \"minProperties\": this }\'\n  }];\n  // Requires the length of the map be less than or equal to the value provided.\n  optional uint64 max_len = 2 [(predefined).cel = {\n    message: \"value must have at most `{this}` elements\"\n    expression: \"input.size() <= this\"\n    jsonschemas: \'{ \"maxProperties\": this }\'\n  }];\n  // Requires the length of the map be equal to the value provided.\n  optional uint64 len = 3 [(predefined).cel = {\n    message: \"value must have exactly `{this}` elements\"\n    expression: \"input.size() == this\"\n    jsonschemas: \'{ \"minProperties\": this }\'\n    jsonschemas: \'{ \"maxProperties\": this }\'\n  }];\n\n  message MapKeyConstraints {\n    oneof constraint {\n      // for int32 keys\n      Int32Constraints int32 = 1;\n      // for int64 keys\n      Int64Constraints int64 = 2;\n      // for uint32 keys\n      UInt32Constraints uint32 = 3;\n      // for uint64 keys\n      UInt64Constraints uint64 = 4;\n      // for string keys\n      StringConstraints string = 5;\n    }\n\n    // A list of custom expressions to apply to map keys.\n    repeated CelExpression cel = 8 [(predefined).type = CUSTOM_EXPRESSION];\n  }\n\n  // Apply a constraints to the keys in the list.\n  optional MapKeyConstraints key = 4 [(predefined).type = WRAPPER_MAP_KEY];\n\n  // Apply a constraints to the values in the list.\n  optional PrimitiveConstraints value = 5 [(predefined).type = WRAPPER_MAP_VALUE];\n}\n\nmessage PrimitiveConstraints {\n  oneof constraint {\n    // for float values\n    FloatConstraints float = 1;\n    // for double values\n    DoubleConstraints double = 2;\n    // for int32 values\n    Int32Constraints int32 = 3;\n    // for int64 values\n    Int64Constraints int64 = 4;\n    // for uint32 values\n    UInt32Constraints uint32 = 5;\n    // for uint64 values\n    UInt64Constraints uint64 = 6;\n    // for string values\n    StringConstraints string = 7;\n    // for bytes values\n    BytesConstraints bytes = 8;\n    // for enum values\n    EnumConstraints enum = 9;\n  }\n\n  // A list of custom expressions to apply to the value\n  repeated CelExpression cel = 11 [(predefined).type = CUSTOM_EXPRESSION];\n}\n\nmessage FieldConstraints {\n  oneof constraint {\n    // for float fields.\n    FloatConstraints float = 1;\n    // for double fields.\n    DoubleConstraints double = 2;\n    // for int32 fields.\n    Int32Constraints int32 = 3;\n    // for int64 fields.\n    Int64Constraints int64 = 4;\n    // for uint32 fields.\n    UInt32Constraints uint32 = 5;\n    // for uint64 fields.\n    UInt64Constraints uint64 = 6;\n    // for string fields.\n    StringConstraints string = 7;\n    // for bytes fields.\n    BytesConstraints bytes = 8;\n    // for enum fields.\n    EnumConstraints enum = 9;\n    // for repeated fields.\n    RepeatedConstraints repeated = 10;\n    // for map fields.\n    MapConstraints map = 11;\n  }\n\n  // A list of custom expressions to apply to the field.\n  repeated CelExpression cel = 13 [(predefined).type = CUSTOM_EXPRESSION];\n}\n\nmessage CelExpression {\n  // The message to use when the validation fails.\n  // You can template cel expressions using the `{<cel-expr>}` syntax\n  string message = 2;\n  // The expression itself.\n  // Note: This expression\'s result will be converted into a bool.\n  string expression = 3;\n  // Json Scheamas that should be used when this expression is applied.\n  // This is also a cel-expression which is evaluated at compile time\n  // and should return a map object in the json schema format.\n  repeated string jsonschemas = 5;\n}\n\nmessage EnumOptions {\n  // Treat this enum as a number enum instead of string\n  optional bool repr_enum = 2;\n  // Rename all the fields on the enum\n  optional RenameAll rename_all = 3;\n}\n\nmessage EnumVariantOptions {\n  // Rename this variant\n  optional string rename = 1;\n  // Change the visibility for this variant.\n  optional Visibility visibility = 2;\n}\n\nmessage HttpEndpointOptions {\n  // HTTP method - Path parameters can be specified using `{param}` syntax.\n  oneof method {\n    // GET method\n    string get = 1;\n    // POST method\n    string post = 2;\n    // PUT method\n    string put = 3;\n    // DELETE method\n    string delete = 4;\n    // PATCH method\n    string patch = 5;\n  }\n\n  // The default input for `GET` and `DELETE` methods is `query`\n  // Otherwise the default is `body`.\n  message Request {\n    message JsonBody {\n      optional string field = 1;\n    }\n\n    message TextBody {\n      optional string field = 1;\n    }\n\n    message BinaryBody {\n      optional string field = 1;\n      // Specify the field to take the content-type from.\n      optional string content_type_field = 2;\n      // This field is purely used by the openapi spec to denote the set of valid output formats.\n      optional string content_type_accepts = 3;\n    }\n\n    message QueryParams {\n      // The field to parse the query parameters into.\n      // By Default this is empty and therefore its parsed into the root message.\n      optional string field = 1;\n    }\n\n    oneof mode {\n      JsonBody json = 1;\n      TextBody text = 2;\n      BinaryBody binary = 3;\n      QueryParams query = 4;\n    }\n  }\n\n  Request request = 8;\n\n  message Response {\n    message Json {\n      // Specify a sub field to return as the response\n      // If this field is bytes or string it will be returned as is\n      // without decoding.\n      optional string field = 1;\n    }\n\n    message Text {\n      // Specify a sub field to return as the response\n      // If this field is bytes or string it will be returned as is\n      // without decoding.\n      optional string field = 1;\n    }\n\n    message Binary {\n      // Specify a sub field to return as the response\n      // If this field is bytes or string it will be returned as is\n      // without decoding.\n      optional string field = 1;\n      // Specify the field to take the content-type from.\n      optional string content_type_field = 2;\n      // This field is purely used by the openapi spec to denote the set of valid output formats.\n      optional string content_type_accepts = 3;\n    }\n\n    oneof mode {\n      Json json = 1;\n      Text text = 2;\n      Binary binary = 3;\n    }\n  }\n\n  // Response options,\n  // by default the entire message will be sent as a response with the content type\n  // being `application/json`\n  Response response = 9;\n}\n\nmessage OneofOptions {\n  // Rename this oneof\'s name\n  optional string rename = 1;\n  // Rename all the fields in the oneof.\n  optional RenameAll rename_all = 4;\n\n  // Deserialization:\n  // This flag dictates how we handle fields which are\n  // not provided in the json representation of the message.\n  // If this is true, then no error will be returned\n  // if the field is not provided.\n  // If this is false then not providing a value for this field\n  // will result in an error.\n  //\n  // Serialization:\n  // This flag dictates if we should skip serializing the field\n  // in the json representation of the message if the field\n  // is equal to the default value for its type.\n  //\n  // By default if the value depends on the type of field.\n  // If the field is an option then the default value is\n  // `TRUE_BUT_SERIALIZE` which means that the option does not\n  // need to be provided but a `null` value will always be serialized.\n  // If the field is not an option then it will be required so `FALSE`.\n  JsonOmittable json_omittable = 200;\n\n  // This specifies the visibility for oneof fields.\n  optional Visibility visibility = 202;\n\n  // Tagging a oneof causes the ser/de to represent it like such\n  // {\n  //        \"tag\": \"tag\",\n  //        \"content\": content\n  // }\n  message Tagged {\n    string tag = 1;\n    string content = 2;\n  }\n\n  // If you want to use tagged notation this allows you to configure that.\n  optional Tagged tagged = 100;\n  // You can also flatten the oneof directly into the containing message.\n  optional bool flatten = 101;\n}\n";
Expand description

The raw protobuf file