/*
* CKAN API
*
* Comprehensive Open Data Knowledge (CKAN) REST API for data management and publishing. CKAN is a powerful data management system that makes data accessible by providing tools to streamline publishing, sharing, finding and using data. This API provides programmatic access to all CKAN functionality including: - Dataset (Package) management - create, read, update, delete datasets - Resource management - manage files and data resources within datasets - Organization and Group management - organize datasets into logical groupings - User management - manage user accounts and permissions - Search functionality - powerful search across all data - Metadata and tagging - rich metadata and taxonomy support - Data validation and quality - ensure data integrity The API follows REST principles and returns JSON responses. Most endpoints support both GET and POST methods. ## API Versions - **API v3** (default): Main action API at `/api/3/action/{action}` - **Utility API v1/v2**: Autocomplete and utility functions at `/api/{version}/util/` - **Legacy API v1**: Basic API information at `/api/1` ## Authentication Many API calls require authentication via API key passed as: - HTTP Header: `Authorization: {api_key}` - URL Parameter: `?api_key={api_key}` - POST Data: `{\"api_key\": \"{api_key}\"}` ## Error Handling All API responses include: - `success`: Boolean indicating if the request was successful - `result`: The actual data (on success) or error details (on failure) - `help`: URL to documentation for the action Error responses include structured error information with error type and detailed messages.
*
* The version of the OpenAPI document: 3.0
*
* Generated by: https://openapi-generator.tech
*/
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Resource {
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<uuid::Uuid>,
#[serde(rename = "package_id", skip_serializing_if = "Option::is_none")]
pub package_id: Option<uuid::Uuid>,
/// URL to the resource
#[serde(rename = "url", skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
/// Description of the resource
#[serde(rename = "description", skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
/// File format (CSV, JSON, PDF, etc.)
#[serde(rename = "format", skip_serializing_if = "Option::is_none")]
pub format: Option<String>,
/// Hash of the resource file
#[serde(rename = "hash", skip_serializing_if = "Option::is_none")]
pub hash: Option<String>,
/// Name of the resource
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
/// Type of resource
#[serde(rename = "resource_type", skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
/// Type of URL (upload, api, etc.)
#[serde(rename = "url_type", skip_serializing_if = "Option::is_none")]
pub url_type: Option<String>,
/// MIME type of the resource
#[serde(rename = "mimetype", skip_serializing_if = "Option::is_none")]
pub mimetype: Option<String>,
/// Inner MIME type for compressed files
#[serde(rename = "mimetype_inner", skip_serializing_if = "Option::is_none")]
pub mimetype_inner: Option<String>,
/// Cached URL for the resource
#[serde(rename = "cache_url", skip_serializing_if = "Option::is_none")]
pub cache_url: Option<String>,
/// Size of the resource in bytes
#[serde(rename = "size", skip_serializing_if = "Option::is_none")]
pub size: Option<i32>,
#[serde(rename = "created", skip_serializing_if = "Option::is_none")]
pub created: Option<String>,
#[serde(rename = "last_modified", skip_serializing_if = "Option::is_none")]
pub last_modified: Option<String>,
#[serde(rename = "cache_last_updated", skip_serializing_if = "Option::is_none")]
pub cache_last_updated: Option<String>,
/// Whether the resource is in the datastore
#[serde(rename = "datastore_active", skip_serializing_if = "Option::is_none")]
pub datastore_active: Option<bool>,
}
impl Resource {
pub fn new() -> Resource {
Resource {
id: None,
package_id: None,
url: None,
description: None,
format: None,
hash: None,
name: None,
resource_type: None,
url_type: None,
mimetype: None,
mimetype_inner: None,
cache_url: None,
size: None,
created: None,
last_modified: None,
cache_last_updated: None,
datastore_active: None,
}
}
}