Skip to content

Commit

Permalink
Merge pull request #191 from peridio/ENG-3482
Browse files Browse the repository at this point in the history
custom ids
  • Loading branch information
andresperi authored Sep 17, 2024
2 parents a8cc07a + 8c89926 commit 1dc1075
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ name = "peridio-cli"
description = "Peridio CLI"
homepage = "https://peridio.com"
repository = "https://github.com/peridio/peridio-cli"
version = "0.25.2"
version = "0.26.0"
edition = "2021"

[dependencies]
peridio-sdk = { git = "https://github.com/peridio/peridio-rust.git", tag = "0.1.0" }
peridio-sdk = { git = "https://github.com/peridio/peridio-rust.git", tag = "0.2.0" }
serde_json = "1.0.125"
snafu = "0.8.4"
tokio = { version = "1.39.3", features = ["full"] }
Expand Down
5 changes: 5 additions & 0 deletions src/api/artifact_versions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ pub struct CreateCommand {
#[arg(long)]
description: Option<String>,

/// A user provided custom UUID id for the artifact version database record.
#[arg(long)]
id: Option<String>,

/// The version as a string.
#[arg(long)]
version: String,
Expand All @@ -57,6 +61,7 @@ impl Command<CreateCommand> {
artifact_prn: self.inner.artifact_prn,
custom_metadata: maybe_json(self.inner.custom_metadata),
description: self.inner.description,
id: self.inner.id,
version: self.inner.version,
};

Expand Down
5 changes: 5 additions & 0 deletions src/api/artifacts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ pub struct CreateCommand {
#[arg(long)]
description: Option<String>,

/// A user provided custom UUID id for the artifact database record.
#[arg(long)]
id: Option<String>,

/// The resource's name, meant to be displayable to users.
#[arg(long)]
name: String,
Expand All @@ -57,6 +61,7 @@ impl Command<CreateCommand> {
let params = CreateArtifactParams {
custom_metadata: maybe_json(self.inner.custom_metadata),
description: self.inner.description,
id: self.inner.id,
name: self.inner.name,
organization_prn: self.inner.organization_prn,
};
Expand Down
5 changes: 5 additions & 0 deletions src/api/binaries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ pub struct CreateCommand {
)]
hash: Option<String>,

/// A user provided custom UUID id for the binary database record.
#[arg(long)]
id: Option<String>,

/// The expected size in bytes of the binary.
#[arg(
long,
Expand Down Expand Up @@ -605,6 +609,7 @@ impl CreateCommand {
custom_metadata: maybe_json(self.custom_metadata.clone()),
description: self.description.clone(),
hash,
id: self.id.clone(),
size,
target: self.target.clone(),
};
Expand Down
5 changes: 5 additions & 0 deletions src/api/bundles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ pub struct CreateCommand {
#[clap(short, long, value_parser, num_args = 1.., value_delimiter = ' ')]
artifact_version_prns: Vec<String>,

/// A user provided custom UUID id for the bundle database record.
#[arg(long)]
id: Option<String>,

/// The PRN of the organization to create the bundle for.
#[arg(long)]
organization_prn: String,
Expand All @@ -50,6 +54,7 @@ impl Command<CreateCommand> {
async fn run(self, global_options: GlobalOptions) -> Result<(), Error> {
let params = CreateBundleParams {
artifact_version_prns: self.inner.artifact_version_prns,
id: self.inner.id,
organization_prn: self.inner.organization_prn,
name: self.inner.name,
};
Expand Down

0 comments on commit 1dc1075

Please sign in to comment.