The above command will generate four files for the IoT service:
- _reg_dev_service_pb2.py_ and _reg_iot_plat_service_pb2.py: containing the python data models used in the IoT service file
- _reg_dev_service_pb2_grpc.py_ and _reg_iot_plat_service_pb2_grpc.py: containing all the classes and functions needed for the supported HTTP methods in the IoT API
### Go
1. Install protocol buffer compiler
```sh
$ apt install-y protobuf-compiler
```
# assuming `protoc-gen-go` has been installed with `go get -u github.com/golang/protobuf/protoc-gen-go`
mkdir /var/tmp/go/mec033
protoc --go_out=/var/tmp/go/mec033 services/*
protoc --go_out=/var/tmp/go/mec033 models/*
2. Install Go plugins for `protoc`
```sh
$ go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1
```
```sh
$ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2.0
```
3. Update `PATH` so `protoc` can find the plugins
```sh
$ export PATH="$PATH:$(go env GOPATH)/bin"
```
4. Define a go package by appending `option go_package = "./mec033.services.IoTservice";` in all .proto files like this:
> The generated `<data_model>.pb.go` files will contain all the protocol buffer code to populate, serialize, and retrieve request and response message types defined in the `models` folder.
> And the `reg_dev_service_grpc.pb.go` will contain the stubs for the methods defined in the `IoT_service.proto` file.
### Ruby
1. Install gRPC Ruby Plugin and required tools
```sh
$ gem install grpc
$ sudo apt install ruby-grpc-tools
```
2. Generate code
```sh
$ mkdir ruby-stubs
```
# assuming `grpc_tools_ruby_protoc` has been installed via `gem install grpc-tools`
Run the following command to generate `reg_dev_service_pb.rb` and `reg_dev_service_grpc_pb.rb` files, containing stub and service classes for the endpoints and methods defined in MEC033 IoT service.