Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import fixed igw API #864

Merged
merged 1 commit into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cli/docs/cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -2339,7 +2339,8 @@
"long": "description"
},
{
"long": "gateway"
"long": "gateway",
"help": "Name or ID of the internet gateway"
},
{
"long": "ip-pool"
Expand Down
5 changes: 3 additions & 2 deletions cli/src/generated_cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2155,7 +2155,8 @@ impl<T: CliConfig> Cli<T> {
clap::Arg::new("gateway")
.long("gateway")
.value_parser(clap::value_parser!(types::NameOrId))
.required_unless_present("json-body"),
.required(true)
.help("Name or ID of the internet gateway"),
)
.arg(
clap::Arg::new("ip-pool")
Expand Down Expand Up @@ -8788,7 +8789,7 @@ impl<T: CliConfig> Cli<T> {
}

if let Some(value) = matches.get_one::<types::NameOrId>("gateway") {
request = request.body_map(|body| body.gateway(value.clone()))
request = request.gateway(value.clone());
}

if let Some(value) = matches.get_one::<types::NameOrId>("ip-pool") {
Expand Down
4 changes: 0 additions & 4 deletions oxide.json
Original file line number Diff line number Diff line change
Expand Up @@ -16595,9 +16595,6 @@
"description": {
"type": "string"
},
"gateway": {
"$ref": "#/components/schemas/NameOrId"
},
"ip_pool": {
"$ref": "#/components/schemas/NameOrId"
},
Expand All @@ -16607,7 +16604,6 @@
},
"required": [
"description",
"gateway",
"ip_pool",
"name"
]
Expand Down
19 changes: 0 additions & 19 deletions sdk/src/generated_sdk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13215,17 +13215,13 @@ pub mod types {
/// "type": "object",
/// "required": [
/// "description",
/// "gateway",
/// "ip_pool",
/// "name"
/// ],
/// "properties": {
/// "description": {
/// "type": "string"
/// },
/// "gateway": {
/// "$ref": "#/components/schemas/NameOrId"
/// },
/// "ip_pool": {
/// "$ref": "#/components/schemas/NameOrId"
/// },
Expand All @@ -13241,7 +13237,6 @@ pub mod types {
)]
pub struct InternetGatewayIpPoolCreate {
pub description: String,
pub gateway: NameOrId,
pub ip_pool: NameOrId,
pub name: Name,
}
Expand Down Expand Up @@ -37151,7 +37146,6 @@ pub mod types {
#[derive(Clone, Debug)]
pub struct InternetGatewayIpPoolCreate {
description: Result<String, String>,
gateway: Result<super::NameOrId, String>,
ip_pool: Result<super::NameOrId, String>,
name: Result<super::Name, String>,
}
Expand All @@ -37160,7 +37154,6 @@ pub mod types {
fn default() -> Self {
Self {
description: Err("no value supplied for description".to_string()),
gateway: Err("no value supplied for gateway".to_string()),
ip_pool: Err("no value supplied for ip_pool".to_string()),
name: Err("no value supplied for name".to_string()),
}
Expand All @@ -37178,16 +37171,6 @@ pub mod types {
.map_err(|e| format!("error converting supplied value for description: {}", e));
self
}
pub fn gateway<T>(mut self, value: T) -> Self
where
T: std::convert::TryInto<super::NameOrId>,
T::Error: std::fmt::Display,
{
self.gateway = value
.try_into()
.map_err(|e| format!("error converting supplied value for gateway: {}", e));
self
}
pub fn ip_pool<T>(mut self, value: T) -> Self
where
T: std::convert::TryInto<super::NameOrId>,
Expand Down Expand Up @@ -37217,7 +37200,6 @@ pub mod types {
) -> Result<Self, super::error::ConversionError> {
Ok(Self {
description: value.description?,
gateway: value.gateway?,
ip_pool: value.ip_pool?,
name: value.name?,
})
Expand All @@ -37228,7 +37210,6 @@ pub mod types {
fn from(value: super::InternetGatewayIpPoolCreate) -> Self {
Self {
description: Ok(value.description),
gateway: Ok(value.gateway),
ip_pool: Ok(value.ip_pool),
name: Ok(value.name),
}
Expand Down
Loading