ib 3.0.0

A Rust client to the Interactive Brokers HTTP REST API
Documentation
/* 
 * Client Portal Web API
 *
 * Client Poral Web API
 *
 * OpenAPI spec version: 1.0.0
 * 
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 */

/// PerformanceCps : Cumulative performance data

#[allow(unused_imports)]
use serde_json::Value;

#[derive(Debug, Serialize, Deserialize)]
pub struct PerformanceCps {
  #[serde(rename = "data")]
  data: Option<Vec<::models::PerformanceCpsData>>,
  /// array of dates, the length should be same as the length of returns inside data.
  #[serde(rename = "dates")]
  dates: Option<Vec<String>>,
  /// D means Day
  #[serde(rename = "freq")]
  freq: Option<String>
}

impl PerformanceCps {
  /// Cumulative performance data
  pub fn new() -> PerformanceCps {
    PerformanceCps {
      data: None,
      dates: None,
      freq: None
    }
  }

  pub fn set_data(&mut self, data: Vec<::models::PerformanceCpsData>) {
    self.data = Some(data);
  }

  pub fn with_data(mut self, data: Vec<::models::PerformanceCpsData>) -> PerformanceCps {
    self.data = Some(data);
    self
  }

  pub fn data(&self) -> Option<&Vec<::models::PerformanceCpsData>> {
    self.data.as_ref()
  }

  pub fn reset_data(&mut self) {
    self.data = None;
  }

  pub fn set_dates(&mut self, dates: Vec<String>) {
    self.dates = Some(dates);
  }

  pub fn with_dates(mut self, dates: Vec<String>) -> PerformanceCps {
    self.dates = Some(dates);
    self
  }

  pub fn dates(&self) -> Option<&Vec<String>> {
    self.dates.as_ref()
  }

  pub fn reset_dates(&mut self) {
    self.dates = None;
  }

  pub fn set_freq(&mut self, freq: String) {
    self.freq = Some(freq);
  }

  pub fn with_freq(mut self, freq: String) -> PerformanceCps {
    self.freq = Some(freq);
    self
  }

  pub fn freq(&self) -> Option<&String> {
    self.freq.as_ref()
  }

  pub fn reset_freq(&mut self) {
    self.freq = None;
  }

}