MyApp

<back to all web services

QueryFileSystemFiles

Files
#![allow(
    dead_code,
    non_camel_case_types,
    non_snake_case,
    clippy::upper_case_acronyms
)]

use serde::{Deserialize, Serialize};
use serde_json::Value;
use servicestack::*;
use std::collections::HashMap;

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
#[serde(default)]
pub struct FileSystemFile {
    pub id: i32,
    #[serde(rename = "fileName")]
    pub file_name: String,
    #[serde(rename = "filePath")]
    pub file_path: String,
    #[serde(rename = "contentType")]
    pub content_type: String,
    #[serde(rename = "contentLength")]
    pub content_length: i64,
    // References(typeof(FileSystemItem))
    #[serde(rename = "fileSystemItemId")]
    pub file_system_item_id: i32,
}

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
#[serde(default)]
pub struct QueryFileSystemFiles {
    #[serde(flatten)]
    pub query_db: QueryDb,
}

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
#[serde(default)]
pub struct Todo {
    pub id: i64,
    pub text: String,
    #[serde(rename = "isFinished")]
    pub is_finished: bool,
}

Rust QueryFileSystemFiles DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /csv/reply/QueryFileSystemFiles HTTP/1.1 
Host: blazor-gallery.servicestack.net 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"skip":0,"take":0,"orderBy":"String","orderByDesc":"String","include":"String","fields":"String","meta":{"String":"String"}}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"offset":0,"total":0,"results":[{"id":0,"fileName":"String","filePath":"String","contentType":"String","contentLength":0,"fileSystemItemId":0}],"meta":{"String":"String"},"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}