feat: add Rust code examples and support for Rust syntax highlighting
- Added Rust syntax highlighting to the Fence component. - Updated Markdoc functions to clone React elements with unique keys for copy and example sections. - Included Rust code examples for various API endpoints in documentation: - `get_app_by_id` - `get_apps` - `get_apps_by_ids` - `connectivity` - `get_field_by_id` - `get_fields_by_app` - `get_fields_by_ids` - `add_file` - `delete_file_by_id` - `get_file_by_id` - `get_file_info_by_id` - `delete_list_value_by_id` - `save_list_value` - `delete_record_by_id` - `delete_records_by_ids` - `get_record_by_id` - `get_records_by_app` - `get_records_by_ids` - `get_records_by_query` - `save_record` - `get_report_by_id` - `get_reports_by_app`
This commit is contained in:
@@ -96,6 +96,31 @@ print(f'Status Code: {response.statusCode}')
|
||||
print(f'File Id: {response.data.id}')
|
||||
```
|
||||
|
||||
```rust
|
||||
use onspring::{OnspringClient, SaveFileRequest};
|
||||
|
||||
let client = OnspringClient::builder(
|
||||
"000000ffffff000000ffffff/00000000-ffff-0000-ffff-000000000000"
|
||||
)
|
||||
.build();
|
||||
|
||||
let request = SaveFileRequest {
|
||||
record_id: 140,
|
||||
field_id: 6989,
|
||||
notes: Some(
|
||||
"Updating record with attachment.".to_string()
|
||||
),
|
||||
modified_date: Some(chrono::Utc::now()),
|
||||
file_name: "test-attachment.txt".to_string(),
|
||||
file_data: std::fs::read("test-attachment.txt")?,
|
||||
content_type: "text/plain".to_string(),
|
||||
};
|
||||
|
||||
let response = client.upload_file(request).await?;
|
||||
|
||||
println!("New File Id is: {}", response.id);
|
||||
```
|
||||
|
||||
{% /code %}
|
||||
|
||||
{% code heading="RESPONSE" defaultLanguage="json" %}
|
||||
|
||||
Reference in New Issue
Block a user