Esempio n. 1
0
        *,
        x: typing.Optional[str] = None,
        empty: typing.Optional[protox.Empty] = None,
    ):
        super().__init__(
            x=x,
            empty=empty,
        )


FILE_DESCRIPTOR = protox.FileDescriptorProto.from_bytes(
    b'\n\rmessage.proto\x12\x0enested.message\x1a\x1bgoogle/protobuf/empty.proto"\xf3\x01\n\x08TopLevel\x12<\n\x06second\x18\x01 \x02(\x0b2$.nested.message.TopLevel.SecondLevelR\x06second\x12E\n\x05third\x18\x02 \x02(\x0b2/.nested.message.TopLevel.SecondLevel.ThirdLevelR\x05third\x1ab\n\x0bSecondLevel\x12E\n\x05third\x18\x01 \x02(\x0b2/.nested.message.TopLevel.SecondLevel.ThirdLevelR\x05third\x1a\x0c\n\nThirdLevel"U\n\x0fRepeatedMessage\x12:\n\x05users\x18\x01 \x03(\x0b2$.nested.message.RepeatedMessage.UserR\x05users\x1a\x06\n\x04User"X\n\x0cOneOfMessage\x12\x0e\n\x01x\x18\x01 \x01(\tH\x00R\x01x\x12.\n\x05empty\x18\x02 \x01(\x0b2\x16.google.protobuf.EmptyH\x00R\x05emptyB\x08\n\x06statusJ\xef\x04\n\x06\x12\x04\x00\x00\x1e\x01\n\x08\n\x01\x0c\x12\x03\x00\x00\x12\n\t\n\x02\x03\x00\x12\x03\x02\x07$\n\x08\n\x01\x02\x12\x03\x04\x08\x16\n\n\n\x02\x04\x00\x12\x04\x06\x00\x10\x01\n\n\n\x03\x04\x00\x01\x12\x03\x06\x08\x10\n\x0c\n\x04\x04\x00\x03\x00\x12\x04\x07\x04\x0c\x05\n\x0c\n\x05\x04\x00\x03\x00\x01\x12\x03\x07\x0c\x17\n\x0e\n\x06\x04\x00\x03\x00\x03\x00\x12\x04\x08\x08\t\t\n\x0e\n\x07\x04\x00\x03\x00\x03\x00\x01\x12\x03\x08\x10\x1a\n\r\n\x06\x04\x00\x03\x00\x02\x00\x12\x03\x0b\x08&\n\x0e\n\x07\x04\x00\x03\x00\x02\x00\x04\x12\x03\x0b\x08\x10\n\x0e\n\x07\x04\x00\x03\x00\x02\x00\x06\x12\x03\x0b\x11\x1b\n\x0e\n\x07\x04\x00\x03\x00\x02\x00\x01\x12\x03\x0b\x1c!\n\x0e\n\x07\x04\x00\x03\x00\x02\x00\x03\x12\x03\x0b$%\n\x0b\n\x04\x04\x00\x02\x00\x12\x03\x0e\x04$\n\x0c\n\x05\x04\x00\x02\x00\x04\x12\x03\x0e\x04\x0c\n\x0c\n\x05\x04\x00\x02\x00\x06\x12\x03\x0e\r\x18\n\x0c\n\x05\x04\x00\x02\x00\x01\x12\x03\x0e\x19\x1f\n\x0c\n\x05\x04\x00\x02\x00\x03\x12\x03\x0e"#\n\x0b\n\x04\x04\x00\x02\x01\x12\x03\x0f\x04.\n\x0c\n\x05\x04\x00\x02\x01\x04\x12\x03\x0f\x04\x0c\n\x0c\n\x05\x04\x00\x02\x01\x06\x12\x03\x0f\r#\n\x0c\n\x05\x04\x00\x02\x01\x01\x12\x03\x0f$)\n\x0c\n\x05\x04\x00\x02\x01\x03\x12\x03\x0f,-\n\n\n\x02\x04\x01\x12\x04\x12\x00\x17\x01\n\n\n\x03\x04\x01\x01\x12\x03\x12\x08\x17\n\x0c\n\x04\x04\x01\x03\x00\x12\x04\x13\x04\x14\x05\n\x0c\n\x05\x04\x01\x03\x00\x01\x12\x03\x13\x0c\x10\n\x0b\n\x04\x04\x01\x02\x00\x12\x03\x16\x04\x1c\n\x0c\n\x05\x04\x01\x02\x00\x04\x12\x03\x16\x04\x0c\n\x0c\n\x05\x04\x01\x02\x00\x06\x12\x03\x16\r\x11\n\x0c\n\x05\x04\x01\x02\x00\x01\x12\x03\x16\x12\x17\n\x0c\n\x05\x04\x01\x02\x00\x03\x12\x03\x16\x1a\x1b\n\n\n\x02\x04\x02\x12\x04\x19\x00\x1e\x01\n\n\n\x03\x04\x02\x01\x12\x03\x19\x08\x14\n\x0c\n\x04\x04\x02\x08\x00\x12\x04\x1a\x04\x1d\x05\n\x0c\n\x05\x04\x02\x08\x00\x01\x12\x03\x1a\n\x10\n\x0b\n\x04\x04\x02\x02\x00\x12\x03\x1b\x08\x15\n\x0c\n\x05\x04\x02\x02\x00\x05\x12\x03\x1b\x08\x0e\n\x0c\n\x05\x04\x02\x02\x00\x01\x12\x03\x1b\x0f\x10\n\x0c\n\x05\x04\x02\x02\x00\x03\x12\x03\x1b\x13\x14\n\x0b\n\x04\x04\x02\x02\x01\x12\x03\x1c\x08(\n\x0c\n\x05\x04\x02\x02\x01\x06\x12\x03\x1c\x08\x1d\n\x0c\n\x05\x04\x02\x02\x01\x01\x12\x03\x1c\x1e#\n\x0c\n\x05\x04\x02\x02\x01\x03\x12\x03\x1c&\''
)

protox.define_fields(
    TopLevel.SecondLevel,
    third=TopLevel.SecondLevel.ThirdLevel.as_field(number=1),
)
TopLevel.SecondLevel.DESCRIPTOR = protox.DescriptorProto.from_bytes(
    b'\n\x0bSecondLevel\x12E\n\x05third\x18\x01 \x02(\x0b2/.nested.message.TopLevel.SecondLevel.ThirdLevelR\x05third\x1a\x0c\n\nThirdLevel'
)
TopLevel.SecondLevel.DESCRIPTOR.file_descriptor = FILE_DESCRIPTOR
TopLevel.SecondLevel.DESCRIPTOR.full_name = 'nested.message.SecondLevel'

protox.define_fields(
    TopLevel,
    second=TopLevel.SecondLevel.as_field(number=1),
    third=TopLevel.SecondLevel.ThirdLevel.as_field(number=2),
)
TopLevel.DESCRIPTOR = protox.DescriptorProto.from_bytes(
    b'\n\x08TopLevel\x12<\n\x06second\x18\x01 \x02(\x0b2$.nested.message.TopLevel.SecondLevelR\x06second\x12E\n\x05third\x18\x02 \x02(\x0b2/.nested.message.TopLevel.SecondLevel.ThirdLevelR\x05third\x1ab\n\x0bSecondLevel\x12E\n\x05third\x18\x01 \x02(\x0b2/.nested.message.TopLevel.SecondLevel.ThirdLevelR\x05third\x1a\x0c\n\nThirdLevel'
)
Esempio n. 2
0
                begin=begin,
                end=end,
            )

    annotation: typing.List['GeneratedCodeInfo.Annotation']

    def __init__(
        self,
        *,
        annotation: typing.List['GeneratedCodeInfo.Annotation'] = None,
    ):
        super().__init__(annotation=annotation, )


protox.define_fields(
    FileDescriptorSet,
    file=FileDescriptorProto.as_repeated(number=1),
)

protox.define_fields(
    FileDescriptorProto,
    name=protox.String(number=1, required=False),
    package=protox.String(number=2, required=False),
    dependency=protox.String.as_repeated(number=3),
    public_dependency=protox.Int32.as_repeated(number=10),
    weak_dependency=protox.Int32.as_repeated(number=11),
    message_type=DescriptorProto.as_repeated(number=4),
    enum_type=EnumDescriptorProto.as_repeated(number=5),
    service=ServiceDescriptorProto.as_repeated(number=6),
    extension=FieldDescriptorProto.as_repeated(number=7),
    options=FileOptions.as_field(number=8),
    source_code_info=SourceCodeInfo.as_field(number=9),
Esempio n. 3
0
            optional_default_enum=optional_default_enum,
        )


FILE_DESCRIPTOR = protox.FileDescriptorProto.from_bytes(
    b'\n\x0benums.proto"\xc9\x02\n\x05Hello\x12\x1a\n\x01a\x18\x01 \x02(\x0e2\x0c.Hello.ColorR\x01a\x12\x1a\n\x01b\x18\x02 \x02(\x0e2\x0c.Hello.ColorR\x01b\x124\n\x0cdefault_enum\x18\x03 \x02(\x0e2\x0c.Hello.Color:\x03REDR\x0bdefaultEnum\x121\n\rrepeated_enum\x18\x04 \x03(\x0e2\x0c.Hello.ColorR\x0crepeatedEnum\x121\n\roptional_enum\x18\x05 \x01(\x0e2\x0c.Hello.ColorR\x0coptionalEnum\x12E\n\x15optional_default_enum\x18\x06 \x01(\x0e2\x0c.Hello.Color:\x03REDR\x13optionalDefaultEnum"%\n\x05Color\x12\x07\n\x03RED\x10\x01\x12\t\n\x05GREEN\x10\x02\x12\x08\n\x04BLUE\x10\x03*%\n\x05Color\x12\x07\n\x03RED\x10\x01\x12\t\n\x05GREEN\x10\x02\x12\x08\n\x04BLUE\x10\x03J\xbc\x06\n\x06\x12\x04\x00\x00\x17\x01\n\x08\n\x01\x0c\x12\x03\x00\x00\x12\n\n\n\x02\x05\x00\x12\x04\x02\x00\x06\x01\n\n\n\x03\x05\x00\x01\x12\x03\x02\x05\n\n\x0b\n\x04\x05\x00\x02\x00\x12\x03\x03\x04\x0c\n\x0c\n\x05\x05\x00\x02\x00\x01\x12\x03\x03\x04\x07\n\x0c\n\x05\x05\x00\x02\x00\x02\x12\x03\x03\n\x0b\n\x0b\n\x04\x05\x00\x02\x01\x12\x03\x04\x04\x0e\n\x0c\n\x05\x05\x00\x02\x01\x01\x12\x03\x04\x04\t\n\x0c\n\x05\x05\x00\x02\x01\x02\x12\x03\x04\x0c\r\n\x0b\n\x04\x05\x00\x02\x02\x12\x03\x05\x04\r\n\x0c\n\x05\x05\x00\x02\x02\x01\x12\x03\x05\x04\x08\n\x0c\n\x05\x05\x00\x02\x02\x02\x12\x03\x05\x0b\x0c\n\n\n\x02\x04\x00\x12\x04\x08\x00\x17\x01\n\n\n\x03\x04\x00\x01\x12\x03\x08\x08\r\n\x0c\n\x04\x04\x00\x04\x00\x12\x04\t\x04\r\x05\n\x0c\n\x05\x04\x00\x04\x00\x01\x12\x03\t\t\x0e\n\r\n\x06\x04\x00\x04\x00\x02\x00\x12\x03\n\x08\x10\n\x0e\n\x07\x04\x00\x04\x00\x02\x00\x01\x12\x03\n\x08\x0b\n\x0e\n\x07\x04\x00\x04\x00\x02\x00\x02\x12\x03\n\x0e\x0f\n\r\n\x06\x04\x00\x04\x00\x02\x01\x12\x03\x0b\x08\x12\n\x0e\n\x07\x04\x00\x04\x00\x02\x01\x01\x12\x03\x0b\x08\r\n\x0e\n\x07\x04\x00\x04\x00\x02\x01\x02\x12\x03\x0b\x10\x11\n\r\n\x06\x04\x00\x04\x00\x02\x02\x12\x03\x0c\x08\x11\n\x0e\n\x07\x04\x00\x04\x00\x02\x02\x01\x12\x03\x0c\x08\x0c\n\x0e\n\x07\x04\x00\x04\x00\x02\x02\x02\x12\x03\x0c\x0f\x10\n\x0b\n\x04\x04\x00\x02\x00\x12\x03\x0f\x04\x19\n\x0c\n\x05\x04\x00\x02\x00\x04\x12\x03\x0f\x04\x0c\n\x0c\n\x05\x04\x00\x02\x00\x06\x12\x03\x0f\r\x12\n\x0c\n\x05\x04\x00\x02\x00\x01\x12\x03\x0f\x13\x14\n\x0c\n\x05\x04\x00\x02\x00\x03\x12\x03\x0f\x17\x18\n\x0b\n\x04\x04\x00\x02\x01\x12\x03\x10\x04\x1f\n\x0c\n\x05\x04\x00\x02\x01\x04\x12\x03\x10\x04\x0c\n\x0c\n\x05\x04\x00\x02\x01\x06\x12\x03\x10\r\x18\n\x0c\n\x05\x04\x00\x02\x01\x01\x12\x03\x10\x19\x1a\n\x0c\n\x05\x04\x00\x02\x01\x03\x12\x03\x10\x1d\x1e\n\x0b\n\x04\x04\x00\x02\x02\x12\x03\x11\x04:\n\x0c\n\x05\x04\x00\x02\x02\x04\x12\x03\x11\x04\x0c\n\x0c\n\x05\x04\x00\x02\x02\x06\x12\x03\x11\r\x18\n\x0c\n\x05\x04\x00\x02\x02\x01\x12\x03\x11\x19%\n\x0c\n\x05\x04\x00\x02\x02\x03\x12\x03\x11()\n\x0c\n\x05\x04\x00\x02\x02\x08\x12\x03\x11*9\n\x0c\n\x05\x04\x00\x02\x02\x07\x12\x03\x1158\n\x0b\n\x04\x04\x00\x02\x03\x12\x03\x13\x04%\n\x0c\n\x05\x04\x00\x02\x03\x04\x12\x03\x13\x04\x0c\n\x0c\n\x05\x04\x00\x02\x03\x06\x12\x03\x13\r\x12\n\x0c\n\x05\x04\x00\x02\x03\x01\x12\x03\x13\x13 \n\x0c\n\x05\x04\x00\x02\x03\x03\x12\x03\x13#$\n\x0b\n\x04\x04\x00\x02\x04\x12\x03\x15\x04%\n\x0c\n\x05\x04\x00\x02\x04\x04\x12\x03\x15\x04\x0c\n\x0c\n\x05\x04\x00\x02\x04\x06\x12\x03\x15\r\x12\n\x0c\n\x05\x04\x00\x02\x04\x01\x12\x03\x15\x13 \n\x0c\n\x05\x04\x00\x02\x04\x03\x12\x03\x15#$\n\x0b\n\x04\x04\x00\x02\x05\x12\x03\x16\x04=\n\x0c\n\x05\x04\x00\x02\x05\x04\x12\x03\x16\x04\x0c\n\x0c\n\x05\x04\x00\x02\x05\x06\x12\x03\x16\r\x12\n\x0c\n\x05\x04\x00\x02\x05\x01\x12\x03\x16\x13(\n\x0c\n\x05\x04\x00\x02\x05\x03\x12\x03\x16+,\n\x0c\n\x05\x04\x00\x02\x05\x08\x12\x03\x16-<\n\x0c\n\x05\x04\x00\x02\x05\x07\x12\x03\x168;'
)

protox.define_fields(
    Hello,
    a=protox.EnumField(number=1, py_enum=Hello.Color, required=True),
    b=protox.EnumField(number=2, py_enum=Hello.Color, required=True),
    default_enum=protox.EnumField(number=3,
                                  py_enum=Hello.Color,
                                  default=Hello.Color.RED,
                                  required=True),
    repeated_enum=protox.Repeated(number=4, of_type=Hello.Color),
    optional_enum=protox.EnumField(number=5,
                                   py_enum=Hello.Color,
                                   required=False),
    optional_default_enum=protox.EnumField(number=6,
                                           py_enum=Hello.Color,
                                           default=Hello.Color.RED,
                                           required=False),
)
Hello.DESCRIPTOR = protox.DescriptorProto.from_bytes(
    b'\n\x05Hello\x12\x1a\n\x01a\x18\x01 \x02(\x0e2\x0c.Hello.ColorR\x01a\x12\x1a\n\x01b\x18\x02 \x02(\x0e2\x0c.Hello.ColorR\x01b\x124\n\x0cdefault_enum\x18\x03 \x02(\x0e2\x0c.Hello.Color:\x03REDR\x0bdefaultEnum\x121\n\rrepeated_enum\x18\x04 \x03(\x0e2\x0c.Hello.ColorR\x0crepeatedEnum\x121\n\roptional_enum\x18\x05 \x01(\x0e2\x0c.Hello.ColorR\x0coptionalEnum\x12E\n\x15optional_default_enum\x18\x06 \x01(\x0e2\x0c.Hello.Color:\x03REDR\x13optionalDefaultEnum"%\n\x05Color\x12\x07\n\x03RED\x10\x01\x12\t\n\x05GREEN\x10\x02\x12\x08\n\x04BLUE\x10\x03'
)
Hello.DESCRIPTOR.file_descriptor = FILE_DESCRIPTOR
Hello.DESCRIPTOR.full_name = 'Hello'
Esempio n. 4
0
import typing

import protox


class Any(protox.Message):
    type_url: typing.Optional[str]
    value: typing.Optional[bytes]

    def __init__(
        self,
        *,
        type_url: typing.Optional[str] = None,
        value: typing.Optional[bytes] = None,
    ):
        super().__init__(
            type_url=type_url,
            value=value,
        )


protox.define_fields(
    Any,
    type_url=protox.String(number=1, required=False),
    value=protox.Bytes(number=2, required=False),
)
Esempio n. 5
0
import typing

import protox


class Duration(protox.Message):
    seconds: typing.Optional[int]
    nanos: typing.Optional[int]

    def __init__(
        self,
        *,
        seconds: typing.Optional[int] = None,
        nanos: typing.Optional[int] = None,
    ):
        super().__init__(
            seconds=seconds,
            nanos=nanos,
        )


protox.define_fields(
    Duration,
    seconds=protox.Int64(number=1, required=False),
    nanos=protox.Int32(number=2, required=False),
)
Esempio n. 6
0
import typing

import protox


class SourceContext(protox.Message):
    file_name: typing.Optional[str]

    def __init__(
        self,
        *,
        file_name: typing.Optional[str] = None,
    ):
        super().__init__(file_name=file_name, )


protox.define_fields(
    SourceContext,
    file_name=protox.String(number=1, required=False),
)
Esempio n. 7
0
        return py_value


class ListValue(Message):
    values: List[Value] = Value.as_repeated(number=1)

    @classmethod
    def from_python(cls, value: Iterable) -> 'ListValue':
        return cls(
            values=[Value.from_python(x) for x in value]
        )

    def to_python(self) -> List[PyValue_T]:
        return [x.to_python() for x in self.values]


define_fields(
    Struct,
    _fields=fields.MapField(
        key=fields.String,
        value=Value,
        number=1,
    )
)

define_fields(
    Value,
    list_value=ListValue.as_field(number=6)
)
Esempio n. 8
0
    def __init__(
        self,
        *,
        error: typing.Optional[str] = None,
        file: typing.List['CodeGeneratorResponse.File'] = None,
    ):
        super().__init__(
            error=error,
            file=file,
        )


protox.define_fields(
    Version,
    major=protox.Int32(number=1, required=False),
    minor=protox.Int32(number=2, required=False),
    patch=protox.Int32(number=3, required=False),
    suffix=protox.String(number=4, required=False),
)

protox.define_fields(
    CodeGeneratorRequest,
    file_to_generate=protox.String.as_repeated(number=1),
    parameter=protox.String(number=2, required=False),
    proto_file=FileDescriptorProto.as_repeated(number=15),
    compiler_version=Version.as_field(number=3),
)

protox.define_fields(
    CodeGeneratorResponse,
    error=protox.String(number=1, required=False),
Esempio n. 9
0
        *,
        status: 'PingResponse.Status' = None,
        counter: int = None,
    ):
        super().__init__(
            status=status,
            counter=counter,
        )


FILE_DESCRIPTOR = protox.FileDescriptorProto.from_bytes(
    b'\n\x12ping_service.proto"\'\n\x0bPingRequest\x12\x18\n\x07counter\x18\x01 \x02(\x04R\x07counter"s\n\x0cPingResponse\x12,\n\x06status\x18\x01 \x02(\x0e2\x14.PingResponse.StatusR\x06status\x12\x18\n\x07counter\x18\x02 \x02(\x04R\x07counter"\x1b\n\x06Status\x12\x06\n\x02OK\x10\x01\x12\t\n\x05ERROR\x10\x0224\n\tMyService\x12\'\n\x04Ping\x12\x0c.PingRequest\x1a\r.PingResponse(\x000\x00J\xda\x03\n\x06\x12\x04\x00\x00\x12\x01\n\x08\n\x01\x0c\x12\x03\x00\x00\x12\n\n\n\x02\x04\x00\x12\x04\x02\x00\x04\x01\n\n\n\x03\x04\x00\x01\x12\x03\x02\x08\x13\n\x0b\n\x04\x04\x00\x02\x00\x12\x03\x03\x04 \n\x0c\n\x05\x04\x00\x02\x00\x04\x12\x03\x03\x04\x0c\n\x0c\n\x05\x04\x00\x02\x00\x05\x12\x03\x03\r\x13\n\x0c\n\x05\x04\x00\x02\x00\x01\x12\x03\x03\x14\x1b\n\x0c\n\x05\x04\x00\x02\x00\x03\x12\x03\x03\x1e\x1f\n\n\n\x02\x04\x01\x12\x04\x06\x00\x0e\x01\n\n\n\x03\x04\x01\x01\x12\x03\x06\x08\x14\n\x0c\n\x04\x04\x01\x04\x00\x12\x04\x07\x04\n\x05\n\x0c\n\x05\x04\x01\x04\x00\x01\x12\x03\x07\t\x0f\n\r\n\x06\x04\x01\x04\x00\x02\x00\x12\x03\x08\x08\x0f\n\x0e\n\x07\x04\x01\x04\x00\x02\x00\x01\x12\x03\x08\x08\n\n\x0e\n\x07\x04\x01\x04\x00\x02\x00\x02\x12\x03\x08\r\x0e\n\r\n\x06\x04\x01\x04\x00\x02\x01\x12\x03\t\x08\x12\n\x0e\n\x07\x04\x01\x04\x00\x02\x01\x01\x12\x03\t\x08\r\n\x0e\n\x07\x04\x01\x04\x00\x02\x01\x02\x12\x03\t\x10\x11\n\x0b\n\x04\x04\x01\x02\x00\x12\x03\x0c\x04\x1f\n\x0c\n\x05\x04\x01\x02\x00\x04\x12\x03\x0c\x04\x0c\n\x0c\n\x05\x04\x01\x02\x00\x06\x12\x03\x0c\r\x13\n\x0c\n\x05\x04\x01\x02\x00\x01\x12\x03\x0c\x14\x1a\n\x0c\n\x05\x04\x01\x02\x00\x03\x12\x03\x0c\x1d\x1e\n\x0b\n\x04\x04\x01\x02\x01\x12\x03\r\x04 \n\x0c\n\x05\x04\x01\x02\x01\x04\x12\x03\r\x04\x0c\n\x0c\n\x05\x04\x01\x02\x01\x05\x12\x03\r\r\x13\n\x0c\n\x05\x04\x01\x02\x01\x01\x12\x03\r\x14\x1b\n\x0c\n\x05\x04\x01\x02\x01\x03\x12\x03\r\x1e\x1f\n\n\n\x02\x06\x00\x12\x04\x10\x00\x12\x01\n\n\n\x03\x06\x00\x01\x12\x03\x10\x08\x11\n\x0b\n\x04\x06\x00\x02\x00\x12\x03\x11\x042\n\x0c\n\x05\x06\x00\x02\x00\x01\x12\x03\x11\x08\x0c\n\x0c\n\x05\x06\x00\x02\x00\x02\x12\x03\x11\x0e\x19\n\x0c\n\x05\x06\x00\x02\x00\x03\x12\x03\x11$0'
)

protox.define_fields(
    PingRequest,
    counter=protox.UInt64(number=1, required=True),
)
PingRequest.DESCRIPTOR = protox.DescriptorProto.from_bytes(
    b'\n\x0bPingRequest\x12\x18\n\x07counter\x18\x01 \x02(\x04R\x07counter')
PingRequest.DESCRIPTOR.file_descriptor = FILE_DESCRIPTOR
PingRequest.DESCRIPTOR.full_name = 'PingRequest'

protox.define_fields(
    PingResponse,
    status=protox.EnumField(number=1,
                            py_enum=PingResponse.Status,
                            required=True),
    counter=protox.UInt64(number=2, required=True),
)
PingResponse.DESCRIPTOR = protox.DescriptorProto.from_bytes(
    b'\n\x0cPingResponse\x12,\n\x06status\x18\x01 \x02(\x0e2\x14.PingResponse.StatusR\x06status\x12\x18\n\x07counter\x18\x02 \x02(\x04R\x07counter"\x1b\n\x06Status\x12\x06\n\x02OK\x10\x01\x12\t\n\x05ERROR\x10\x02'
Esempio n. 10
0
        self,
        *,
        name: typing.Optional[str] = None,
        root: typing.Optional[str] = None,
    ):
        super().__init__(
            name=name,
            root=root,
        )


protox.define_fields(
    Api,
    name=protox.String(number=1, required=False),
    methods=Method.as_repeated(number=2),
    options=protox.Option.as_repeated(number=3),
    version=protox.String(number=4, required=False),
    source_context=protox.SourceContext.as_field(number=5),
    mixins=Mixin.as_repeated(number=6),
    syntax=protox.EnumField(number=7, py_enum=protox.Syntax, required=False),
)

protox.define_fields(
    Method,
    name=protox.String(number=1, required=False),
    request_type_url=protox.String(number=2, required=False),
    request_streaming=protox.Bool(number=3, required=False),
    response_type_url=protox.String(number=4, required=False),
    response_streaming=protox.Bool(number=5, required=False),
    options=protox.Option.as_repeated(number=6),
    syntax=protox.EnumField(number=7, py_enum=protox.Syntax, required=False),
)
Esempio n. 11
0
            name=name,
            value=value,
        )


protox.define_fields(
    Type,
    name=protox.String(
        number=1, required=False
    ),
    fields=Field.as_repeated(
        number=2
    ),
    oneofs=protox.String.as_repeated(
        number=3
    ),
    options=Option.as_repeated(
        number=4
    ),
    source_context=SourceContext.as_field(
        number=5,
    ),
    syntax=protox.EnumField(
        number=6, py_enum=Syntax, required=False
    ),
)

protox.define_fields(
    Field,
    kind=protox.EnumField(
        number=1, py_enum=Field.Kind, required=False
Esempio n. 12
0
        super().__init__(value=value, )


class BytesValue(protox.Message):
    value: typing.Optional[bytes]

    def __init__(
        self,
        *,
        value: typing.Optional[bytes] = None,
    ):
        super().__init__(value=value, )


protox.define_fields(
    DoubleValue,
    value=protox.Double(number=1, required=False),
)

protox.define_fields(
    FloatValue,
    value=protox.Float(number=1, required=False),
)

protox.define_fields(
    Int64Value,
    value=protox.Int64(number=1, required=False),
)

protox.define_fields(
    UInt64Value,
    value=protox.UInt64(number=1, required=False),
Esempio n. 13
0
import typing

import protox


class FieldMask(protox.Message):
    paths: typing.List[str]

    def __init__(
        self,
        *,
        paths: typing.List[str] = None,
    ):
        super().__init__(paths=paths, )


protox.define_fields(
    FieldMask,
    paths=protox.String.as_repeated(number=1),
)