protoc-gen-salesforce-apex

module
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2024 License: BSD-3-Clause

README

protoc-gen-salesforce-apex

A Protoc plugin that generates Salesforce Apex from Protocol Buffer Definitions.

Installation

To install this Protoc plugin, simply run the following command:

go install github.com/dclappert/protoc-gen-salesforce-apex/cmd/protoc-gen-salesforce-apex@v1.0.0

Usage

To use the plugin, execute protoc with the --salesforce-apex_out flag, specifying your desired output directory:

protoc \
    --proto_path=./examples/proto \
    --salesforce-apex_out=./examples/target/classes \
    example.proto

Custom Execution Options

Customize the plugin's behavior by using the --salesforce-apex_opt flag. Set options as key-value pairs, separated by commas. For example, to use proto field names (snake_case) instead of JSON field names (lowerCamelCase), include the following flag:

protoc \
    --proto_path=./examples/proto \
    --salesforce-apex_out=./examples/target/classes \
    --salesforce-apex_opt=useProtoFieldNames=false \
    example.proto
Available Options
Option Type Description
useProtoFieldNames bool Set to true for proto field names (snake_case), or false for JSON field names (lowerCamelCase).
apiVersion string Specifies the Salesforce API version to target.

Directories

Path Synopsis
cmd
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL