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

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
rnijveld committed May 28, 2024
1 parent d0f3624 commit bca2f90
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 37 deletions.
2 changes: 1 addition & 1 deletion src/generated/mod.rs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pub mod models;
pub mod models;
9 changes: 2 additions & 7 deletions src/generated/models/notification_object.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 @@ -12,13 +12,9 @@ use serde::{Deserialize, Serialize};

/// NotificationObject : the object that is the subject of the notification.


#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
#[serde(tag = "objecttype")]
pub struct NotificationObject {
}


pub struct NotificationObject {}

/// Used as discriminator, e.g. notification.object
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
Expand All @@ -32,4 +28,3 @@ impl Default for ObjectType {
Self::Resource
}
}

9 changes: 2 additions & 7 deletions src/generated/models/object_types.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/*
* 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]
* Generated by: https://openapi-generator.tech
*/

use std::fmt::Display;
use serde::{Deserialize, Serialize};
use std::fmt::Display;

/// ObjectTypes : Types of objects addressable through API.

Expand All @@ -28,7 +28,6 @@ pub enum ObjectTypes {
Ven,
#[serde(rename = "RESOURCE")]
Resource,

}

impl Display for ObjectTypes {
Expand All @@ -50,7 +49,3 @@ impl Default for ObjectTypes {
Self::Program
}
}




11 changes: 2 additions & 9 deletions src/generated/models/point.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 @@ -12,8 +12,6 @@ use serde::{Deserialize, Serialize};

/// Point : A pair of floats typically used as a point on a 2 dimensional grid.



#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct Point {
/// A value on an x axis.
Expand All @@ -27,11 +25,6 @@ pub struct Point {
impl Point {
/// A pair of floats typically used as a point on a 2 dimensional grid.
pub fn new(x: f32, y: f32) -> Point {
Point {
x,
y,
}
Point { x, y }
}
}


15 changes: 8 additions & 7 deletions src/generated/models/subscription_object_operations_inner.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
/*
* 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]
* Generated by: https://openapi-generator.tech
*/

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

/// SubscriptionObjectOperationsInner : object type, operations, and callbackUrl.



#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct SubscriptionObjectOperationsInner {
/// list of objects to subscribe to.
Expand All @@ -26,14 +24,18 @@ pub struct SubscriptionObjectOperationsInner {
/// User provided webhook URL.
#[serde(rename = "callbackUrl")]
pub callback_url: String,
/// User provided token. To avoid custom integrations, callback endpoints should accept the provided bearer token to authenticate VTN requests.
/// User provided token. To avoid custom integrations, callback endpoints should accept the provided bearer token to authenticate VTN requests.
#[serde(rename = "bearerToken", skip_serializing_if = "Option::is_none")]
pub bearer_token: Option<String>,
}

impl SubscriptionObjectOperationsInner {
/// object type, operations, and callbackUrl.
pub fn new(objects: Vec<ObjectTypes>, operations: Vec<Operations>, callback_url: String) -> SubscriptionObjectOperationsInner {
pub fn new(
objects: Vec<ObjectTypes>,
operations: Vec<Operations>,
callback_url: String,
) -> SubscriptionObjectOperationsInner {
SubscriptionObjectOperationsInner {
objects,
operations,
Expand Down Expand Up @@ -61,4 +63,3 @@ impl Default for Operations {
Self::Get
}
}

4 changes: 2 additions & 2 deletions src/wire/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

use serde::{Deserialize, Serialize};

use crate::wire::{Currency, DateTime, PayloadType, Unit};
use crate::wire::interval::{Interval, IntervalPeriod};
use crate::wire::program::ProgramId;
use crate::wire::report::ReportDescriptor;
use crate::wire::values_map::ValuesMap;
use crate::wire::{Currency, DateTime, PayloadType, Unit};

/// Event object to communicate a Demand Response request to VEN. If intervalPeriod is present, sets
/// start time and duration of intervals.
Expand Down Expand Up @@ -120,8 +120,8 @@ impl EventPayloadDescriptor {

#[cfg(test)]
mod tests {
use crate::wire::Duration;
use crate::wire::values_map::{Value, ValueType};
use crate::wire::Duration;

use super::*;

Expand Down
2 changes: 1 addition & 1 deletion src/wire/interval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

use serde::{Deserialize, Serialize};

use crate::wire::{DateTime, Duration};
use crate::wire::values_map::ValuesMap;
use crate::wire::{DateTime, Duration};

/// An object defining a temporal window and a list of valuesMaps. if intervalPeriod present may set
/// temporal aspects of interval or override event.intervalPeriod.
Expand Down
2 changes: 1 addition & 1 deletion src/wire/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

use serde::{Deserialize, Serialize};

use crate::wire::{DateTime, Duration};
use crate::wire::event::EventPayloadDescriptor;
use crate::wire::interval::IntervalPeriod;
use crate::wire::report::ReportPayloadDescriptor;
use crate::wire::values_map::ValuesMap;
use crate::wire::{DateTime, Duration};

pub type Programs = Vec<Program>;

Expand Down
4 changes: 2 additions & 2 deletions src/wire/report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

use serde::{Deserialize, Serialize};

use crate::wire::{DateTime, PayloadType, Unit};
use crate::wire::event::EventId;
use crate::wire::interval::{Interval, IntervalPeriod};
use crate::wire::program::ProgramId;
use crate::wire::values_map::ValuesMap;
use crate::wire::{DateTime, PayloadType, Unit};

/// report object.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
Expand Down Expand Up @@ -233,8 +233,8 @@ pub struct Confidence(u8);

#[cfg(test)]
mod tests {
use crate::wire::Duration;
use crate::wire::values_map::{Value, ValueType};
use crate::wire::Duration;

use super::*;

Expand Down

0 comments on commit bca2f90

Please sign in to comment.