Files
nym/nym-api/nym-api-requests/src/lib.rs
T
Dave Hrycyszyn f6a79ce7c3 Renaming validator-api to nym-api (#1863)
* Renaming validator-api to nym-api

* nym-api: simplified crate name

* Added nym-api rename to changelog

* Changed some output messages

* Renamed validator-api-requests to nym-api requests

* Removing more references to validator-api-requests

* Additional lockfile name changes after full build

* Removing mistakenly added merge files

* ibid

* ibid

* Getting rid of ref to validator_api deep inside validator-client

* Fixing file storage paths

* Renaming struct function names referring to validator_api

* Simplifying struct init

* Fixed up all other instances of nym_api.

* Renaming validatorApi to nymApi in TypeScript client for consistency

v

* Found a few more Rust instances

* Changed examples in TypeScript SDK

* Found one more instance of the use of validator instead of nym apis

* Aliasing config key name for deserialization to preserve compatibility with old configs
2022-12-14 15:05:01 +00:00

37 lines
700 B
Rust

// Copyright 2022 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
#[cfg(feature = "coconut")]
pub mod coconut;
pub mod models;
pub trait Deprecatable {
fn deprecate(self) -> Deprecated<Self>
where
Self: Sized,
{
self.into()
}
}
impl<T> Deprecatable for T {}
#[derive(Serialize, Deserialize, JsonSchema)]
pub struct Deprecated<T> {
pub deprecated: bool,
#[serde(flatten)]
pub response: T,
}
impl<T> From<T> for Deprecated<T> {
fn from(response: T) -> Self {
Deprecated {
deprecated: true,
response,
}
}
}