/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { GetFolderResponse response = new GetFolderResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("CustomMetadata", targetDepth)) { var unmarshaller = new DictionaryUnmarshaller <string, string, StringUnmarshaller, StringUnmarshaller>(StringUnmarshaller.Instance, StringUnmarshaller.Instance); response.CustomMetadata = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Metadata", targetDepth)) { var unmarshaller = FolderMetadataUnmarshaller.Instance; response.Metadata = unmarshaller.Unmarshall(context); continue; } } return(response); }
public static PostFolderRequest ToPostRequest(this GetFolderResponse response) { var model = MapFolderModel(response); return(new PostFolderRequest { Data = model }); }
public static PutFolderRequest ToPutRequest(this GetFolderResponse response) { var model = MapFolderModel(response); return(new PutFolderRequest { Data = model, Id = response.Data.Id }); }
/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { GetFolderResponse response = new GetFolderResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("commitId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.CommitId = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("files", targetDepth)) { var unmarshaller = new ListUnmarshaller <File, FileUnmarshaller>(FileUnmarshaller.Instance); response.Files = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("folderPath", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.FolderPath = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("subFolders", targetDepth)) { var unmarshaller = new ListUnmarshaller <Folder, FolderUnmarshaller>(FolderUnmarshaller.Instance); response.SubFolders = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("subModules", targetDepth)) { var unmarshaller = new ListUnmarshaller <SubModule, SubModuleUnmarshaller>(SubModuleUnmarshaller.Instance); response.SubModules = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("symbolicLinks", targetDepth)) { var unmarshaller = new ListUnmarshaller <SymbolicLink, SymbolicLinkUnmarshaller>(SymbolicLinkUnmarshaller.Instance); response.SymbolicLinks = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("treeId", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.TreeId = unmarshaller.Unmarshall(context); continue; } } return(response); }
private static SaveFolderModel MapFolderModel(GetFolderResponse response) { var model = new SaveFolderModel { Version = response.Data.Version, Title = response.Data.Title, IsArchived = response.Data.IsArchived, ParentFolderId = response.Data.ParentFolderId, Type = response.Data.Type }; return(model); }
public static GetFolderResponse Unmarshall(UnmarshallerContext context) { GetFolderResponse getFolderResponse = new GetFolderResponse(); getFolderResponse.HttpResponse = context.HttpResponse; getFolderResponse.RequestId = context.StringValue("GetFolder.RequestId"); GetFolderResponse.GetFolder_Folder folder = new GetFolderResponse.GetFolder_Folder(); folder.FolderId = context.LongValue("GetFolder.Folder.FolderId"); folder.Path = context.StringValue("GetFolder.Folder.Path"); getFolderResponse.Folder = folder; return(getFolderResponse); }
public static GetFolderResponse Unmarshall(UnmarshallerContext context) { GetFolderResponse getFolderResponse = new GetFolderResponse(); getFolderResponse.HttpResponse = context.HttpResponse; getFolderResponse.RequestId = context.StringValue("GetFolder.RequestId"); getFolderResponse.Success = context.BooleanValue("GetFolder.Success"); getFolderResponse.ErrorCode = context.StringValue("GetFolder.ErrorCode"); getFolderResponse.ErrorMessage = context.StringValue("GetFolder.ErrorMessage"); getFolderResponse.HttpStatusCode = context.IntegerValue("GetFolder.HttpStatusCode"); GetFolderResponse.GetFolder_Data data = new GetFolderResponse.GetFolder_Data(); data.FolderId = context.StringValue("GetFolder.Data.FolderId"); data.FolderPath = context.StringValue("GetFolder.Data.FolderPath"); getFolderResponse.Data = data; return(getFolderResponse); }
private static SaveFolderModel MapFolderModel(GetFolderResponse response) { var model = new SaveFolderModel { Version = response.Data.Version, Title = response.Data.Title, IsArchived = response.Data.IsArchived, ParentFolderId = response.Data.ParentFolderId, Type = response.Data.Type }; return model; }