ProtocApi

<back to all web services

Protoc

The following routes are available for this service:
All Verbs/protoc/{Lang}
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using ProtocApi.ServiceModel;

namespace ProtocApi.ServiceModel
{
    public partial class Protoc
    {
        public Protoc()
        {
            Files = new Dictionary<string, string>{};
        }

        public virtual ProtocLang Lang { get; set; }
        public virtual Dictionary<string, string> Files { get; set; }
        public virtual string ProtoUrl { get; set; }
    }

    [DataContract]
    public enum ProtocLang
    {
        [EnumMember(Value="cpp")]
        Cpp,
        [EnumMember(Value="csharp")]
        CSharp,
        [EnumMember(Value="dart")]
        Dart,
        [EnumMember(Value="java")]
        Java,
        [EnumMember(Value="java-lite")]
        JavaLite,
        [EnumMember(Value="objc")]
        ObjectiveC,
        [EnumMember(Value="php")]
        Php,
        [EnumMember(Value="python")]
        Python,
        [EnumMember(Value="ruby")]
        Ruby,
        [EnumMember(Value="go")]
        Go,
        [EnumMember(Value="js-closure")]
        JavaScriptClosure,
        [EnumMember(Value="js-commonjs")]
        JavaScriptCommonJs,
        [EnumMember(Value="js-node")]
        JavaScriptNodeJs,
        [EnumMember(Value="swift")]
        Swift,
        [EnumMember(Value="ts")]
        TypeScript,
        [EnumMember(Value="ts-binary")]
        TypeScriptBinary,
    }

    public partial class ProtocResponse
    {
        public ProtocResponse()
        {
            GeneratedFiles = new Dictionary<string, string>{};
        }

        public virtual ProtocLang Lang { get; set; }
        public virtual Dictionary<string, string> GeneratedFiles { get; set; }
        public virtual string ArchiveUrl { get; set; }
        public virtual ResponseStatus ResponseStatus { get; set; }
    }

}

C# Protoc DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /protoc/{Lang} HTTP/1.1 
Host: grpc.servicestack.net 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"lang":"cpp","files":{"String":"String"},"protoUrl":"String"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"lang":"cpp","generatedFiles":{"String":"String"},"archiveUrl":"String","responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}