Person pb2
Protocol buffer message and service definitions for the AddressBook pedagogical example.
This module is auto-generated from the person.proto file using the protobuf compiler. It provides Python classes for all messages and services defined in the proto file, and is intended for use in educational and demonstration contexts.
Note
This file is generated code. Manual changes (except for documentation improvements) will be overwritten if the file is regenerated.
Attributes¶
DESCRIPTOR: _descriptor.FileDescriptor = _descriptor_pool.Default().AddSerializedFile(b'\n\x0cperson.proto\x12\x06person"\x9f\x02\n\x06Person\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\x05\x12\r\n\x05email\x18\x03 \x01(\t\x12*\n\x06phones\x18\x04 \x03(\x0b2\x1a.person.Person.PhoneNumber\x1aV\n\x0bPhoneNumber\x12\x0e\n\x06number\x18\x01 \x01(\t\x127\n\x04type\x18\x02 \x01(\x0e2\x18.person.Person.PhoneType:\x0fPHONE_TYPE_HOME"h\n\tPhoneType\x12\x1a\n\x16PHONE_TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11PHONE_TYPE_MOBILE\x10\x01\x12\x13\n\x0fPHONE_TYPE_HOME\x10\x02\x12\x13\n\x0fPHONE_TYPE_WORK\x10\x03"-\n\x0bAddressBook\x12\x1e\n\x06people\x18\x01 \x03(\x0b2\x0e.person.Person"%\n\x10GetPersonRequest\x12\x11\n\tperson_id\x18\x01 \x01(\x05"3\n\x11GetPersonResponse\x12\x1e\n\x06person\x18\x01 \x01(\x0b2\x0e.person.Person"\x13\n\x11ListPeopleRequest"4\n\x12ListPeopleResponse\x12\x1e\n\x06people\x18\x01 \x03(\x0b2\x0e.person.Person"2\n\x10AddPersonRequest\x12\x1e\n\x06person\x18\x01 \x01(\x0b2\x0e.person.Person"3\n\x11AddPersonResponse\x12\x1e\n\x06person\x18\x01 \x01(\x0b2\x0e.person.Person2\xdd\x01\n\x12AddressBookService\x12@\n\tGetPerson\x12\x18.person.GetPersonRequest\x1a\x19.person.GetPersonResponse\x12C\n\nListPeople\x12\x19.person.ListPeopleRequest\x1a\x1a.person.ListPeopleResponse\x12@\n\tAddPerson\x12\x18.person.AddPersonRequest\x1a\x19.person.AddPersonResponseb\x08editionsp\xe8\x07')
module-attribute
¶
Classes¶
AddPersonRequest(person: _Optional[_Union[Person, _Mapping]] = ...)
¶
AddPersonResponse(person: _Optional[_Union[Person, _Mapping]] = ...)
¶
AddressBook(people: _Optional[_Iterable[_Union[Person, _Mapping]]] = ...)
¶
GetPersonRequest(person_id: _Optional[int] = ...)
¶
GetPersonResponse(person: _Optional[_Union[Person, _Mapping]] = ...)
¶
ListPeopleResponse(people: _Optional[_Iterable[_Union[Person, _Mapping]]] = ...)
¶
Person(name: _Optional[str] = ..., id: _Optional[int] = ..., email: _Optional[str] = ..., phones: _Optional[_Iterable[_Union[Person.PhoneNumber, _Mapping]]] = ...)
¶
Bases: Message
Represents a person in the AddressBook example.
PARAMETER | DESCRIPTION |
---|---|
name
|
The person's name. |
id
|
The unique identifier for the person. |
email
|
The person's email address. |
phones
|
A list of phone numbers for the person.
TYPE:
|
Attributes¶
EMAIL_FIELD_NUMBER: int
class-attribute
¶
ID_FIELD_NUMBER: int
class-attribute
¶
NAME_FIELD_NUMBER: int
class-attribute
¶
PHONES_FIELD_NUMBER: int
class-attribute
¶
PHONE_TYPE_HOME: Person.PhoneType
instance-attribute
¶
PHONE_TYPE_MOBILE: Person.PhoneType
instance-attribute
¶
PHONE_TYPE_UNSPECIFIED: Person.PhoneType
instance-attribute
¶
PHONE_TYPE_WORK: Person.PhoneType
instance-attribute
¶
email: str
instance-attribute
¶
id: int
instance-attribute
¶
name: str
instance-attribute
¶
phones: _containers.RepeatedCompositeFieldContainer[Person.PhoneNumber]
instance-attribute
¶
Classes¶
PhoneNumber(number: _Optional[str] = ..., type: _Optional[_Union[Person.PhoneType, str]] = ...)
¶
Bases: Message
Represents a phone number for a person.
PARAMETER | DESCRIPTION |
---|---|
number
|
The phone number as a string. |
type
|
The type of phone number (e.g., mobile, home, work). |