| Crates.io | meegle-sdk |
| lib.rs | meegle-sdk |
| version | 0.0.1 |
| created_at | 2025-02-23 07:08:01.929766+00 |
| updated_at | 2025-02-23 07:08:01.929766+00 |
| description | meegle |
| homepage | |
| repository | https://github.com/boenfu/meegle-sdk |
| max_upload_size | |
| id | 1566112 |
| size | 436,519 |
A powerful and user-friendly Rust SDK for interacting with the Meegle OpenAPI. This SDK provides a comprehensive set of tools for managing work items, workflows, and project resources.
Add this to your Cargo.toml:
[dependencies]
meegle-sdk = "0.0.1"
use meegle_sdk::Client;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Initialize client with plugin credentials
let client = Client::builder()
.plugin_id("your-plugin-id")
.plugin_secret("your-plugin-secret")
.build()?;
// Or initialize with user token
let client = Client::new("your-api-token");
// Use the client to interact with the API
let projects = client
.list_projects(ListProjectRequest::default(), AuthType::User {
token: "your-token".to_string()
})
.await?;
Ok(())
}
The SDK provides the following API modules:
// Create a work item
client.create_work_item(project_key, request, auth).await?;
// Update a work item
client.update_work_item(project_key, work_item_type_key, work_item_id, request, auth).await?;
// Delete a work item
client.delete_work_item(project_key, work_item_type_key, work_item_id, auth).await?;
// Search work items
client.filter_work_items_in_project(project_key, request, auth).await?;
// Get work item details
client.get_work_item_details(project_key, work_item_type_key, request, auth).await?;
// Get workflow details
client.get_workflow_detail(project_key, work_item_type_key, work_item_id, request, auth).await?;
// Update node information
client.update_node(project_key, work_item_type_key, work_item_id, node_id, request, auth).await?;
// Change state
client.change_state(project_key, work_item_type_key, work_item_id, request, auth).await?;
// Upload a file
client.upload_file(request, auth).await?;
// Download a work item file
client.download_work_item_file(request, auth).await?;
// Delete a file
client.delete_file(request, auth).await?;
// List projects
client.list_projects(request, auth).await?;
// Get project details
client.get_projects_detail(request, auth).await?;
// Get business line details
client.get_business_list(request, auth).await?;
For more detailed examples and API documentation, please visit our API Documentation.
The SDK can be configured through environment variables or direct configuration:
let client = Client::builder()
.base_url("https://your-api-endpoint.com")
.timeout(Duration::from_secs(30))
.build()?;
The SDK provides comprehensive error handling:
use meegle_sdk::error::ApiError;
match client.get_work_item_details(project_key, work_item_type_key, request, auth).await {
Ok(details) => println!("Work item details: {:?}", details),
Err(ApiError::RequestError(e)) => eprintln!("Request error: {}", e),
Err(ApiError::ResponseError(e)) => eprintln!("Response error: {}", e),
Err(e) => eprintln!("Other error: {}", e),
}
We welcome contributions! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)This project is licensed under the MIT License - see the LICENSE file for details.
Thanks to all the developers who have contributed to this project!