Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Commit

Permalink
Add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tdittr authored and rnijveld committed May 28, 2024
1 parent fec8721 commit 6d6a777
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/generated/models/problem.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* OpenADR 3 API
*
* The OpenADR 3 API supports energy retailer to energy customer Demand Response programs. The API includes the following capabilities and operations: __Manage programs:__ * Create/Update/Delete a program * Search programs __Manage events:__ * Create/Update/Delete an event * Search events __Manage reports:__ * Create/Update/Delete a report * Search reports __Manage subscriptions:__ * Create/Update/Delete subscriptions to programs, events, and reports * Search subscriptions * Subscriptions allows clients to register a callback URL (webhook) to be notified on the change of state of a resource __Manage vens:__ * Create/Update/Delete vens and ven resources * Search ven and ven resources __Manage tokens:__ * Obtain an access token * This endpoint is provided as a convenience and may be neglected in a commercial implementation
* The OpenADR 3 API supports energy retailer to energy customer Demand Response programs. The API includes the following capabilities and operations: __Manage programs:__ * Create/Update/Delete a program * Search programs __Manage events:__ * Create/Update/Delete an event * Search events __Manage reports:__ * Create/Update/Delete a report * Search reports __Manage subscriptions:__ * Create/Update/Delete subscriptions to programs, events, and reports * Search subscriptions * Subscriptions allows clients to register a callback URL (webhook) to be notified on the change of state of a resource __Manage vens:__ * Create/Update/Delete vens and ven resources * Search ven and ven resources __Manage tokens:__ * Obtain an access token * This endpoint is provided as a convenience and may be neglected in a commercial implementation
*
* The version of the OpenAPI document: 3.0.1
* Contact: [email protected]
Expand All @@ -10,31 +10,29 @@

use serde::{Deserialize, Serialize};

/// Problem : reusable error response. From https://opensource.zalando.com/problem/schema.yaml.


/// Problem : reusable error response. From <https://opensource.zalando.com/problem/schema.yaml>.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct Problem {
/// An absolute URI that identifies the problem type. When dereferenced, it SHOULD provide human-readable documentation for the problem type (e.g., using HTML).
/// An absolute URI that identifies the problem type. When dereferenced, it SHOULD provide human-readable documentation for the problem type (e.g., using HTML).
#[serde(rename = "type", skip_serializing_if = "Option::is_none")]
pub r#type: Option<String>,
/// A short, summary of the problem type. Written in english and readable for engineers (usually not suited for non technical stakeholders and not localized); example: Service Unavailable.
/// A short, summary of the problem type. Written in english and readable for engineers (usually not suited for non technical stakeholders and not localized); example: Service Unavailable.
#[serde(rename = "title", skip_serializing_if = "Option::is_none")]
pub title: Option<String>,
/// The HTTP status code generated by the origin server for this occurrence of the problem.
/// The HTTP status code generated by the origin server for this occurrence of the problem.
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
pub status: Option<i32>,
/// A human readable explanation specific to this occurrence of the problem.
/// A human readable explanation specific to this occurrence of the problem.
#[serde(rename = "detail", skip_serializing_if = "Option::is_none")]
pub detail: Option<String>,
/// An absolute URI that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
/// An absolute URI that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
#[serde(rename = "instance", skip_serializing_if = "Option::is_none")]
pub instance: Option<String>,
}

impl Problem {
/// reusable error response. From https://opensource.zalando.com/problem/schema.yaml.
/// reusable error response. From <https://opensource.zalando.com/problem/schema.yaml>.
pub fn new() -> Problem {
Problem {
r#type: None,
Expand All @@ -45,5 +43,3 @@ impl Problem {
}
}
}


2 changes: 2 additions & 0 deletions src/wire/event.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Types used for the event/ endpoint

use serde::{Deserialize, Serialize};

use crate::wire::{Currency, DateTime, PayloadType, Unit};
Expand Down
2 changes: 2 additions & 0 deletions src/wire/interval.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Descriptions of temporal periods

use serde::{Deserialize, Serialize};

use crate::wire::{DateTime, Duration};
Expand Down
5 changes: 5 additions & 0 deletions src/wire/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// Wire format definitions for OpenADR endpoints
use serde::{Deserialize, Serialize};

pub use event::Event;
Expand All @@ -11,20 +12,24 @@ pub mod report;
pub mod values_map;

// TODO: Replace with real ISO8601 type
/// A ISO 8601 formatted date time
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct DateTime(String);

// TODO: Replace with real ISO8601 type
/// A ISO 8601 formatted duration
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Duration(String);

// TODO: Replace with values from spec
/// A physical unit as described in Table 9 of the OpenADR Definition
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum Unit {
Todo,
}

// TODO: Find a nice ISO 4217 crate
/// A currency described as listed in ISO 4217
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum Currency {
Todo,
Expand Down
2 changes: 2 additions & 0 deletions src/wire/program.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Types used for the program/ endpoint

use serde::{Deserialize, Serialize};

use crate::wire::{DateTime, Duration};
Expand Down
2 changes: 2 additions & 0 deletions src/wire/report.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Types used for the report/ endpoint

use serde::{Deserialize, Serialize};

use crate::wire::{DateTime, PayloadType, Unit};
Expand Down
2 changes: 2 additions & 0 deletions src/wire/values_map.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Helper types to realize type values relations

use serde::{Deserialize, Serialize};

/// ValuesMap : Represents one or more values associated with a type. E.g. a type of PRICE contains a single float value.
Expand Down

0 comments on commit 6d6a777

Please sign in to comment.