UserMembershipInfo enc.IEncodable <UserMembershipInfo> .Decode(enc.IDecoder decoder)
        {
            using (var obj = decoder.GetObject())
            {
                this.AccessType = obj.GetFieldObject <AccessType>("access_type");
                this.User       = obj.GetFieldObject <UserInfo>("user");
                this.Active     = obj.GetField <bool>("active");
            }

            return(this);
        }
예제 #2
0
        BasicAccount enc.IEncodable <BasicAccount> .Decode(enc.IDecoder decoder)
        {
            using (var obj = decoder.GetObject())
            {
                this.AccountId  = obj.GetField <string>("account_id");
                this.Name       = obj.GetFieldObject <Name>("name");
                this.IsTeammate = obj.GetField <bool>("is_teammate");
            }

            return(this);
        }
예제 #3
0
        SearchResult enc.IEncodable <SearchResult> .Decode(enc.IDecoder decoder)
        {
            using (var obj = decoder.GetObject())
            {
                this.Matches = new col.List <SearchMatch>(obj.GetFieldObjectList <SearchMatch>("matches"));
                this.More    = obj.GetField <bool>("more");
                this.Start   = obj.GetField <ulong>("start");
            }

            return(this);
        }
예제 #4
0
        CreateFolderError enc.IEncodable <CreateFolderError> .Decode(enc.IDecoder decoder)
        {
            switch (decoder.GetUnionName())
            {
            case "path":
                var path = new WriteError();
                return(new Path(((enc.IEncodable <WriteError>)path).Decode(decoder)));

            default:
                throw new sys.InvalidOperationException();
            }
        }
예제 #5
0
        GetSharedLinksArg enc.IEncodable <GetSharedLinksArg> .Decode(enc.IDecoder decoder)
        {
            using (var obj = decoder.GetObject())
            {
                if (obj.HasField("path"))
                {
                    this.Path = obj.GetField <string>("path");
                }
            }

            return(this);
        }
예제 #6
0
        GroupInfo enc.IEncodable <GroupInfo> .Decode(enc.IDecoder decoder)
        {
            using (var obj = decoder.GetObject())
            {
                this.DisplayName = obj.GetField <string>("display_name");
                this.Id          = obj.GetField <string>("id");
                this.MemberCount = obj.GetField <long>("member_count");
                this.SameTeam    = obj.GetField <bool>("same_team");
            }

            return(this);
        }
예제 #7
0
        ListFolderError enc.IEncodable <ListFolderError> .Decode(enc.IDecoder decoder)
        {
            switch (decoder.GetUnionName())
            {
            case "path":
                var path = new LookupError();
                return(new Path(((enc.IEncodable <LookupError>)path).Decode(decoder)));

            default:
                return(Other.Instance);
            }
        }
예제 #8
0
        CreateSharedLinkError enc.IEncodable <CreateSharedLinkError> .Decode(enc.IDecoder decoder)
        {
            switch (decoder.GetUnionName())
            {
            case "path":
                var path = new Files.LookupError();
                return(new Path(((enc.IEncodable <Files.LookupError>)path).Decode(decoder)));

            default:
                return(Other.Instance);
            }
        }
예제 #9
0
        Name enc.IEncodable <Name> .Decode(enc.IDecoder decoder)
        {
            using (var obj = decoder.GetObject())
            {
                this.GivenName    = obj.GetField <string>("given_name");
                this.Surname      = obj.GetField <string>("surname");
                this.FamiliarName = obj.GetField <string>("familiar_name");
                this.DisplayName  = obj.GetField <string>("display_name");
            }

            return(this);
        }
예제 #10
0
        UploadError enc.IEncodable <UploadError> .Decode(enc.IDecoder decoder)
        {
            switch (decoder.GetUnionName())
            {
            case "path":
                var path = new UploadWriteFailed();
                return(new Path(((enc.IEncodable <UploadWriteFailed>)path).Decode(decoder)));

            default:
                return(Other.Instance);
            }
        }
예제 #11
0
        GetMetadataError enc.IEncodable <GetMetadataError> .Decode(enc.IDecoder decoder)
        {
            switch (decoder.GetUnionName())
            {
            case "path":
                var path = new LookupError();
                return(new Path(((enc.IEncodable <LookupError>)path).Decode(decoder)));

            default:
                throw new sys.InvalidOperationException();
            }
        }
예제 #12
0
        PreviewArg enc.IEncodable <PreviewArg> .Decode(enc.IDecoder decoder)
        {
            using (var obj = decoder.GetObject())
            {
                this.Path = obj.GetField <string>("path");
                if (obj.HasField("rev"))
                {
                    this.Rev = obj.GetField <string>("rev");
                }
            }

            return(this);
        }
        GetSharedFolderArgs enc.IEncodable <GetSharedFolderArgs> .Decode(enc.IDecoder decoder)
        {
            using (var obj = decoder.GetObject())
            {
                this.Id = obj.GetField <string>("id");
                if (obj.HasField("include_membership"))
                {
                    this.IncludeMembership = obj.GetField <bool>("include_membership");
                }
            }

            return(this);
        }
        ListFolderLongpollResult enc.IEncodable <ListFolderLongpollResult> .Decode(enc.IDecoder decoder)
        {
            using (var obj = decoder.GetObject())
            {
                this.Changes = obj.GetField <bool>("changes");
                if (obj.HasField("backoff"))
                {
                    this.Backoff = obj.GetField <ulong>("backoff");
                }
            }

            return(this);
        }
예제 #15
0
        ListFolderArg enc.IEncodable <ListFolderArg> .Decode(enc.IDecoder decoder)
        {
            using (var obj = decoder.GetObject())
            {
                this.Path = obj.GetField <string>("path");
                if (obj.HasField("recursive"))
                {
                    this.Recursive = obj.GetField <bool>("recursive");
                }
            }

            return(this);
        }
예제 #16
0
        ListRevisionsArg enc.IEncodable <ListRevisionsArg> .Decode(enc.IDecoder decoder)
        {
            using (var obj = decoder.GetObject())
            {
                this.Path = obj.GetField <string>("path");
                if (obj.HasField("limit"))
                {
                    this.Limit = obj.GetField <ulong>("limit");
                }
            }

            return(this);
        }
        ListFolderLongpollArg enc.IEncodable <ListFolderLongpollArg> .Decode(enc.IDecoder decoder)
        {
            using (var obj = decoder.GetObject())
            {
                this.Cursor = obj.GetField <string>("cursor");
                if (obj.HasField("timeout"))
                {
                    this.Timeout = obj.GetField <ulong>("timeout");
                }
            }

            return(this);
        }
        CollectionLinkMetadata enc.IEncodable <CollectionLinkMetadata> .Decode(enc.IDecoder decoder)
        {
            using (var obj = decoder.GetObject())
            {
                this.Url        = obj.GetField <string>("url");
                this.Visibility = obj.GetFieldObject <Visibility>("visibility");
                if (obj.HasField("expires"))
                {
                    this.Expires = obj.GetField <sys.DateTime>("expires");
                }
            }

            return(this);
        }
예제 #19
0
        GetMetadataError enc.IEncodable <GetMetadataError> .Decode(enc.IDecoder decoder)
        {
            switch (decoder.GetUnionName())
            {
            case "path":
                using (var obj = decoder.GetObject())
                {
                    return(new Path(obj.GetFieldObject <LookupError>("path")));
                }

            default:
                throw new sys.InvalidOperationException();
            }
        }
예제 #20
0
        FolderMetadata enc.IEncodable <FolderMetadata> .Decode(enc.IDecoder decoder)
        {
            using (var obj = decoder.GetObject())
            {
                this.Name      = obj.GetField <string>("name");
                this.PathLower = obj.GetField <string>("path_lower");
                if (obj.HasField("id"))
                {
                    this.Id = obj.GetField <string>("id");
                }
            }

            return(this);
        }
예제 #21
0
        PendingUploadMode enc.IEncodable <PendingUploadMode> .Decode(enc.IDecoder decoder)
        {
            switch (decoder.GetUnionName())
            {
            case "file":
                return(File.Instance);

            case "folder":
                return(Folder.Instance);

            default:
                throw new sys.InvalidOperationException();
            }
        }
예제 #22
0
        SharedLinkPolicy enc.IEncodable <SharedLinkPolicy> .Decode(enc.IDecoder decoder)
        {
            switch (decoder.GetUnionName())
            {
            case "all":
                return(All.Instance);

            case "members_only":
                return(MembersOnly.Instance);

            default:
                return(Other.Instance);
            }
        }
예제 #23
0
        ThumbnailFormat enc.IEncodable <ThumbnailFormat> .Decode(enc.IDecoder decoder)
        {
            switch (decoder.GetUnionName())
            {
            case "jpeg":
                return(Jpeg.Instance);

            case "png":
                return(Png.Instance);

            default:
                throw new sys.InvalidOperationException();
            }
        }
예제 #24
0
        GetSharedLinksError enc.IEncodable <GetSharedLinksError> .Decode(enc.IDecoder decoder)
        {
            switch (decoder.GetUnionName())
            {
            case "path":
                using (var obj = decoder.GetObject())
                {
                    return(new Path(obj.GetField <string>("path")));
                }

            default:
                return(Other.Instance);
            }
        }
예제 #25
0
        DownloadError enc.IEncodable <DownloadError> .Decode(enc.IDecoder decoder)
        {
            switch (decoder.GetUnionName())
            {
            case "path":
                using (var obj = decoder.GetObject())
                {
                    return(new Path(obj.GetFieldObject <LookupError>("path")));
                }

            default:
                return(Other.Instance);
            }
        }
예제 #26
0
        UserInfo enc.IEncodable <UserInfo> .Decode(enc.IDecoder decoder)
        {
            using (var obj = decoder.GetObject())
            {
                this.AccountId   = obj.GetField <string>("account_id");
                this.DisplayName = obj.GetField <string>("display_name");
                this.SameTeam    = obj.GetField <bool>("same_team");
                if (obj.HasField("member_id"))
                {
                    this.MemberId = obj.GetField <string>("member_id");
                }
            }

            return(this);
        }
예제 #27
0
        SpaceAllocation enc.IEncodable <SpaceAllocation> .Decode(enc.IDecoder decoder)
        {
            switch (decoder.GetUnionName())
            {
            case "individual":
                var individual = new IndividualSpaceAllocation();
                return(new Individual(((enc.IEncodable <IndividualSpaceAllocation>)individual).Decode(decoder)));

            case "team":
                var team = new TeamSpaceAllocation();
                return(new Team(((enc.IEncodable <TeamSpaceAllocation>)team).Decode(decoder)));

            default:
                return(Other.Instance);
            }
        }
        UploadSessionFinishError enc.IEncodable <UploadSessionFinishError> .Decode(enc.IDecoder decoder)
        {
            switch (decoder.GetUnionName())
            {
            case "lookup_failed":
                var lookupFailed = new UploadSessionLookupError();
                return(new LookupFailed(((enc.IEncodable <UploadSessionLookupError>)lookupFailed).Decode(decoder)));

            case "path":
                var path = new WriteError();
                return(new Path(((enc.IEncodable <WriteError>)path).Decode(decoder)));

            default:
                return(Other.Instance);
            }
        }
예제 #29
0
        BasicSharedFolderMetadata enc.IEncodable <BasicSharedFolderMetadata> .Decode(enc.IDecoder decoder)
        {
            using (var obj = decoder.GetObject())
            {
                this.Name             = obj.GetField <string>("name");
                this.Id               = obj.GetField <string>("id");
                this.AccessType       = obj.GetFieldObject <AccessType>("access_type");
                this.SharedLinkPolicy = obj.GetFieldObject <SharedLinkPolicy>("shared_link_policy");
                if (obj.HasField("path_lower"))
                {
                    this.PathLower = obj.GetField <string>("path_lower");
                }
            }

            return(this);
        }
예제 #30
0
        DeleteError enc.IEncodable <DeleteError> .Decode(enc.IDecoder decoder)
        {
            switch (decoder.GetUnionName())
            {
            case "path_lookup":
                var pathLookup = new LookupError();
                return(new PathLookup(((enc.IEncodable <LookupError>)pathLookup).Decode(decoder)));

            case "path_write":
                var pathWrite = new WriteError();
                return(new PathWrite(((enc.IEncodable <WriteError>)pathWrite).Decode(decoder)));

            default:
                return(Other.Instance);
            }
        }