Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(drs): add autogenerated models #70

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/src/clients/drs/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pub mod models;

74 changes: 74 additions & 0 deletions lib/src/clients/drs/models/access_method.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
* Data Repository Service
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.4.0
* Contact: [email protected]
* Generated by: https://openapi-generator.tech
*/

#![allow(unused_imports)]
#![allow(clippy::empty_docs)]
use crate::clients::drs::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AccessMethod {
/// Type of the access method.
#[serde(rename = "type")]
pub r#type: Type,
#[serde(rename = "access_url", skip_serializing_if = "Option::is_none")]
pub access_url: Option<Box<models::AccessMethodAccessUrl>>,
/// An arbitrary string to be passed to the `/access` method to get an `AccessURL`. This string must be unique within the scope of a single object. Note that at least one of `access_url` and `access_id` must be provided.
#[serde(rename = "access_id", skip_serializing_if = "Option::is_none")]
pub access_id: Option<String>,
/// Name of the region in the cloud service provider that the object belongs to.
#[serde(rename = "region", skip_serializing_if = "Option::is_none")]
pub region: Option<String>,
/// Availablity of file in the cloud. This label defines if this file is immediately accessible via DRS. Any delay or requirement of thawing mechanism if the file is in offline/archival storage is classified as 0 or unavailable.
#[serde(rename = "available", skip_serializing_if = "Option::is_none")]
pub available: Option<bool>,
#[serde(rename = "authorizations", skip_serializing_if = "Option::is_none")]
pub authorizations: Option<Box<models::AccessMethodAuthorizations>>,
}

impl AccessMethod {
pub fn new(r#type: Type) -> AccessMethod {
AccessMethod {
r#type,
access_url: None,
access_id: None,
region: None,
available: None,
authorizations: None,
}
}
}
/// Type of the access method.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "s3")]
S3,
#[serde(rename = "gs")]
Gs,
#[serde(rename = "ftp")]
Ftp,
#[serde(rename = "gsiftp")]
Gsiftp,
#[serde(rename = "globus")]
Globus,
#[serde(rename = "htsget")]
Htsget,
#[serde(rename = "https")]
Https,
#[serde(rename = "file")]
File,
}

impl Default for Type {
fn default() -> Type {
Self::S3
}
}

34 changes: 34 additions & 0 deletions lib/src/clients/drs/models/access_method_access_url.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Data Repository Service
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.4.0
* Contact: [email protected]
* Generated by: https://openapi-generator.tech
*/

#![allow(unused_imports)]
#![allow(clippy::empty_docs)]
use crate::clients::drs::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AccessMethodAccessUrl {
/// A fully resolvable URL that can be used to fetch the actual object bytes.
#[serde(rename = "url")]
pub url: String,
/// An optional list of headers to include in the HTTP request to `url`. These headers can be used to provide auth tokens required to fetch the object bytes.
#[serde(rename = "headers", skip_serializing_if = "Option::is_none")]
pub headers: Option<Vec<String>>,
}

impl AccessMethodAccessUrl {
pub fn new(url: String) -> AccessMethodAccessUrl {
AccessMethodAccessUrl {
url,
headers: None,
}
}
}

59 changes: 59 additions & 0 deletions lib/src/clients/drs/models/access_method_authorizations.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Data Repository Service
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.4.0
* Contact: [email protected]
* Generated by: https://openapi-generator.tech
*/

#![allow(unused_imports)]
#![allow(clippy::empty_docs)]
use crate::clients::drs::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AccessMethodAuthorizations {
#[serde(rename = "drs_object_id", skip_serializing_if = "Option::is_none")]
pub drs_object_id: Option<String>,
/// An Optional list of support authorization types. More than one can be supported and tried in sequence. Defaults to `None` if empty or missing.
#[serde(rename = "supported_types", skip_serializing_if = "Option::is_none")]
pub supported_types: Option<Vec<SupportedTypes>>,
/// If authorizations contain `PassportAuth` this is a required list of visa issuers (as found in a visa's `iss` claim) that may authorize access to this object. The caller must only provide passports that contain visas from this list. It is strongly recommended that the caller validate that it is appropriate to send the requested passport/visa to the DRS server to mitigate attacks by malicious DRS servers requesting credentials they should not have.
#[serde(rename = "passport_auth_issuers", skip_serializing_if = "Option::is_none")]
pub passport_auth_issuers: Option<Vec<String>>,
/// If authorizations contain `BearerAuth` this is an optional list of issuers that may authorize access to this object. The caller must provide a token from one of these issuers. If this is empty or missing it assumed the caller knows which token to send via other means. It is strongly recommended that the caller validate that it is appropriate to send the requested token to the DRS server to mitigate attacks by malicious DRS servers requesting credentials they should not have.
#[serde(rename = "bearer_auth_issuers", skip_serializing_if = "Option::is_none")]
pub bearer_auth_issuers: Option<Vec<String>>,
}

impl AccessMethodAuthorizations {
pub fn new() -> AccessMethodAuthorizations {
AccessMethodAuthorizations {
drs_object_id: None,
supported_types: None,
passport_auth_issuers: None,
bearer_auth_issuers: None,
}
}
}
/// An Optional list of support authorization types. More than one can be supported and tried in sequence. Defaults to `None` if empty or missing.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum SupportedTypes {
#[serde(rename = "None")]
None,
#[serde(rename = "BasicAuth")]
BasicAuth,
#[serde(rename = "BearerAuth")]
BearerAuth,
#[serde(rename = "PassportAuth")]
PassportAuth,
}

impl Default for SupportedTypes {
fn default() -> SupportedTypes {
Self::None
}
}

34 changes: 34 additions & 0 deletions lib/src/clients/drs/models/access_url.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Data Repository Service
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.4.0
* Contact: [email protected]
* Generated by: https://openapi-generator.tech
*/

#![allow(unused_imports)]
#![allow(clippy::empty_docs)]
use crate::clients::drs::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AccessUrl {
/// A fully resolvable URL that can be used to fetch the actual object bytes.
#[serde(rename = "url")]
pub url: String,
/// An optional list of headers to include in the HTTP request to `url`. These headers can be used to provide auth tokens required to fetch the object bytes.
#[serde(rename = "headers", skip_serializing_if = "Option::is_none")]
pub headers: Option<Vec<String>>,
}

impl AccessUrl {
pub fn new(url: String) -> AccessUrl {
AccessUrl {
url,
headers: None,
}
}
}

59 changes: 59 additions & 0 deletions lib/src/clients/drs/models/authorizations.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Data Repository Service
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.4.0
* Contact: [email protected]
* Generated by: https://openapi-generator.tech
*/

#![allow(unused_imports)]
#![allow(clippy::empty_docs)]
use crate::clients::drs::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Authorizations {
#[serde(rename = "drs_object_id", skip_serializing_if = "Option::is_none")]
pub drs_object_id: Option<String>,
/// An Optional list of support authorization types. More than one can be supported and tried in sequence. Defaults to `None` if empty or missing.
#[serde(rename = "supported_types", skip_serializing_if = "Option::is_none")]
pub supported_types: Option<Vec<SupportedTypes>>,
/// If authorizations contain `PassportAuth` this is a required list of visa issuers (as found in a visa's `iss` claim) that may authorize access to this object. The caller must only provide passports that contain visas from this list. It is strongly recommended that the caller validate that it is appropriate to send the requested passport/visa to the DRS server to mitigate attacks by malicious DRS servers requesting credentials they should not have.
#[serde(rename = "passport_auth_issuers", skip_serializing_if = "Option::is_none")]
pub passport_auth_issuers: Option<Vec<String>>,
/// If authorizations contain `BearerAuth` this is an optional list of issuers that may authorize access to this object. The caller must provide a token from one of these issuers. If this is empty or missing it assumed the caller knows which token to send via other means. It is strongly recommended that the caller validate that it is appropriate to send the requested token to the DRS server to mitigate attacks by malicious DRS servers requesting credentials they should not have.
#[serde(rename = "bearer_auth_issuers", skip_serializing_if = "Option::is_none")]
pub bearer_auth_issuers: Option<Vec<String>>,
}

impl Authorizations {
pub fn new() -> Authorizations {
Authorizations {
drs_object_id: None,
supported_types: None,
passport_auth_issuers: None,
bearer_auth_issuers: None,
}
}
}
/// An Optional list of support authorization types. More than one can be supported and tried in sequence. Defaults to `None` if empty or missing.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum SupportedTypes {
#[serde(rename = "None")]
None,
#[serde(rename = "BasicAuth")]
BasicAuth,
#[serde(rename = "BearerAuth")]
BearerAuth,
#[serde(rename = "PassportAuth")]
PassportAuth,
}

impl Default for SupportedTypes {
fn default() -> SupportedTypes {
Self::None
}
}

40 changes: 40 additions & 0 deletions lib/src/clients/drs/models/bulk_access_url.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Data Repository Service
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.4.0
* Contact: [email protected]
* Generated by: https://openapi-generator.tech
*/

#![allow(unused_imports)]
#![allow(clippy::empty_docs)]
use crate::clients::drs::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BulkAccessUrl {
#[serde(rename = "drs_object_id", skip_serializing_if = "Option::is_none")]
pub drs_object_id: Option<String>,
#[serde(rename = "drs_access_id", skip_serializing_if = "Option::is_none")]
pub drs_access_id: Option<String>,
/// A fully resolvable URL that can be used to fetch the actual object bytes.
#[serde(rename = "url")]
pub url: String,
/// An optional list of headers to include in the HTTP request to `url`. These headers can be used to provide auth tokens required to fetch the object bytes.
#[serde(rename = "headers", skip_serializing_if = "Option::is_none")]
pub headers: Option<Vec<String>>,
}

impl BulkAccessUrl {
pub fn new(url: String) -> BulkAccessUrl {
BulkAccessUrl {
drs_object_id: None,
drs_access_id: None,
url,
headers: None,
}
}
}

34 changes: 34 additions & 0 deletions lib/src/clients/drs/models/checksum.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Data Repository Service
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.4.0
* Contact: [email protected]
* Generated by: https://openapi-generator.tech
*/

#![allow(unused_imports)]
#![allow(clippy::empty_docs)]
use crate::clients::drs::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Checksum {
/// The hex-string encoded checksum for the data
#[serde(rename = "checksum")]
pub checksum: String,
/// The digest method used to create the checksum. The value (e.g. `sha-256`) SHOULD be listed as `Hash Name String` in the https://www.iana.org/assignments/named-information/named-information.xhtml#hash-alg[IANA Named Information Hash Algorithm Registry]. Other values MAY be used, as long as implementors are aware of the issues discussed in https://tools.ietf.org/html/rfc6920#section-9.4[RFC6920]. GA4GH may provide more explicit guidance for use of non-IANA-registered algorithms in the future. Until then, if implementers do choose such an algorithm (e.g. because it's implemented by their storage provider), they SHOULD use an existing standard `type` value such as `md5`, `etag`, `crc32c`, `trunc512`, or `sha1`.
#[serde(rename = "type")]
pub r#type: String,
}

impl Checksum {
pub fn new(checksum: String, r#type: String) -> Checksum {
Checksum {
checksum,
r#type,
}
}
}

42 changes: 42 additions & 0 deletions lib/src/clients/drs/models/contents_object.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* Data Repository Service
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.4.0
* Contact: [email protected]
* Generated by: https://openapi-generator.tech
*/

#![allow(unused_imports)]
#![allow(clippy::empty_docs)]
use crate::clients::drs::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ContentsObject {
/// A name declared by the bundle author that must be used when materialising this object, overriding any name directly associated with the object itself. The name must be unique within the containing bundle. This string is made up of uppercase and lowercase letters, decimal digits, hyphen, period, and underscore [A-Za-z0-9.-_]. See http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_282[portable filenames].
#[serde(rename = "name")]
pub name: String,
/// A DRS identifier of a `DrsObject` (either a single blob or a nested bundle). If this ContentsObject is an object within a nested bundle, then the id is optional. Otherwise, the id is required.
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
/// A list of full DRS identifier URI paths that may be used to obtain the object. These URIs may be external to this DRS instance.
#[serde(rename = "drs_uri", skip_serializing_if = "Option::is_none")]
pub drs_uri: Option<Vec<String>>,
/// If this ContentsObject describes a nested bundle and the caller specified \"?expand=true\" on the request, then this contents array must be present and describe the objects within the nested bundle.
#[serde(rename = "contents", skip_serializing_if = "Option::is_none")]
pub contents: Option<Vec<models::ContentsObject>>,
}

impl ContentsObject {
pub fn new(name: String) -> ContentsObject {
ContentsObject {
name,
id: None,
drs_uri: None,
contents: None,
}
}
}

Loading