Beispiel #1
0
        public JObject ToJson()
        {
            var json = new JObject();

            json["version"]         = Version?.ToJson();
            json["ownerID"]         = OwnerId?.ToJson();
            json["nonce"]           = Nonce.ToBase64();
            json["basicACL"]        = BasicAcl;
            json["attributes"]      = new JArray(Attributes.Select(p => p.ToJson()));
            json["placementPolicy"] = PlacementPolicy?.ToJson();
            return(json);
        }
Beispiel #2
0
        public JObject ToJson()
        {
            var json = new JObject();

            json["version"]         = Version?.ToJson();
            json["containerID"]     = ContainerId?.ToJson();
            json["ownerID"]         = OwnerId?.ToJson();
            json["creationEpoch"]   = CreationEpoch;
            json["payloadLength"]   = PayloadLength;
            json["payloadHash"]     = PayloadHash?.ToJson();
            json["objectType"]      = ObjectType.String();
            json["homomorphicHash"] = HomomorphicHash?.ToJson();
            json["sessionToken"]    = SessionToken?.ToJson();
            json["attributes"]      = new JArray(Attributes.Select(p => p.ToJson()));
            json["split"]           = Split?.ToJson();
            return(json);
        }
                public JObject ToJson()
                {
                    var json = new JObject();

                    json["id"]         = Id?.ToBase64();
                    json["ownerID"]    = OwnerId?.ToJson();
                    json["lifetime"]   = Lifetime?.ToJson();
                    json["sessionKey"] = SessionKey.ToBase64();
                    if (ContextCase == ContextOneofCase.Object)
                    {
                        json["object"] = Object.ToJson();
                    }
                    else if (ContextCase == ContextOneofCase.Container)
                    {
                        json["container"] = Container.ToJson();
                    }
                    return(json);
                }