tapis-files 0.3.0

The Tapis Files API provides for management of file resources on Tapis systems
Documentation
/*
 * Tapis Files API
 *
 * The Tapis Files API provides for management of file resources on Tapis systems
 *
 * The version of the OpenAPI document: 1.8.2
 * Contact: cicsupport@tacc.utexas.edu
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ReqTransferElement {
    #[serde(rename = "sourceURI")]
    pub source_uri: String,
    #[serde(rename = "destinationURI")]
    pub destination_uri: String,
    /// Allow the full transfer to succeed even if this element fails.
    #[serde(rename = "optional", skip_serializing_if = "Option::is_none")]
    pub optional: Option<bool>,
    /// If this value is set to anything other than TRANSFER, both the source and target MUST, be on the same tapis system.  If the value is SERVICE_MOVE_DIRECTORY_CONTENTS, the  source URI is expected to be a directory, and the contents of that directory will be transfered to the target URI.  The target must be an existing directory or the operation will fail.  If the value is SERVICE_MOVE_FILE_OR_DIRECTORY the file or directory will be moved to the target URI.  If the target already exists, it will be overwritten.
    #[serde(rename = "transferType", skip_serializing_if = "Option::is_none")]
    pub transfer_type: Option<TransferType>,
    #[serde(rename = "srcSharedCtx", skip_serializing_if = "Option::is_none")]
    pub src_shared_ctx: Option<String>,
    #[serde(rename = "destSharedCtx", skip_serializing_if = "Option::is_none")]
    pub dest_shared_ctx: Option<String>,
}

impl ReqTransferElement {
    pub fn new(source_uri: String, destination_uri: String) -> ReqTransferElement {
        ReqTransferElement {
            source_uri,
            destination_uri,
            optional: None,
            transfer_type: None,
            src_shared_ctx: None,
            dest_shared_ctx: None,
        }
    }
}
/// If this value is set to anything other than TRANSFER, both the source and target MUST, be on the same tapis system.  If the value is SERVICE_MOVE_DIRECTORY_CONTENTS, the  source URI is expected to be a directory, and the contents of that directory will be transfered to the target URI.  The target must be an existing directory or the operation will fail.  If the value is SERVICE_MOVE_FILE_OR_DIRECTORY the file or directory will be moved to the target URI.  If the target already exists, it will be overwritten.
#[derive(
    Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, Default,
)]
pub enum TransferType {
    #[serde(rename = "TRANSFER")]
    #[default]
    Transfer,
    #[serde(rename = "SERVICE_MOVE_DIRECTORY_CONTENTS")]
    ServiceMoveDirectoryContents,
    #[serde(rename = "SERVICE_MOVE_FILE_OR_DIRECTORY")]
    ServiceMoveFileOrDirectory,
}