tapis-files 0.3.1

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 HeaderByteRange {
    #[serde(rename = "min", skip_serializing_if = "Option::is_none")]
    pub min: Option<i64>,
    #[serde(rename = "max", skip_serializing_if = "Option::is_none")]
    pub max: Option<i64>,
}

impl HeaderByteRange {
    pub fn new() -> HeaderByteRange {
        HeaderByteRange {
            min: None,
            max: None,
        }
    }
}

impl std::fmt::Display for HeaderByteRange {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        let min = self.min.map(|v| v.to_string()).unwrap_or_default();
        let max = self.max.map(|v| v.to_string()).unwrap_or_default();
        write!(f, "bytes={}-{}", min, max)
    }
}