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); }
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); }
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); }
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(); } }
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); }
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); }
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); } }
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); } }
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); }
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); } }
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(); } }
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); }
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); }
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); }
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(); } }
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); }
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(); } }
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); } }
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(); } }
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); } }
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); } }
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); }
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); } }
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); }
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); } }