1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
* Artifact Keeper API
*
* Enterprise artifact registry supporting 45+ package formats.
*
* The version of the OpenAPI document: 1.2.1
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// MavenComponentResponse : A Maven component grouped by GAV (groupId, artifactId, version). Each component collects the individual files (jar, pom, checksums, etc.) that share the same Maven coordinates.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct MavenComponentResponse {
/// Individual filenames belonging to this component.
#[serde(rename = "artifact_files")]
pub artifact_files: Vec<String>,
/// Maven artifactId (e.g. `junit-jupiter-api`).
#[serde(rename = "artifact_id")]
pub artifact_id: String,
/// Earliest creation timestamp among the component files.
#[serde(rename = "created_at")]
pub created_at: String,
/// Total download count across all files in this component.
#[serde(rename = "download_count")]
pub download_count: i64,
/// Repository format (always `maven` or `gradle`).
#[serde(rename = "format")]
pub format: String,
/// Maven groupId with dots (e.g. `org.junit.jupiter`).
#[serde(rename = "group_id")]
pub group_id: String,
/// Representative artifact ID (the first file in the group).
#[serde(rename = "id")]
pub id: uuid::Uuid,
/// Repository key this component belongs to.
#[serde(rename = "repository_key")]
pub repository_key: String,
/// Total size in bytes across all files in this component.
#[serde(rename = "size_bytes")]
pub size_bytes: i64,
/// Maven version string (e.g. `5.11.0`).
#[serde(rename = "version")]
pub version: String,
}
impl MavenComponentResponse {
/// A Maven component grouped by GAV (groupId, artifactId, version). Each component collects the individual files (jar, pom, checksums, etc.) that share the same Maven coordinates.
pub fn new(artifact_files: Vec<String>, artifact_id: String, created_at: String, download_count: i64, format: String, group_id: String, id: uuid::Uuid, repository_key: String, size_bytes: i64, version: String) -> MavenComponentResponse {
MavenComponentResponse {
artifact_files,
artifact_id,
created_at,
download_count,
format,
group_id,
id,
repository_key,
size_bytes,
version,
}
}
}