Latest version

May 19, 2018  This video is unavailable. Watch Queue Queue. Watch Queue Queue. Dec 21, 2010 Cannot uplink to SG300-10 from another switch. My device was bricked and I was able to recover it using a recovery tool and recovery firmware version 1.0.0.3 but.

Nov 17, 2016  Download OpenEmu 2.0.4 for Windows. OpenEmu for Windows is an emulator that lets you play your most popular console games. Openemu 2.0.4.

Released:

Protocol Buffers (Protobuf) support for Uplink.

1.0.0.3

Project description

uplink-protobuf makes it easy to send and receive protobuf messages over HTTP.

This library is an Uplink plugin.

Table of Contents

  • Basic Usage
  • Communicating with a JSON API

Installation

Basic Usage

Receiving Protobuf Messages

For any Consumer method that is expecting a protobuf encoded response,simply set the appropriate protobuf message type as the method's returnvalue annotation:

Then when invoked, the annotated method will appropriately decode theresponse into the specified message type:

Sending Protobuf Messages

For a Consumer method that needs to send a protobuf encoded request,simply annotate the appropriate method argument with uplink.Body:

Then when the method is invoked, the value of the annotated argument isautomatically encoded:

Communicating with a JSON API

This library also supports converting JSON responses and requeststo and from protobuf messages.

Converting JSON Responses into Protobuf Messages

uplink-protobuf can automatically convert JSON responses intoprotobuf messages if the Consumer method is annotated withreturns.from_json:

Converting Protobuf Messages into JSON Requests

uplink-protobuf can automatically convert a protobuf message intoJSON request body if the Consumer method is annotated withuplink.json:

JSON Options

There are also a few decorators we provide that allows you to controlthe JSON conversion. These decorators are available through theuplink_protobuf.json_options submodule.

Options for Sending JSON Requests

Here are options that can be used with @json, to controlthe conversion of protobuf messages to JSON objects:

  • @json_options.include_default_value_fields: This decoratorindicates that the JSON output should include fields with their defaultvalues. By default, default values are omitted if the field is not set.
  • @json_options.preserve_proto_field_names: This decorator indicatesthat the JSON output should use the proto field names as the JSON names.By default, the JSON printer converts each proto field name tolowerCamelCase and uses that as the JSON name.
  • @json_options.use_integers_for_enums: This decorator indicates thatthe JSON output should use the numerical value of a proto enum value,instead of the name of the enum value. By default, the name of anenum value is used in the JSON output.

Options for Parsing JSON Responses

Next, Here are options that can be used with @returns.json, to controlthe conversion of JSON responses to protobuf messages:

  • @json_options.ignore_unknown_fields: This decorator indicatesthat the JSON parser should ignore unknown fields in parsing.By default, the JSON parser raises an error if it encountersan unknown field.

Finally, here's an example of a Consumer that uses these options:

FAQs

  • What is Protocol Buffers?

    Checkout Google's official Protocol Buffers Developer Guide.

    “LibreOffice” and “The Document Foundation” are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Libreoffice 5.2.0.4.

  • How do I install Google's protobuf compiler, protoc?

    Checkout this guide for installation instructions with Macand Linux.

  • How do compile my .proto file using protoc?

    Refer to this sectionin the offical Protocol Buffers Developer Guide.

  • What is Uplink?

    It's a 'Declarative HTTP Client'. Checkout the library's GitHub repofor more.

Release historyRelease notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for uplink-protobuf, version 0.1.0
Filename, sizeFile typePython versionUpload dateHashes
Filename, size uplink_protobuf-0.1.0-py2.py3-none-any.whl (6.7 kB) File type Wheel Python version py2.py3 Upload dateHashes
Filename, size uplink-protobuf-0.1.0.tar.gz (8.0 kB) File type Source Python version None Upload dateHashes
Close

Hashes for uplink_protobuf-0.1.0-py2.py3-none-any.whl

Hashes for uplink_protobuf-0.1.0-py2.py3-none-any.whl
AlgorithmHash digest
SHA25669ab7485657f0a53bf1bcb57078555eb233a27feb63277374a56117e0e9f2e81
MD52e6a5daedbf276ede063cf3caa85d240
BLAKE2-25683266ee21985b19cdcd04e57630a5baafddd2c833b7cbc978f3f0fb97bae2ba7
Close

Hashes for uplink-protobuf-0.1.0.tar.gz

Hashes for uplink-protobuf-0.1.0.tar.gz
AlgorithmHash digest
SHA256aa7e1ae29f1c8c3720cd8e6582eceb4633e95a2c86248960532492a9e208ad62
MD542929391e0e572868eaa276b3620e588
BLAKE2-25628d8cf52f9f50e0e425a750f704817cf330c857d3c6bfb96212dc693fa66c9f4