예제 #1
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder("Notebook(");

            sb.Append("Guid: ");
            sb.Append(Guid);
            sb.Append(",Name: ");
            sb.Append(Name);
            sb.Append(",UpdateSequenceNum: ");
            sb.Append(UpdateSequenceNum);
            sb.Append(",DefaultNotebook: ");
            sb.Append(DefaultNotebook);
            sb.Append(",ServiceCreated: ");
            sb.Append(ServiceCreated);
            sb.Append(",ServiceUpdated: ");
            sb.Append(ServiceUpdated);
            sb.Append(",Publishing: ");
            sb.Append(Publishing == null ? "<null>" : Publishing.ToString());
            sb.Append(",Published: ");
            sb.Append(Published);
            sb.Append(",Stack: ");
            sb.Append(Stack);
            sb.Append(",SharedNotebookIds: ");
            sb.Append(SharedNotebookIds);
            sb.Append(",SharedNotebooks: ");
            sb.Append(SharedNotebooks);
            sb.Append(",BusinessNotebook: ");
            sb.Append(BusinessNotebook == null ? "<null>" : BusinessNotebook.ToString());
            sb.Append(",Contact: ");
            sb.Append(Contact == null ? "<null>" : Contact.ToString());
            sb.Append(",Restrictions: ");
            sb.Append(Restrictions == null ? "<null>" : Restrictions.ToString());
            sb.Append(")");
            return(sb.ToString());
        }
예제 #2
0
        public void Write(TProtocol oprot)
        {
            TStruct struc = new TStruct("Notebook");

            oprot.WriteStructBegin(struc);
            TField field = new TField();

            if (Guid != null && __isset.guid)
            {
                field.Name = "guid";
                field.Type = TType.String;
                field.ID   = 1;
                oprot.WriteFieldBegin(field);
                oprot.WriteString(Guid);
                oprot.WriteFieldEnd();
            }
            if (Name != null && __isset.name)
            {
                field.Name = "name";
                field.Type = TType.String;
                field.ID   = 2;
                oprot.WriteFieldBegin(field);
                oprot.WriteString(Name);
                oprot.WriteFieldEnd();
            }
            if (__isset.updateSequenceNum)
            {
                field.Name = "updateSequenceNum";
                field.Type = TType.I32;
                field.ID   = 5;
                oprot.WriteFieldBegin(field);
                oprot.WriteI32(UpdateSequenceNum);
                oprot.WriteFieldEnd();
            }
            if (__isset.defaultNotebook)
            {
                field.Name = "defaultNotebook";
                field.Type = TType.Bool;
                field.ID   = 6;
                oprot.WriteFieldBegin(field);
                oprot.WriteBool(DefaultNotebook);
                oprot.WriteFieldEnd();
            }
            if (__isset.serviceCreated)
            {
                field.Name = "serviceCreated";
                field.Type = TType.I64;
                field.ID   = 7;
                oprot.WriteFieldBegin(field);
                oprot.WriteI64(ServiceCreated);
                oprot.WriteFieldEnd();
            }
            if (__isset.serviceUpdated)
            {
                field.Name = "serviceUpdated";
                field.Type = TType.I64;
                field.ID   = 8;
                oprot.WriteFieldBegin(field);
                oprot.WriteI64(ServiceUpdated);
                oprot.WriteFieldEnd();
            }
            if (Publishing != null && __isset.publishing)
            {
                field.Name = "publishing";
                field.Type = TType.Struct;
                field.ID   = 10;
                oprot.WriteFieldBegin(field);
                Publishing.Write(oprot);
                oprot.WriteFieldEnd();
            }
            if (__isset.published)
            {
                field.Name = "published";
                field.Type = TType.Bool;
                field.ID   = 11;
                oprot.WriteFieldBegin(field);
                oprot.WriteBool(Published);
                oprot.WriteFieldEnd();
            }
            if (Stack != null && __isset.stack)
            {
                field.Name = "stack";
                field.Type = TType.String;
                field.ID   = 12;
                oprot.WriteFieldBegin(field);
                oprot.WriteString(Stack);
                oprot.WriteFieldEnd();
            }
            if (SharedNotebookIds != null && __isset.sharedNotebookIds)
            {
                field.Name = "sharedNotebookIds";
                field.Type = TType.List;
                field.ID   = 13;
                oprot.WriteFieldBegin(field);
                {
                    oprot.WriteListBegin(new TList(TType.I64, SharedNotebookIds.Count));
                    foreach (long _iter40 in SharedNotebookIds)
                    {
                        oprot.WriteI64(_iter40);
                        oprot.WriteListEnd();
                    }
                }
                oprot.WriteFieldEnd();
            }
            if (SharedNotebooks != null && __isset.sharedNotebooks)
            {
                field.Name = "sharedNotebooks";
                field.Type = TType.List;
                field.ID   = 14;
                oprot.WriteFieldBegin(field);
                {
                    oprot.WriteListBegin(new TList(TType.Struct, SharedNotebooks.Count));
                    foreach (SharedNotebook _iter41 in SharedNotebooks)
                    {
                        _iter41.Write(oprot);
                        oprot.WriteListEnd();
                    }
                }
                oprot.WriteFieldEnd();
            }
            if (BusinessNotebook != null && __isset.businessNotebook)
            {
                field.Name = "businessNotebook";
                field.Type = TType.Struct;
                field.ID   = 15;
                oprot.WriteFieldBegin(field);
                BusinessNotebook.Write(oprot);
                oprot.WriteFieldEnd();
            }
            if (Contact != null && __isset.contact)
            {
                field.Name = "contact";
                field.Type = TType.Struct;
                field.ID   = 16;
                oprot.WriteFieldBegin(field);
                Contact.Write(oprot);
                oprot.WriteFieldEnd();
            }
            if (Restrictions != null && __isset.restrictions)
            {
                field.Name = "restrictions";
                field.Type = TType.Struct;
                field.ID   = 17;
                oprot.WriteFieldBegin(field);
                Restrictions.Write(oprot);
                oprot.WriteFieldEnd();
            }
            oprot.WriteFieldStop();
            oprot.WriteStructEnd();
        }
예제 #3
0
        public void Read(TProtocol iprot)
        {
            TField field;

            iprot.ReadStructBegin();
            while (true)
            {
                field = iprot.ReadFieldBegin();
                if (field.Type == TType.Stop)
                {
                    break;
                }
                switch (field.ID)
                {
                case 1:
                    if (field.Type == TType.String)
                    {
                        Guid = iprot.ReadString();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 2:
                    if (field.Type == TType.String)
                    {
                        Name = iprot.ReadString();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 5:
                    if (field.Type == TType.I32)
                    {
                        UpdateSequenceNum = iprot.ReadI32();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 6:
                    if (field.Type == TType.Bool)
                    {
                        DefaultNotebook = iprot.ReadBool();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 7:
                    if (field.Type == TType.I64)
                    {
                        ServiceCreated = iprot.ReadI64();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 8:
                    if (field.Type == TType.I64)
                    {
                        ServiceUpdated = iprot.ReadI64();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 10:
                    if (field.Type == TType.Struct)
                    {
                        Publishing = new Publishing();
                        Publishing.Read(iprot);
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 11:
                    if (field.Type == TType.Bool)
                    {
                        Published = iprot.ReadBool();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 12:
                    if (field.Type == TType.String)
                    {
                        Stack = iprot.ReadString();
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 13:
                    if (field.Type == TType.List)
                    {
                        {
                            SharedNotebookIds = new List <long>();
                            TList _list34 = iprot.ReadListBegin();
                            for (int _i35 = 0; _i35 < _list34.Count; ++_i35)
                            {
                                long _elem36 = 0;
                                _elem36 = iprot.ReadI64();
                                SharedNotebookIds.Add(_elem36);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 14:
                    if (field.Type == TType.List)
                    {
                        {
                            SharedNotebooks = new List <SharedNotebook>();
                            TList _list37 = iprot.ReadListBegin();
                            for (int _i38 = 0; _i38 < _list37.Count; ++_i38)
                            {
                                SharedNotebook _elem39 = new SharedNotebook();
                                _elem39 = new SharedNotebook();
                                _elem39.Read(iprot);
                                SharedNotebooks.Add(_elem39);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 15:
                    if (field.Type == TType.Struct)
                    {
                        BusinessNotebook = new BusinessNotebook();
                        BusinessNotebook.Read(iprot);
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 16:
                    if (field.Type == TType.Struct)
                    {
                        Contact = new User();
                        Contact.Read(iprot);
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 17:
                    if (field.Type == TType.Struct)
                    {
                        Restrictions = new NotebookRestrictions();
                        Restrictions.Read(iprot);
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
        }