示例#1
0
 public SharedNotebook CreateSharedNotebook(SharedNotebook sn)
 {
     lock (this)
         using (var httpClient = GetHttpClient())
         {
             return GetNoteStoreClient(httpClient).createSharedNotebook(this.authToken, sn);
         }
 }
示例#2
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 _list29 = iprot.ReadListBegin();
                            for (int _i30 = 0; _i30 < _list29.Count; ++_i30)
                            {
                                long _elem31 = 0;
                                _elem31 = iprot.ReadI64();
                                SharedNotebookIds.Add(_elem31);
                            }
                            iprot.ReadListEnd();
                        }
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

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

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
        }
			///** Used to construct a shared notebook object. The constructed notebook will contain a "share key" which serve as a unique identifer and access token for a user to access the notebook of the shared notebook owner.
			// @param  sharedNotebook An shared notebook object populated with the email address of the share recipient, the notebook guid and the access permissions. All other attributes of the shared object are ignored.
			// */
			public SharedNotebook CreateSharedNotebook(SharedNotebook sharedNotebook)
			{
				return Client.createSharedNotebook(AuthenticationToken(), sharedNotebook);
			}
			///** Update a SharedNotebook object.
			// @param  sharedNotebook The SharedNotebook object containing the requested changes. The "id" of the shared notebook must be set to allow the service to identify the SharedNotebook to be updated. In addition, you MUST set the email, permission, and allowPreview fields to the desired values. All other fields will be ignored if set.
			// */
			public int UpdateSharedNotebook(SharedNotebook sharedNotebook)
			{
				return Client.updateSharedNotebook(AuthenticationToken(), sharedNotebook);
			}
示例#5
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();
 }
        public void Read(TProtocol iprot)
        {
            iprot.IncrementRecursionDepth();
            try
            {
                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 _list38 = iprot.ReadListBegin();
                                for (int _i39 = 0; _i39 < _list38.Count; ++_i39)
                                {
                                    long _elem40;
                                    _elem40 = iprot.ReadI64();
                                    SharedNotebookIds.Add(_elem40);
                                }
                                iprot.ReadListEnd();
                            }
                        }
                        else
                        {
                            TProtocolUtil.Skip(iprot, field.Type);
                        }
                        break;

                    case 14:
                        if (field.Type == TType.List)
                        {
                            {
                                SharedNotebooks = new List <SharedNotebook>();
                                TList _list41 = iprot.ReadListBegin();
                                for (int _i42 = 0; _i42 < _list41.Count; ++_i42)
                                {
                                    SharedNotebook _elem43;
                                    _elem43 = new SharedNotebook();
                                    _elem43.Read(iprot);
                                    SharedNotebooks.Add(_elem43);
                                }
                                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;

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

                    default:
                        TProtocolUtil.Skip(iprot, field.Type);
                        break;
                    }
                    iprot.ReadFieldEnd();
                }
                iprot.ReadStructEnd();
            }
            finally
            {
                iprot.DecrementRecursionDepth();
            }
        }
		// Constructor for a Business notebook
		internal ENNotebook(Notebook notebook, SharedNotebook sharedNotebook, LinkedNotebook linkedNotebook)
		{
			this.Notebook = notebook;
			this.SharedNotebook = sharedNotebook;
			this.LinkedNotebook = linkedNotebook;
		}
		// Constructor for a Linked notebook
		internal ENNotebook(SharedNotebook sharedNotebook, LinkedNotebook linkedNotebook)
		{
			this.Notebook = null;
			this.SharedNotebook = sharedNotebook;
			this.LinkedNotebook = linkedNotebook;
		}
示例#9
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();
        }
		// Constructor for a Business notebook
		internal ENNotebook(Notebook notebook, SharedNotebook sharedNotebook, LinkedNotebook linkedNotebook)
		{
			Notebook = notebook;
			SharedNotebook = sharedNotebook;
			LinkedNotebook = linkedNotebook;
		}
		// Constructor for a Linked notebook
		internal ENNotebook(SharedNotebook sharedNotebook, LinkedNotebook linkedNotebook)
		{
			Notebook = null;
			SharedNotebook = sharedNotebook;
			LinkedNotebook = linkedNotebook;
		}