From 360a17d6c368d0cdb8ba6c594dc597493158a7c4 Mon Sep 17 00:00:00 2001 From: Andrzej Ressel Date: Sun, 15 Dec 2024 20:58:04 +0100 Subject: [PATCH] Fix oneof with String --- .github/workflows/build.yml | 10 + .github/workflows/deploy.yaml | 10 + pulumi_wasm_generator_lib/src/model.rs | 20 +- pulumi_wasm_generator_lib/src/schema.rs | 55 +- .../output/output-funcs-edgeorder/Cargo.toml | 21 + .../output-funcs-edgeorder/lib/Cargo.toml | 12 + .../lib/src/function/list_configurations.rs | 44 + .../lib/src/function/list_product_families.rs | 48 + .../lib/src/function/mod.rs | 2 + .../output-funcs-edgeorder/lib/src/lib.rs | 22 + .../lib/src/resource/mod.rs | 0 .../availability_information_response.rs | 18 + .../types/billing_meter_details_response.rs | 22 + .../lib/src/types/configuration_filters.rs | 14 + .../lib/src/types/configuration_response.rs | 42 + .../src/types/cost_information_response.rs | 14 + .../types/customer_subscription_details.rs | 18 + ...stomer_subscription_registered_features.rs | 14 + .../lib/src/types/description_response.rs | 30 + .../lib/src/types/dimensions_response.rs | 34 + .../lib/src/types/filterable_property.rs | 14 + .../src/types/filterable_property_response.rs | 14 + .../lib/src/types/hierarchy_information.rs | 22 + .../types/hierarchy_information_response.rs | 22 + .../src/types/image_information_response.rs | 14 + .../lib/src/types/link_response.rs | 14 + .../lib/src/types/mod.rs | 45 + .../src/types/pav_2_meter_details_response.rs | 23 + .../lib/src/types/product_family_response.rs | 38 + .../lib/src/types/product_line_response.rs | 38 + .../lib/src/types/product_response.rs | 38 + .../types/purchase_meter_details_response.rs | 31 + .../lib/src/types/specification_response.rs | 14 + .../lib/src/types/supported_filter_types.rs | 9 + .../lib/wit/deps/pulumi-wasm.wit | 59 ++ .../output-funcs-edgeorder/lib/wit/world.wit | 55 ++ .../provider/Cargo.toml | 23 + .../src/function/list_configurations.rs | 34 + .../src/function/list_product_families.rs | 35 + .../provider/src/function/mod.rs | 2 + .../provider/src/lib.rs | 10 + .../provider/src/resource/mod.rs | 0 .../provider/wit/deps/pulumi-wasm.wit | 59 ++ .../provider/wit/world.wit | 55 ++ .../rust-toolchain.toml | 3 + .../output/output-funcs-edgeorder/schema.json | 856 ++++++++++++++++++ .../output/output-funcs-edgeorder/src/lib.rs | 0 pulumi_wasm_generator_lib/tests/test.rs | 2 - pulumi_wasm_provider_common/src/oneof.rs | 4 +- 49 files changed, 1966 insertions(+), 17 deletions(-) create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/Cargo.toml create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/Cargo.toml create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/function/list_configurations.rs create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/function/list_product_families.rs create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/function/mod.rs create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/lib.rs create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/resource/mod.rs create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/availability_information_response.rs create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/billing_meter_details_response.rs create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/configuration_filters.rs create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/configuration_response.rs create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/cost_information_response.rs create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/customer_subscription_details.rs create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/customer_subscription_registered_features.rs create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/description_response.rs create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/dimensions_response.rs create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/filterable_property.rs create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/filterable_property_response.rs create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/hierarchy_information.rs create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/hierarchy_information_response.rs create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/image_information_response.rs create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/link_response.rs create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/mod.rs create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/pav_2_meter_details_response.rs create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/product_family_response.rs create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/product_line_response.rs create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/product_response.rs create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/purchase_meter_details_response.rs create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/specification_response.rs create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/supported_filter_types.rs create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/wit/deps/pulumi-wasm.wit create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/wit/world.wit create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/provider/Cargo.toml create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/provider/src/function/list_configurations.rs create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/provider/src/function/list_product_families.rs create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/provider/src/function/mod.rs create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/provider/src/lib.rs create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/provider/src/resource/mod.rs create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/provider/wit/deps/pulumi-wasm.wit create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/provider/wit/world.wit create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/rust-toolchain.toml create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/schema.json create mode 100644 pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/src/lib.rs diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 68f56c58c..c21a2aa9b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -93,7 +93,12 @@ jobs: workspaces: | ./ pulumi_wasm_generator_lib/tests/output/cyclic-types/ + pulumi_wasm_generator_lib/tests/output/functions-secrets/ pulumi_wasm_generator_lib/tests/output/mini-awsnative/ + pulumi_wasm_generator_lib/tests/output/output-funcs/ + pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/ + pulumi_wasm_generator_lib/tests/output/unions-inline/ + pulumi_wasm_generator_lib/tests/output/unions-inside-arrays/ - name: Regenerate provider list run: just regenerate-provider-list - name: Check @@ -204,7 +209,12 @@ jobs: workspaces: | ./ pulumi_wasm_generator_lib/tests/output/cyclic-types/ + pulumi_wasm_generator_lib/tests/output/functions-secrets/ pulumi_wasm_generator_lib/tests/output/mini-awsnative/ + pulumi_wasm_generator_lib/tests/output/output-funcs/ + pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/ + pulumi_wasm_generator_lib/tests/output/unions-inline/ + pulumi_wasm_generator_lib/tests/output/unions-inside-arrays/ - uses: benjlevesque/short-sha@v3.0 id: short-sha diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index c30981681..a5f871dfa 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -109,7 +109,12 @@ jobs: workspaces: | ./ pulumi_wasm_generator_lib/tests/output/cyclic-types/ + pulumi_wasm_generator_lib/tests/output/functions-secrets/ pulumi_wasm_generator_lib/tests/output/mini-awsnative/ + pulumi_wasm_generator_lib/tests/output/output-funcs/ + pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/ + pulumi_wasm_generator_lib/tests/output/unions-inline/ + pulumi_wasm_generator_lib/tests/output/unions-inside-arrays/ - name: Build run: | @@ -253,7 +258,12 @@ jobs: workspaces: | ./ pulumi_wasm_generator_lib/tests/output/cyclic-types/ + pulumi_wasm_generator_lib/tests/output/functions-secrets/ pulumi_wasm_generator_lib/tests/output/mini-awsnative/ + pulumi_wasm_generator_lib/tests/output/output-funcs/ + pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/ + pulumi_wasm_generator_lib/tests/output/unions-inline/ + pulumi_wasm_generator_lib/tests/output/unions-inside-arrays/ - name: Add target run: rustup target add ${{ matrix.rust-target }} diff --git a/pulumi_wasm_generator_lib/src/model.rs b/pulumi_wasm_generator_lib/src/model.rs index 977980f32..e32b9288b 100644 --- a/pulumi_wasm_generator_lib/src/model.rs +++ b/pulumi_wasm_generator_lib/src/model.rs @@ -14,7 +14,7 @@ pub(crate) enum Type { Object(Box), Ref(Ref), Option(Box), - DiscriminatedUnion(Vec), + DiscriminatedUnion(Vec>), } impl Type { @@ -44,7 +44,7 @@ impl Type { "pulumi_wasm_provider_common::OneOf{}<{}>", refs.len(), refs.iter() - .map(|r| Type::Ref(r.clone()).get_rust_type()) + .map(|r| r.get_rust_type()) .collect::>() .join(", ") ), @@ -61,11 +61,25 @@ impl Type { Type::Object(o) => o.get_internal_discriminated_union(), Type::Ref(_) => None, Type::Option(o) => o.get_internal_discriminated_union(), - Type::DiscriminatedUnion(m) => Some(m.iter().map(|r| Type::Ref(r.clone())).collect()), + Type::DiscriminatedUnion(types) => Some( + types + .iter() + .flat_map(|t| { + let o = t.get_internal_discriminated_union(); + o.unwrap_or_else(|| vec![]) + }) + .collect(), + ), // Type::DiscriminatedUnion(m) => //Some(m.iter().map(|r| Type::Ref(r.clone())).collect()), } } } +#[derive(Clone, Debug, PartialEq, Hash, Ord, PartialOrd, Eq)] +pub(crate) enum DiscriminatedUnionElement { + Ref(Ref), + String, +} + #[derive(Debug, PartialEq, Hash, Ord, PartialOrd, Eq)] pub(crate) struct InputProperty { pub(crate) name: String, diff --git a/pulumi_wasm_generator_lib/src/schema.rs b/pulumi_wasm_generator_lib/src/schema.rs index 36078005c..57dd97046 100644 --- a/pulumi_wasm_generator_lib/src/schema.rs +++ b/pulumi_wasm_generator_lib/src/schema.rs @@ -39,10 +39,28 @@ struct Type { } #[derive(Deserialize, Debug)] -struct OneOfType { +#[serde(untagged)] +enum OneOfType { + Ref(OneOfTypeRef), + Primitive(OneOfTypePrimitive), +} + +#[derive(Deserialize, Debug)] +struct OneOfTypeRef { #[serde(rename = "$ref")] ref_: String, } +#[derive(Deserialize, Debug)] +struct OneOfTypePrimitive { + #[serde(rename = "type")] + type_: OneOfTypePrimitiveType, +} +#[derive(Deserialize, Debug)] + +enum OneOfTypePrimitiveType { + #[serde(rename = "string")] + String, +} #[derive(Deserialize, Debug)] struct Property { @@ -74,7 +92,7 @@ struct Resource { #[derive(Deserialize, Debug)] struct EnumValue { - name: String, + name: Option, description: Option, value: Option, } @@ -177,11 +195,17 @@ fn create_discriminated_union(one_of: &[OneOfType]) -> Result crate::model::Type::Ref( + Ref::new(&r.ref_) + .context(format!("Cannot convert ref fo type {r:?}")) + .unwrap(), + ), + OneOfType::Primitive(primitive) => match primitive.type_ { + OneOfTypePrimitiveType::String => crate::model::Type::String, + }, }) + .map(|t| Box::new(t)) .collect(), )) } @@ -379,10 +403,21 @@ fn create_string_enum(description: &Option, enum_values: &[EnumValue]) - description.clone(), enum_values .iter() - .map(|enum_value| StringEnumElement { - name: enum_value.name.clone(), - value: enum_value.value.clone(), - description: enum_value.description.clone(), + .map(|enum_value| { + let (real_name, real_value) = match (&enum_value.name, &enum_value.value) { + (Some(name), Some(value)) => (name.clone(), Some(value.clone())), + (Some(name), None) => (name.clone(), None), + (None, Some(value)) => (value.clone(), None), + (None, None) => { + panic!("Invalid enum value: {enum_value:?}") + } + }; + + StringEnumElement { + name: real_name, + value: real_value, + description: enum_value.description.clone(), + } }) .collect(), ) diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/Cargo.toml b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/Cargo.toml new file mode 100644 index 000000000..10895020d --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "main" +version = "0.0.1" +edition = "2021" + +[workspace] +members = [ + "provider", + "lib" +] + +[workspace.dependencies] +wit-bindgen-rt = "0.33.0" +wit-bindgen = "0.33.0" +automod = "1.0.14" +pulumi_wasm_common = { path = "../../../../pulumi_wasm_common" } +pulumi_wasm_rust = { path = "../../../../pulumi_wasm_rust" } +pulumi_wasm_wit = { path = "../../../../pulumi_wasm_wit" } +pulumi_wasm_provider_common = { path = "../../../../pulumi_wasm_provider_common" } +serde = "1.0.197" +bon = "2.2.1" \ No newline at end of file diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/Cargo.toml b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/Cargo.toml new file mode 100644 index 000000000..c3c7a9642 --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "pulumi_wasm_myedgeorder" +version = "0.0.1-0.0.0-DEV" +edition = "2021" + +[dependencies] +wit-bindgen.workspace = true +pulumi_wasm_rust.workspace = true +serde.workspace = true +pulumi_wasm_wit = { workspace = true, features = ["client"] } +bon.workspace = true +pulumi_wasm_provider_common.workspace = true diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/function/list_configurations.rs b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/function/list_configurations.rs new file mode 100644 index 000000000..c7e93b244 --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/function/list_configurations.rs @@ -0,0 +1,44 @@ +//! The list of configurations. +//! API Version: 2020-12-01-preview. + + #[derive(bon::Builder, Clone)] +#[builder(finish_fn = build_struct)] +pub struct ListConfigurationsArgs { + /// Holds details about product hierarchy information and filterable property. + #[builder(into)] + pub configuration_filters: pulumi_wasm_rust::Output>, + /// Customer subscription properties. Clients can display available products to unregistered customers by explicitly passing subscription details + #[builder(into, default = ::pulumi_wasm_rust::Output::empty())] + pub customer_subscription_details: pulumi_wasm_rust::Output>, + /// $skipToken is supported on list of configurations, which provides the next page in the list of configurations. + #[builder(into, default = ::pulumi_wasm_rust::Output::empty())] + pub skip_token: pulumi_wasm_rust::Output>, +} + +pub struct ListConfigurationsResult { + /// Link for the next set of configurations. + pub next_link: pulumi_wasm_rust::Output>, + /// List of configurations. + pub value: pulumi_wasm_rust::Output>, +} + +/// +/// Registers a new resource with the given unique name and arguments +/// +pub fn invoke( + args: ListConfigurationsArgs +) -> ListConfigurationsResult { + + let result = crate::bindings::pulumi::myedgeorder::list_configurations::invoke( + &crate::bindings::pulumi::myedgeorder::list_configurations::Args { + configuration_filters: &args.configuration_filters.get_inner(), + customer_subscription_details: &args.customer_subscription_details.get_inner(), + skip_token: &args.skip_token.get_inner(), + } + ); + + ListConfigurationsResult { + next_link: crate::into_domain(result.next_link), + value: crate::into_domain(result.value), + } +} diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/function/list_product_families.rs b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/function/list_product_families.rs new file mode 100644 index 000000000..978a94522 --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/function/list_product_families.rs @@ -0,0 +1,48 @@ +//! The list of product families. +//! API Version: 2020-12-01-preview. + + #[derive(bon::Builder, Clone)] +#[builder(finish_fn = build_struct)] +pub struct ListProductFamiliesArgs { + /// Customer subscription properties. Clients can display available products to unregistered customers by explicitly passing subscription details + #[builder(into, default = ::pulumi_wasm_rust::Output::empty())] + pub customer_subscription_details: pulumi_wasm_rust::Output>, + /// $expand is supported on configurations parameter for product, which provides details on the configurations for the product. + #[builder(into, default = ::pulumi_wasm_rust::Output::empty())] + pub expand: pulumi_wasm_rust::Output>, + /// Dictionary of filterable properties on product family. + #[builder(into)] + pub filterable_properties: pulumi_wasm_rust::Output>>, + /// $skipToken is supported on list of product families, which provides the next page in the list of product families. + #[builder(into, default = ::pulumi_wasm_rust::Output::empty())] + pub skip_token: pulumi_wasm_rust::Output>, +} + +pub struct ListProductFamiliesResult { + /// Link for the next set of product families. + pub next_link: pulumi_wasm_rust::Output>, + /// List of product families. + pub value: pulumi_wasm_rust::Output>, +} + +/// +/// Registers a new resource with the given unique name and arguments +/// +pub fn invoke( + args: ListProductFamiliesArgs +) -> ListProductFamiliesResult { + + let result = crate::bindings::pulumi::myedgeorder::list_product_families::invoke( + &crate::bindings::pulumi::myedgeorder::list_product_families::Args { + customer_subscription_details: &args.customer_subscription_details.get_inner(), + expand: &args.expand.get_inner(), + filterable_properties: &args.filterable_properties.get_inner(), + skip_token: &args.skip_token.get_inner(), + } + ); + + ListProductFamiliesResult { + next_link: crate::into_domain(result.next_link), + value: crate::into_domain(result.value), + } +} diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/function/mod.rs b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/function/mod.rs new file mode 100644 index 000000000..e7cc36f5c --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/function/mod.rs @@ -0,0 +1,2 @@ +pub mod list_configurations; +pub mod list_product_families; diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/lib.rs b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/lib.rs new file mode 100644 index 000000000..ce148f020 --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/lib.rs @@ -0,0 +1,22 @@ +use pulumi_wasm_rust::Output; +use pulumi_wasm_wit::client_bindings::component::pulumi_wasm::output_interface::Output as WitOutput; +#[allow(clippy::doc_lazy_continuation, clippy::tabs_in_doc_comments)] +mod function; +pub use function::*; +#[allow(clippy::doc_lazy_continuation, clippy::tabs_in_doc_comments)] +mod types; +pub use types::*; + +mod bindings { + wit_bindgen::generate!({ + // the name of the world in the `*.wit` input file + world: "myedgeorder-pulumi-client", + with: { + "component:pulumi-wasm/output-interface@0.0.0-DEV": pulumi_wasm_wit::client_bindings::component::pulumi_wasm::output_interface + } + }); +} + +fn into_domain(output: WitOutput) -> Output { + unsafe { Output::::new_from_handle(output) } +} diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/resource/mod.rs b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/resource/mod.rs new file mode 100644 index 000000000..e69de29bb diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/availability_information_response.rs b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/availability_information_response.rs new file mode 100644 index 000000000..4745f6d31 --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/availability_information_response.rs @@ -0,0 +1,18 @@ +//! Availability information of a product system. + +#[derive(serde::Deserialize, serde::Serialize, bon::Builder, Debug, PartialEq, Clone)] +#[builder(finish_fn = build_struct)] +pub struct AvailabilityInformationResponse { + /// Current availability stage of the product. Availability stage + #[builder(into)] + #[serde(rename = "availabilityStage")] + pub r#availability_stage: Box, + /// Reason why the product is disabled. + #[builder(into)] + #[serde(rename = "disabledReason")] + pub r#disabled_reason: Box, + /// Message for why the product is disabled. + #[builder(into)] + #[serde(rename = "disabledReasonMessage")] + pub r#disabled_reason_message: Box, +} diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/billing_meter_details_response.rs b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/billing_meter_details_response.rs new file mode 100644 index 000000000..1729dd5e2 --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/billing_meter_details_response.rs @@ -0,0 +1,22 @@ +//! Holds billing meter details for each type of billing + +#[derive(serde::Deserialize, serde::Serialize, bon::Builder, Debug, PartialEq, Clone)] +#[builder(finish_fn = build_struct)] +pub struct BillingMeterDetailsResponse { + /// Frequency of recurrence + #[builder(into)] + #[serde(rename = "frequency")] + pub r#frequency: Box, + /// Represents MeterDetails + #[builder(into)] + #[serde(rename = "meterDetails")] + pub r#meter_details: Box>, + /// Represents Metering type (eg one-time or recurrent) + #[builder(into)] + #[serde(rename = "meteringType")] + pub r#metering_type: Box, + /// Represents Billing type name + #[builder(into)] + #[serde(rename = "name")] + pub r#name: Box, +} diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/configuration_filters.rs b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/configuration_filters.rs new file mode 100644 index 000000000..068e429cc --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/configuration_filters.rs @@ -0,0 +1,14 @@ +//! Configuration filters + +#[derive(serde::Deserialize, serde::Serialize, bon::Builder, Debug, PartialEq, Clone)] +#[builder(finish_fn = build_struct)] +pub struct ConfigurationFilters { + /// Filters specific to product + #[builder(into, default = Box::new(None))] + #[serde(rename = "filterableProperty")] + pub r#filterable_property: Box>>, + /// Product hierarchy information + #[builder(into)] + #[serde(rename = "hierarchyInformation")] + pub r#hierarchy_information: Box, +} diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/configuration_response.rs b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/configuration_response.rs new file mode 100644 index 000000000..cc18968b7 --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/configuration_response.rs @@ -0,0 +1,42 @@ +//! Configuration object. + +#[derive(serde::Deserialize, serde::Serialize, bon::Builder, Debug, PartialEq, Clone)] +#[builder(finish_fn = build_struct)] +pub struct ConfigurationResponse { + /// Availability information of the product system. + #[builder(into)] + #[serde(rename = "availabilityInformation")] + pub r#availability_information: Box, + /// Cost information for the product system. + #[builder(into)] + #[serde(rename = "costInformation")] + pub r#cost_information: Box, + /// Description related to the product system. + #[builder(into)] + #[serde(rename = "description")] + pub r#description: Box, + /// Dimensions of the configuration + #[builder(into)] + #[serde(rename = "dimensions")] + pub r#dimensions: Box, + /// Display Name for the product system. + #[builder(into)] + #[serde(rename = "displayName")] + pub r#display_name: Box, + /// list of filters supported for a product + #[builder(into)] + #[serde(rename = "filterableProperties")] + pub r#filterable_properties: Box>, + /// Hierarchy information of a product. + #[builder(into)] + #[serde(rename = "hierarchyInformation")] + pub r#hierarchy_information: Box, + /// Image information for the product system. + #[builder(into)] + #[serde(rename = "imageInformation")] + pub r#image_information: Box>, + /// Specifications of the configuration + #[builder(into)] + #[serde(rename = "specifications")] + pub r#specifications: Box>, +} diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/cost_information_response.rs b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/cost_information_response.rs new file mode 100644 index 000000000..15f45290e --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/cost_information_response.rs @@ -0,0 +1,14 @@ +//! Cost information for the product system + +#[derive(serde::Deserialize, serde::Serialize, bon::Builder, Debug, PartialEq, Clone)] +#[builder(finish_fn = build_struct)] +pub struct CostInformationResponse { + /// Default url to display billing information + #[builder(into)] + #[serde(rename = "billingInfoUrl")] + pub r#billing_info_url: Box, + /// Details on the various billing aspects for the product system. + #[builder(into)] + #[serde(rename = "billingMeterDetails")] + pub r#billing_meter_details: Box>, +} diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/customer_subscription_details.rs b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/customer_subscription_details.rs new file mode 100644 index 000000000..8438b84df --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/customer_subscription_details.rs @@ -0,0 +1,18 @@ +//! Holds Customer subscription details. Clients can display available products to unregistered customers by explicitly passing subscription details + +#[derive(serde::Deserialize, serde::Serialize, bon::Builder, Debug, PartialEq, Clone)] +#[builder(finish_fn = build_struct)] +pub struct CustomerSubscriptionDetails { + /// Location placement Id of a subscription + #[builder(into, default = Box::new(None))] + #[serde(rename = "locationPlacementId")] + pub r#location_placement_id: Box>, + /// Quota ID of a subscription + #[builder(into)] + #[serde(rename = "quotaId")] + pub r#quota_id: Box, + /// List of registered feature flags for subscription + #[builder(into, default = Box::new(None))] + #[serde(rename = "registeredFeatures")] + pub r#registered_features: Box>>, +} diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/customer_subscription_registered_features.rs b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/customer_subscription_registered_features.rs new file mode 100644 index 000000000..ba3621e40 --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/customer_subscription_registered_features.rs @@ -0,0 +1,14 @@ +//! Represents subscription registered features + +#[derive(serde::Deserialize, serde::Serialize, bon::Builder, Debug, PartialEq, Clone)] +#[builder(finish_fn = build_struct)] +pub struct CustomerSubscriptionRegisteredFeatures { + /// Name of subscription registered feature + #[builder(into, default = Box::new(None))] + #[serde(rename = "name")] + pub r#name: Box>, + /// State of subscription registered feature + #[builder(into, default = Box::new(None))] + #[serde(rename = "state")] + pub r#state: Box>, +} diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/description_response.rs b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/description_response.rs new file mode 100644 index 000000000..9b73f59d3 --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/description_response.rs @@ -0,0 +1,30 @@ +//! Description related properties of a product system. + +#[derive(serde::Deserialize, serde::Serialize, bon::Builder, Debug, PartialEq, Clone)] +#[builder(finish_fn = build_struct)] +pub struct DescriptionResponse { + /// Attributes for the product system. + #[builder(into)] + #[serde(rename = "attributes")] + pub r#attributes: Box>, + /// Type of description. + #[builder(into)] + #[serde(rename = "descriptionType")] + pub r#description_type: Box, + /// Keywords for the product system. + #[builder(into)] + #[serde(rename = "keywords")] + pub r#keywords: Box>, + /// Links for the product system. + #[builder(into)] + #[serde(rename = "links")] + pub r#links: Box>, + /// Long description of the product system. + #[builder(into)] + #[serde(rename = "longDescription")] + pub r#long_description: Box, + /// Short description of the product system. + #[builder(into)] + #[serde(rename = "shortDescription")] + pub r#short_description: Box, +} diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/dimensions_response.rs b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/dimensions_response.rs new file mode 100644 index 000000000..0f17f7d61 --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/dimensions_response.rs @@ -0,0 +1,34 @@ +//! Dimensions of a configuration. + +#[derive(serde::Deserialize, serde::Serialize, bon::Builder, Debug, PartialEq, Clone)] +#[builder(finish_fn = build_struct)] +pub struct DimensionsResponse { + /// Depth of the device. + #[builder(into)] + #[serde(rename = "depth")] + pub r#depth: Box, + /// Height of the device. + #[builder(into)] + #[serde(rename = "height")] + pub r#height: Box, + /// Length of the device. + #[builder(into)] + #[serde(rename = "length")] + pub r#length: Box, + /// Unit for the dimensions of length, height and width. + #[builder(into)] + #[serde(rename = "lengthHeightUnit")] + pub r#length_height_unit: Box, + /// Weight of the device. + #[builder(into)] + #[serde(rename = "weight")] + pub r#weight: Box, + /// Unit for the dimensions of weight. + #[builder(into)] + #[serde(rename = "weightUnit")] + pub r#weight_unit: Box, + /// Width of the device. + #[builder(into)] + #[serde(rename = "width")] + pub r#width: Box, +} diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/filterable_property.rs b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/filterable_property.rs new file mode 100644 index 000000000..b73468def --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/filterable_property.rs @@ -0,0 +1,14 @@ +//! Different types of filters supported and its values. + +#[derive(serde::Deserialize, serde::Serialize, bon::Builder, Debug, PartialEq, Clone)] +#[builder(finish_fn = build_struct)] +pub struct FilterableProperty { + /// Values to be filtered. + #[builder(into)] + #[serde(rename = "supportedValues")] + pub r#supported_values: Box>, + /// Type of product filter. + #[builder(into)] + #[serde(rename = "type")] + pub r#type: Box>, +} diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/filterable_property_response.rs b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/filterable_property_response.rs new file mode 100644 index 000000000..e410bb44d --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/filterable_property_response.rs @@ -0,0 +1,14 @@ +//! Different types of filters supported and its values. + +#[derive(serde::Deserialize, serde::Serialize, bon::Builder, Debug, PartialEq, Clone)] +#[builder(finish_fn = build_struct)] +pub struct FilterablePropertyResponse { + /// Values to be filtered. + #[builder(into)] + #[serde(rename = "supportedValues")] + pub r#supported_values: Box>, + /// Type of product filter. + #[builder(into)] + #[serde(rename = "type")] + pub r#type: Box, +} diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/hierarchy_information.rs b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/hierarchy_information.rs new file mode 100644 index 000000000..dd8865b63 --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/hierarchy_information.rs @@ -0,0 +1,22 @@ +//! Holds details about product hierarchy information + +#[derive(serde::Deserialize, serde::Serialize, bon::Builder, Debug, PartialEq, Clone)] +#[builder(finish_fn = build_struct)] +pub struct HierarchyInformation { + /// Represents configuration name that uniquely identifies configuration + #[builder(into, default = Box::new(None))] + #[serde(rename = "configurationName")] + pub r#configuration_name: Box>, + /// Represents product family name that uniquely identifies product family + #[builder(into, default = Box::new(None))] + #[serde(rename = "productFamilyName")] + pub r#product_family_name: Box>, + /// Represents product line name that uniquely identifies product line + #[builder(into, default = Box::new(None))] + #[serde(rename = "productLineName")] + pub r#product_line_name: Box>, + /// Represents product name that uniquely identifies product + #[builder(into, default = Box::new(None))] + #[serde(rename = "productName")] + pub r#product_name: Box>, +} diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/hierarchy_information_response.rs b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/hierarchy_information_response.rs new file mode 100644 index 000000000..f4c70d116 --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/hierarchy_information_response.rs @@ -0,0 +1,22 @@ +//! Holds details about product hierarchy information + +#[derive(serde::Deserialize, serde::Serialize, bon::Builder, Debug, PartialEq, Clone)] +#[builder(finish_fn = build_struct)] +pub struct HierarchyInformationResponse { + /// Represents configuration name that uniquely identifies configuration + #[builder(into, default = Box::new(None))] + #[serde(rename = "configurationName")] + pub r#configuration_name: Box>, + /// Represents product family name that uniquely identifies product family + #[builder(into, default = Box::new(None))] + #[serde(rename = "productFamilyName")] + pub r#product_family_name: Box>, + /// Represents product line name that uniquely identifies product line + #[builder(into, default = Box::new(None))] + #[serde(rename = "productLineName")] + pub r#product_line_name: Box>, + /// Represents product name that uniquely identifies product + #[builder(into, default = Box::new(None))] + #[serde(rename = "productName")] + pub r#product_name: Box>, +} diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/image_information_response.rs b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/image_information_response.rs new file mode 100644 index 000000000..fa0d9e64f --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/image_information_response.rs @@ -0,0 +1,14 @@ +//! Image for the product + +#[derive(serde::Deserialize, serde::Serialize, bon::Builder, Debug, PartialEq, Clone)] +#[builder(finish_fn = build_struct)] +pub struct ImageInformationResponse { + /// Type of the image + #[builder(into)] + #[serde(rename = "imageType")] + pub r#image_type: Box, + /// Url of the image + #[builder(into)] + #[serde(rename = "imageUrl")] + pub r#image_url: Box, +} diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/link_response.rs b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/link_response.rs new file mode 100644 index 000000000..ba1495dcb --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/link_response.rs @@ -0,0 +1,14 @@ +//! Returns link related to the product + +#[derive(serde::Deserialize, serde::Serialize, bon::Builder, Debug, PartialEq, Clone)] +#[builder(finish_fn = build_struct)] +pub struct LinkResponse { + /// Type of link + #[builder(into)] + #[serde(rename = "linkType")] + pub r#link_type: Box, + /// Url of the link + #[builder(into)] + #[serde(rename = "linkUrl")] + pub r#link_url: Box, +} diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/mod.rs b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/mod.rs new file mode 100644 index 000000000..4f4d31b2f --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/mod.rs @@ -0,0 +1,45 @@ +mod availability_information_response; +pub use availability_information_response::*; +mod billing_meter_details_response; +pub use billing_meter_details_response::*; +mod configuration_filters; +pub use configuration_filters::*; +mod configuration_response; +pub use configuration_response::*; +mod cost_information_response; +pub use cost_information_response::*; +mod customer_subscription_details; +pub use customer_subscription_details::*; +mod customer_subscription_registered_features; +pub use customer_subscription_registered_features::*; +mod description_response; +pub use description_response::*; +mod dimensions_response; +pub use dimensions_response::*; +mod filterable_property; +pub use filterable_property::*; +mod filterable_property_response; +pub use filterable_property_response::*; +mod hierarchy_information; +pub use hierarchy_information::*; +mod hierarchy_information_response; +pub use hierarchy_information_response::*; +mod image_information_response; +pub use image_information_response::*; +mod link_response; +pub use link_response::*; +mod pav_2_meter_details_response; +pub use pav_2_meter_details_response::*; +mod product_family_response; +pub use product_family_response::*; +mod product_line_response; +pub use product_line_response::*; +mod product_response; +pub use product_response::*; +mod purchase_meter_details_response; +pub use purchase_meter_details_response::*; +mod specification_response; +pub use specification_response::*; +mod supported_filter_types; +pub use supported_filter_types::*; + diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/pav_2_meter_details_response.rs b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/pav_2_meter_details_response.rs new file mode 100644 index 000000000..40017e5b1 --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/pav_2_meter_details_response.rs @@ -0,0 +1,23 @@ +//! Billing type PAV2 meter details + +#[derive(serde::Deserialize, serde::Serialize, bon::Builder, Debug, PartialEq, Clone)] +#[builder(finish_fn = build_struct)] +pub struct Pav2MeterDetailsResponse { + /// Represents billing type. + /// Expected value is 'Pav2'. + #[builder(into)] + #[serde(rename = "billingType")] + pub r#billing_type: Box, + /// Charging type. + #[builder(into)] + #[serde(rename = "chargingType")] + pub r#charging_type: Box, + /// Validation status of requested data center and transport. + #[builder(into)] + #[serde(rename = "meterGuid")] + pub r#meter_guid: Box, + /// Billing unit applicable for Pav2 billing + #[builder(into)] + #[serde(rename = "multiplier")] + pub r#multiplier: Box, +} diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/product_family_response.rs b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/product_family_response.rs new file mode 100644 index 000000000..f53044d10 --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/product_family_response.rs @@ -0,0 +1,38 @@ +//! Product Family + +#[derive(serde::Deserialize, serde::Serialize, bon::Builder, Debug, PartialEq, Clone)] +#[builder(finish_fn = build_struct)] +pub struct ProductFamilyResponse { + /// Availability information of the product system. + #[builder(into)] + #[serde(rename = "availabilityInformation")] + pub r#availability_information: Box, + /// Cost information for the product system. + #[builder(into)] + #[serde(rename = "costInformation")] + pub r#cost_information: Box, + /// Description related to the product system. + #[builder(into)] + #[serde(rename = "description")] + pub r#description: Box, + /// Display Name for the product system. + #[builder(into)] + #[serde(rename = "displayName")] + pub r#display_name: Box, + /// list of filters supported for a product + #[builder(into)] + #[serde(rename = "filterableProperties")] + pub r#filterable_properties: Box>, + /// Hierarchy information of a product. + #[builder(into)] + #[serde(rename = "hierarchyInformation")] + pub r#hierarchy_information: Box, + /// Image information for the product system. + #[builder(into)] + #[serde(rename = "imageInformation")] + pub r#image_information: Box>, + /// List of product lines supported in the product family + #[builder(into)] + #[serde(rename = "productLines")] + pub r#product_lines: Box>, +} diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/product_line_response.rs b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/product_line_response.rs new file mode 100644 index 000000000..0e3163479 --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/product_line_response.rs @@ -0,0 +1,38 @@ +//! Product line + +#[derive(serde::Deserialize, serde::Serialize, bon::Builder, Debug, PartialEq, Clone)] +#[builder(finish_fn = build_struct)] +pub struct ProductLineResponse { + /// Availability information of the product system. + #[builder(into)] + #[serde(rename = "availabilityInformation")] + pub r#availability_information: Box, + /// Cost information for the product system. + #[builder(into)] + #[serde(rename = "costInformation")] + pub r#cost_information: Box, + /// Description related to the product system. + #[builder(into)] + #[serde(rename = "description")] + pub r#description: Box, + /// Display Name for the product system. + #[builder(into)] + #[serde(rename = "displayName")] + pub r#display_name: Box, + /// list of filters supported for a product + #[builder(into)] + #[serde(rename = "filterableProperties")] + pub r#filterable_properties: Box>, + /// Hierarchy information of a product. + #[builder(into)] + #[serde(rename = "hierarchyInformation")] + pub r#hierarchy_information: Box, + /// Image information for the product system. + #[builder(into)] + #[serde(rename = "imageInformation")] + pub r#image_information: Box>, + /// List of products in the product line + #[builder(into)] + #[serde(rename = "products")] + pub r#products: Box>, +} diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/product_response.rs b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/product_response.rs new file mode 100644 index 000000000..29588e8a3 --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/product_response.rs @@ -0,0 +1,38 @@ +//! List of Products + +#[derive(serde::Deserialize, serde::Serialize, bon::Builder, Debug, PartialEq, Clone)] +#[builder(finish_fn = build_struct)] +pub struct ProductResponse { + /// Availability information of the product system. + #[builder(into)] + #[serde(rename = "availabilityInformation")] + pub r#availability_information: Box, + /// List of configurations for the product + #[builder(into)] + #[serde(rename = "configurations")] + pub r#configurations: Box>, + /// Cost information for the product system. + #[builder(into)] + #[serde(rename = "costInformation")] + pub r#cost_information: Box, + /// Description related to the product system. + #[builder(into)] + #[serde(rename = "description")] + pub r#description: Box, + /// Display Name for the product system. + #[builder(into)] + #[serde(rename = "displayName")] + pub r#display_name: Box, + /// list of filters supported for a product + #[builder(into)] + #[serde(rename = "filterableProperties")] + pub r#filterable_properties: Box>, + /// Hierarchy information of a product. + #[builder(into)] + #[serde(rename = "hierarchyInformation")] + pub r#hierarchy_information: Box, + /// Image information for the product system. + #[builder(into)] + #[serde(rename = "imageInformation")] + pub r#image_information: Box>, +} diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/purchase_meter_details_response.rs b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/purchase_meter_details_response.rs new file mode 100644 index 000000000..1bdfe7f1a --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/purchase_meter_details_response.rs @@ -0,0 +1,31 @@ +//! Billing type Purchase meter details + +#[derive(serde::Deserialize, serde::Serialize, bon::Builder, Debug, PartialEq, Clone)] +#[builder(finish_fn = build_struct)] +pub struct PurchaseMeterDetailsResponse { + /// Represents billing type. + /// Expected value is 'Purchase'. + #[builder(into)] + #[serde(rename = "billingType")] + pub r#billing_type: Box, + /// Charging type. + #[builder(into)] + #[serde(rename = "chargingType")] + pub r#charging_type: Box, + /// Billing unit applicable for Pav2 billing + #[builder(into)] + #[serde(rename = "multiplier")] + pub r#multiplier: Box, + /// Product Id + #[builder(into)] + #[serde(rename = "productId")] + pub r#product_id: Box, + /// Sku Id + #[builder(into)] + #[serde(rename = "skuId")] + pub r#sku_id: Box, + /// Term Id + #[builder(into)] + #[serde(rename = "termId")] + pub r#term_id: Box, +} diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/specification_response.rs b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/specification_response.rs new file mode 100644 index 000000000..f384b7a99 --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/specification_response.rs @@ -0,0 +1,14 @@ +//! Specifications of the configurations + +#[derive(serde::Deserialize, serde::Serialize, bon::Builder, Debug, PartialEq, Clone)] +#[builder(finish_fn = build_struct)] +pub struct SpecificationResponse { + /// Name of the specification + #[builder(into)] + #[serde(rename = "name")] + pub r#name: Box, + /// Value of the specification + #[builder(into)] + #[serde(rename = "value")] + pub r#value: Box, +} diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/supported_filter_types.rs b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/supported_filter_types.rs new file mode 100644 index 000000000..510c99697 --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/src/types/supported_filter_types.rs @@ -0,0 +1,9 @@ +//! Type of product filter. + +#[derive(serde::Deserialize, serde::Serialize, Debug, PartialEq, Clone)] +pub enum SupportedFilterTypes { + /// Ship to country + ShipToCountries, + /// Double encryption status + DoubleEncryptionStatus, +} diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/wit/deps/pulumi-wasm.wit b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/wit/deps/pulumi-wasm.wit new file mode 100644 index 000000000..d41010180 --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/wit/deps/pulumi-wasm.wit @@ -0,0 +1,59 @@ +package component:pulumi-wasm@0.0.0-DEV; + +interface output-interface { + + resource output { + constructor(value: string); + map: func(function-name: string) -> output; + } + combine: func(outputs: list>) -> output; +} + + +interface register-interface { + use output-interface.{output}; + + record object-field { + name: string, + value: borrow + } + + record result-field { + name: string + } + + record register-resource-result-field { + name: string, + output: output + } + + record register-resource-request { + %type: string, + name: string, + object: list, + results: list + } + + record register-resource-result { + fields: list + } + + register: func(request: register-resource-request) -> register-resource-result; + + record resource-invoke-result-field { + name: string, + output: output + } + + record resource-invoke-request { + token: string, + object: list, + results: list + } + + record resource-invoke-result { + fields: list + } + + invoke: func(request: resource-invoke-request) -> resource-invoke-result; +} \ No newline at end of file diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/wit/world.wit b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/wit/world.wit new file mode 100644 index 000000000..17f088ece --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/lib/wit/world.wit @@ -0,0 +1,55 @@ +package pulumi:myedgeorder@0.0.1--0.0.0-DEV; + +world myedgeorder-pulumi { + import component:pulumi-wasm/register-interface@0.0.0-DEV; + export list-configurations; + export list-product-families; +} + +world myedgeorder-pulumi-client { + import list-configurations; + import list-product-families; +} + + +interface list-configurations { + + use component:pulumi-wasm/output-interface@0.0.0-DEV.{output}; + + record args { + configuration-filters: borrow, + customer-subscription-details: borrow, + skip-token: borrow, + } + + record res { + next-link: output, + value: output, + } + + invoke: func( + args: args + ) -> res; + +} +interface list-product-families { + + use component:pulumi-wasm/output-interface@0.0.0-DEV.{output}; + + record args { + customer-subscription-details: borrow, + expand: borrow, + filterable-properties: borrow, + skip-token: borrow, + } + + record res { + next-link: output, + value: output, + } + + invoke: func( + args: args + ) -> res; + +} diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/provider/Cargo.toml b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/provider/Cargo.toml new file mode 100644 index 000000000..79c8288dc --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/provider/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "pulumi_wasm_myedgeorder_provider" +version = "0.0.1-0.0.0-DEV" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[lib] +crate-type = ["cdylib"] + +[dependencies] +wit-bindgen-rt.workspace = true +pulumi_wasm_common.workspace = true + +[package.metadata.component] +package = "pulumi:myedgeorder" + +[package.metadata.component.target] +path = "wit" +world = "myedgeorder-pulumi" + +[package.metadata.component.target.dependencies] +"component:pulumi-wasm" = { path = "wit/deps/pulumi-wasm.wit" } diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/provider/src/function/list_configurations.rs b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/provider/src/function/list_configurations.rs new file mode 100644 index 000000000..084cd8fdf --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/provider/src/function/list_configurations.rs @@ -0,0 +1,34 @@ +use std::collections::HashMap; +use crate::bindings::exports::pulumi::myedgeorder::list_configurations; +use crate::bindings::component::pulumi_wasm::register_interface::{ObjectField, invoke, ResourceInvokeRequest, ResultField}; +use crate::Component; + +impl list_configurations::Guest for Component { + fn invoke( + args: list_configurations::Args + ) -> list_configurations::Res { + pulumi_wasm_common::setup_logger(); + let request = ResourceInvokeRequest { + token: "myedgeorder::listConfigurations".into(), + object: vec![ + ObjectField { name: "configurationFilters".into(), value: args.configuration_filters }, + ObjectField { name: "customerSubscriptionDetails".into(), value: args.customer_subscription_details }, + ObjectField { name: "skipToken".into(), value: args.skip_token }, + ], + results: vec![ + ResultField { name: "nextLink".into() }, + ResultField { name: "value".into() }, + ], + }; + + let o = invoke(&request); + + let mut hashmap: HashMap = o.fields.into_iter().map(|f| (f.name, f.output)).collect(); + + list_configurations::Res { + next_link: hashmap.remove("nextLink").unwrap(), + value: hashmap.remove("value").unwrap(), + } + + } +} diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/provider/src/function/list_product_families.rs b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/provider/src/function/list_product_families.rs new file mode 100644 index 000000000..ed23f3063 --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/provider/src/function/list_product_families.rs @@ -0,0 +1,35 @@ +use std::collections::HashMap; +use crate::bindings::exports::pulumi::myedgeorder::list_product_families; +use crate::bindings::component::pulumi_wasm::register_interface::{ObjectField, invoke, ResourceInvokeRequest, ResultField}; +use crate::Component; + +impl list_product_families::Guest for Component { + fn invoke( + args: list_product_families::Args + ) -> list_product_families::Res { + pulumi_wasm_common::setup_logger(); + let request = ResourceInvokeRequest { + token: "myedgeorder::listProductFamilies".into(), + object: vec![ + ObjectField { name: "customerSubscriptionDetails".into(), value: args.customer_subscription_details }, + ObjectField { name: "expand".into(), value: args.expand }, + ObjectField { name: "filterableProperties".into(), value: args.filterable_properties }, + ObjectField { name: "skipToken".into(), value: args.skip_token }, + ], + results: vec![ + ResultField { name: "nextLink".into() }, + ResultField { name: "value".into() }, + ], + }; + + let o = invoke(&request); + + let mut hashmap: HashMap = o.fields.into_iter().map(|f| (f.name, f.output)).collect(); + + list_product_families::Res { + next_link: hashmap.remove("nextLink").unwrap(), + value: hashmap.remove("value").unwrap(), + } + + } +} diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/provider/src/function/mod.rs b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/provider/src/function/mod.rs new file mode 100644 index 000000000..e7cc36f5c --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/provider/src/function/mod.rs @@ -0,0 +1,2 @@ +pub mod list_configurations; +pub mod list_product_families; diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/provider/src/lib.rs b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/provider/src/lib.rs new file mode 100644 index 000000000..3e8987bca --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/provider/src/lib.rs @@ -0,0 +1,10 @@ +mod resource; +mod function; + +#[allow(unused_braces)] +#[allow(unused_imports)] +#[allow(static_mut_refs)] +mod bindings; +bindings::export!(Component with_types_in bindings); + +struct Component {} diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/provider/src/resource/mod.rs b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/provider/src/resource/mod.rs new file mode 100644 index 000000000..e69de29bb diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/provider/wit/deps/pulumi-wasm.wit b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/provider/wit/deps/pulumi-wasm.wit new file mode 100644 index 000000000..d41010180 --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/provider/wit/deps/pulumi-wasm.wit @@ -0,0 +1,59 @@ +package component:pulumi-wasm@0.0.0-DEV; + +interface output-interface { + + resource output { + constructor(value: string); + map: func(function-name: string) -> output; + } + combine: func(outputs: list>) -> output; +} + + +interface register-interface { + use output-interface.{output}; + + record object-field { + name: string, + value: borrow + } + + record result-field { + name: string + } + + record register-resource-result-field { + name: string, + output: output + } + + record register-resource-request { + %type: string, + name: string, + object: list, + results: list + } + + record register-resource-result { + fields: list + } + + register: func(request: register-resource-request) -> register-resource-result; + + record resource-invoke-result-field { + name: string, + output: output + } + + record resource-invoke-request { + token: string, + object: list, + results: list + } + + record resource-invoke-result { + fields: list + } + + invoke: func(request: resource-invoke-request) -> resource-invoke-result; +} \ No newline at end of file diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/provider/wit/world.wit b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/provider/wit/world.wit new file mode 100644 index 000000000..17f088ece --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/provider/wit/world.wit @@ -0,0 +1,55 @@ +package pulumi:myedgeorder@0.0.1--0.0.0-DEV; + +world myedgeorder-pulumi { + import component:pulumi-wasm/register-interface@0.0.0-DEV; + export list-configurations; + export list-product-families; +} + +world myedgeorder-pulumi-client { + import list-configurations; + import list-product-families; +} + + +interface list-configurations { + + use component:pulumi-wasm/output-interface@0.0.0-DEV.{output}; + + record args { + configuration-filters: borrow, + customer-subscription-details: borrow, + skip-token: borrow, + } + + record res { + next-link: output, + value: output, + } + + invoke: func( + args: args + ) -> res; + +} +interface list-product-families { + + use component:pulumi-wasm/output-interface@0.0.0-DEV.{output}; + + record args { + customer-subscription-details: borrow, + expand: borrow, + filterable-properties: borrow, + skip-token: borrow, + } + + record res { + next-link: output, + value: output, + } + + invoke: func( + args: args + ) -> res; + +} diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/rust-toolchain.toml b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/rust-toolchain.toml new file mode 100644 index 000000000..7466ea07d --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/rust-toolchain.toml @@ -0,0 +1,3 @@ +[toolchain] +channel = "1.83.0" +targets = ["wasm32-wasip1"] \ No newline at end of file diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/schema.json b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/schema.json new file mode 100644 index 000000000..137e41d9a --- /dev/null +++ b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/schema.json @@ -0,0 +1,856 @@ +{ + "name": "myedgeorder", + "version": "0.0.1", + "language": { + "nodejs": { + "devDependencies": { + "@types/node": "ts4.3", + "ts-node": "latest" + } + }, + "go": { + "generateExtraInputTypes": true + } + }, + "functions": { + "myedgeorder::listConfigurations": { + "description": "The list of configurations.\nAPI Version: 2020-12-01-preview.", + "inputs": { + "properties": { + "configurationFilters": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/types/myedgeorder::ConfigurationFilters" + }, + "description": "Holds details about product hierarchy information and filterable property." + }, + "customerSubscriptionDetails": { + "type": "object", + "$ref": "#/types/myedgeorder::CustomerSubscriptionDetails", + "description": "Customer subscription properties. Clients can display available products to unregistered customers by explicitly passing subscription details" + }, + "skipToken": { + "type": "string", + "description": "$skipToken is supported on list of configurations, which provides the next page in the list of configurations." + } + }, + "type": "object", + "required": [ + "configurationFilters" + ] + }, + "outputs": { + "description": "The list of configurations.", + "properties": { + "nextLink": { + "type": "string", + "description": "Link for the next set of configurations." + }, + "value": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/types/myedgeorder::ConfigurationResponse" + }, + "description": "List of configurations." + } + }, + "type": "object", + "required": [ + "value" + ] + } + }, + "myedgeorder::listProductFamilies": { + "description": "The list of product families.\nAPI Version: 2020-12-01-preview.", + "inputs": { + "properties": { + "customerSubscriptionDetails": { + "type": "object", + "$ref": "#/types/myedgeorder::CustomerSubscriptionDetails", + "description": "Customer subscription properties. Clients can display available products to unregistered customers by explicitly passing subscription details" + }, + "expand": { + "type": "string", + "description": "$expand is supported on configurations parameter for product, which provides details on the configurations for the product." + }, + "filterableProperties": { + "type": "object", + "additionalProperties": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/types/myedgeorder::FilterableProperty" + } + }, + "description": "Dictionary of filterable properties on product family." + }, + "skipToken": { + "type": "string", + "description": "$skipToken is supported on list of product families, which provides the next page in the list of product families." + } + }, + "type": "object", + "required": [ + "filterableProperties" + ] + }, + "outputs": { + "description": "The list of product families.", + "properties": { + "nextLink": { + "type": "string", + "description": "Link for the next set of product families." + }, + "value": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/types/myedgeorder::ProductFamilyResponse" + }, + "description": "List of product families." + } + }, + "type": "object", + "required": [ + "value" + ] + } + } + }, + "types": { + "myedgeorder::ConfigurationResponse": { + "description": "Configuration object.", + "properties": { + "availabilityInformation": { + "type": "object", + "$ref": "#/types/myedgeorder::AvailabilityInformationResponse", + "description": "Availability information of the product system." + }, + "costInformation": { + "type": "object", + "$ref": "#/types/myedgeorder::CostInformationResponse", + "description": "Cost information for the product system." + }, + "description": { + "type": "object", + "$ref": "#/types/myedgeorder::DescriptionResponse", + "description": "Description related to the product system." + }, + "dimensions": { + "type": "object", + "$ref": "#/types/myedgeorder::DimensionsResponse", + "description": "Dimensions of the configuration" + }, + "displayName": { + "type": "string", + "description": "Display Name for the product system." + }, + "filterableProperties": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/types/myedgeorder::FilterablePropertyResponse" + }, + "description": "list of filters supported for a product" + }, + "hierarchyInformation": { + "type": "object", + "$ref": "#/types/myedgeorder::HierarchyInformationResponse", + "description": "Hierarchy information of a product." + }, + "imageInformation": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/types/myedgeorder::ImageInformationResponse" + }, + "description": "Image information for the product system." + }, + "specifications": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/types/myedgeorder::SpecificationResponse" + }, + "description": "Specifications of the configuration" + } + }, + "type": "object", + "required": [ + "availabilityInformation", + "costInformation", + "description", + "dimensions", + "displayName", + "filterableProperties", + "hierarchyInformation", + "imageInformation", + "specifications" + ] + }, + "myedgeorder::CustomerSubscriptionDetails": { + "description": "Holds Customer subscription details. Clients can display available products to unregistered customers by explicitly passing subscription details", + "properties": { + "locationPlacementId": { + "type": "string", + "description": "Location placement Id of a subscription" + }, + "quotaId": { + "type": "string", + "description": "Quota ID of a subscription" + }, + "registeredFeatures": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/types/myedgeorder::CustomerSubscriptionRegisteredFeatures" + }, + "description": "List of registered feature flags for subscription" + } + }, + "type": "object", + "required": [ + "quotaId" + ] + }, + "myedgeorder::ProductFamilyResponse": { + "description": "Product Family", + "properties": { + "availabilityInformation": { + "type": "object", + "$ref": "#/types/myedgeorder::AvailabilityInformationResponse", + "description": "Availability information of the product system." + }, + "costInformation": { + "type": "object", + "$ref": "#/types/myedgeorder::CostInformationResponse", + "description": "Cost information for the product system." + }, + "description": { + "type": "object", + "$ref": "#/types/myedgeorder::DescriptionResponse", + "description": "Description related to the product system." + }, + "displayName": { + "type": "string", + "description": "Display Name for the product system." + }, + "filterableProperties": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/types/myedgeorder::FilterablePropertyResponse" + }, + "description": "list of filters supported for a product" + }, + "hierarchyInformation": { + "type": "object", + "$ref": "#/types/myedgeorder::HierarchyInformationResponse", + "description": "Hierarchy information of a product." + }, + "imageInformation": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/types/myedgeorder::ImageInformationResponse" + }, + "description": "Image information for the product system." + }, + "productLines": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/types/myedgeorder::ProductLineResponse" + }, + "description": "List of product lines supported in the product family" + } + }, + "type": "object", + "required": [ + "availabilityInformation", + "costInformation", + "description", + "displayName", + "filterableProperties", + "hierarchyInformation", + "imageInformation", + "productLines" + ] + }, + "myedgeorder::ConfigurationFilters": { + "description": "Configuration filters", + "properties": { + "filterableProperty": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/types/myedgeorder::FilterableProperty" + }, + "description": "Filters specific to product" + }, + "hierarchyInformation": { + "type": "object", + "$ref": "#/types/myedgeorder::HierarchyInformation", + "description": "Product hierarchy information" + } + }, + "type": "object", + "required": [ + "hierarchyInformation" + ] + }, + "myedgeorder::FilterableProperty": { + "description": "Different types of filters supported and its values.", + "properties": { + "supportedValues": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Values to be filtered." + }, + "type": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/types/myedgeorder::SupportedFilterTypes" + } + ], + "description": "Type of product filter." + } + }, + "type": "object", + "required": [ + "supportedValues", + "type" + ] + }, + "myedgeorder::AvailabilityInformationResponse": { + "description": "Availability information of a product system.", + "properties": { + "availabilityStage": { + "type": "string", + "description": "Current availability stage of the product. Availability stage" + }, + "disabledReason": { + "type": "string", + "description": "Reason why the product is disabled." + }, + "disabledReasonMessage": { + "type": "string", + "description": "Message for why the product is disabled." + } + }, + "type": "object", + "required": [ + "availabilityStage", + "disabledReason", + "disabledReasonMessage" + ] + }, + "myedgeorder::CostInformationResponse": { + "description": "Cost information for the product system", + "properties": { + "billingInfoUrl": { + "type": "string", + "description": "Default url to display billing information" + }, + "billingMeterDetails": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/types/myedgeorder::BillingMeterDetailsResponse" + }, + "description": "Details on the various billing aspects for the product system." + } + }, + "type": "object", + "required": [ + "billingInfoUrl", + "billingMeterDetails" + ] + }, + "myedgeorder::DescriptionResponse": { + "description": "Description related properties of a product system.", + "properties": { + "attributes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Attributes for the product system." + }, + "descriptionType": { + "type": "string", + "description": "Type of description." + }, + "keywords": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Keywords for the product system." + }, + "links": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/types/myedgeorder::LinkResponse" + }, + "description": "Links for the product system." + }, + "longDescription": { + "type": "string", + "description": "Long description of the product system." + }, + "shortDescription": { + "type": "string", + "description": "Short description of the product system." + } + }, + "type": "object", + "required": [ + "attributes", + "descriptionType", + "keywords", + "links", + "longDescription", + "shortDescription" + ] + }, + "myedgeorder::DimensionsResponse": { + "description": "Dimensions of a configuration.", + "properties": { + "depth": { + "type": "number", + "description": "Depth of the device." + }, + "height": { + "type": "number", + "description": "Height of the device." + }, + "length": { + "type": "number", + "description": "Length of the device." + }, + "lengthHeightUnit": { + "type": "string", + "description": "Unit for the dimensions of length, height and width." + }, + "weight": { + "type": "number", + "description": "Weight of the device." + }, + "weightUnit": { + "type": "string", + "description": "Unit for the dimensions of weight." + }, + "width": { + "type": "number", + "description": "Width of the device." + } + }, + "type": "object", + "required": [ + "depth", + "height", + "length", + "lengthHeightUnit", + "weight", + "weightUnit", + "width" + ] + }, + "myedgeorder::SpecificationResponse": { + "description": "Specifications of the configurations", + "properties": { + "name": { + "type": "string", + "description": "Name of the specification" + }, + "value": { + "type": "string", + "description": "Value of the specification" + } + }, + "type": "object", + "required": [ + "name", + "value" + ] + }, + "myedgeorder::HierarchyInformation": { + "description": "Holds details about product hierarchy information", + "properties": { + "configurationName": { + "type": "string", + "description": "Represents configuration name that uniquely identifies configuration" + }, + "productFamilyName": { + "type": "string", + "description": "Represents product family name that uniquely identifies product family" + }, + "productLineName": { + "type": "string", + "description": "Represents product line name that uniquely identifies product line" + }, + "productName": { + "type": "string", + "description": "Represents product name that uniquely identifies product" + } + }, + "type": "object" + }, + "myedgeorder::CustomerSubscriptionRegisteredFeatures": { + "description": "Represents subscription registered features", + "properties": { + "name": { + "type": "string", + "description": "Name of subscription registered feature" + }, + "state": { + "type": "string", + "description": "State of subscription registered feature" + } + }, + "type": "object" + }, + "myedgeorder::ImageInformationResponse": { + "description": "Image for the product", + "properties": { + "imageType": { + "type": "string", + "description": "Type of the image" + }, + "imageUrl": { + "type": "string", + "description": "Url of the image" + } + }, + "type": "object", + "required": [ + "imageType", + "imageUrl" + ] + }, + "myedgeorder::HierarchyInformationResponse": { + "description": "Holds details about product hierarchy information", + "properties": { + "configurationName": { + "type": "string", + "description": "Represents configuration name that uniquely identifies configuration" + }, + "productFamilyName": { + "type": "string", + "description": "Represents product family name that uniquely identifies product family" + }, + "productLineName": { + "type": "string", + "description": "Represents product line name that uniquely identifies product line" + }, + "productName": { + "type": "string", + "description": "Represents product name that uniquely identifies product" + } + }, + "type": "object" + }, + "myedgeorder::ProductLineResponse": { + "description": "Product line", + "properties": { + "availabilityInformation": { + "type": "object", + "$ref": "#/types/myedgeorder::AvailabilityInformationResponse", + "description": "Availability information of the product system." + }, + "costInformation": { + "type": "object", + "$ref": "#/types/myedgeorder::CostInformationResponse", + "description": "Cost information for the product system." + }, + "description": { + "type": "object", + "$ref": "#/types/myedgeorder::DescriptionResponse", + "description": "Description related to the product system." + }, + "displayName": { + "type": "string", + "description": "Display Name for the product system." + }, + "filterableProperties": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/types/myedgeorder::FilterablePropertyResponse" + }, + "description": "list of filters supported for a product" + }, + "hierarchyInformation": { + "type": "object", + "$ref": "#/types/myedgeorder::HierarchyInformationResponse", + "description": "Hierarchy information of a product." + }, + "imageInformation": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/types/myedgeorder::ImageInformationResponse" + }, + "description": "Image information for the product system." + }, + "products": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/types/myedgeorder::ProductResponse" + }, + "description": "List of products in the product line" + } + }, + "type": "object", + "required": [ + "availabilityInformation", + "costInformation", + "description", + "displayName", + "filterableProperties", + "hierarchyInformation", + "imageInformation", + "products" + ] + }, + "myedgeorder::FilterablePropertyResponse": { + "description": "Different types of filters supported and its values.", + "properties": { + "supportedValues": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Values to be filtered." + }, + "type": { + "type": "string", + "description": "Type of product filter." + } + }, + "type": "object", + "required": [ + "supportedValues", + "type" + ] + }, + "myedgeorder::SupportedFilterTypes": { + "description": "Type of product filter.", + "type": "string", + "enum": [ + { + "description": "Ship to country", + "value": "ShipToCountries" + }, + { + "description": "Double encryption status", + "value": "DoubleEncryptionStatus" + } + ] + }, + "myedgeorder::BillingMeterDetailsResponse": { + "description": "Holds billing meter details for each type of billing", + "properties": { + "frequency": { + "type": "string", + "description": "Frequency of recurrence" + }, + "meterDetails": { + "oneOf": [ + { + "type": "object", + "$ref": "#/types/myedgeorder::Pav2MeterDetailsResponse" + }, + { + "type": "object", + "$ref": "#/types/myedgeorder::PurchaseMeterDetailsResponse" + } + ], + "discriminator": { + "propertyName": "billingType", + "mapping": { + "Pav2": "#/types/myedgeorder::Pav2MeterDetailsResponse", + "Purchase": "#/types/myedgeorder::PurchaseMeterDetailsResponse" + } + }, + "description": "Represents MeterDetails" + }, + "meteringType": { + "type": "string", + "description": "Represents Metering type (eg one-time or recurrent)" + }, + "name": { + "type": "string", + "description": "Represents Billing type name" + } + }, + "type": "object", + "required": [ + "frequency", + "meterDetails", + "meteringType", + "name" + ] + }, + "myedgeorder::ProductResponse": { + "description": "List of Products", + "properties": { + "availabilityInformation": { + "type": "object", + "$ref": "#/types/myedgeorder::AvailabilityInformationResponse", + "description": "Availability information of the product system." + }, + "configurations": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/types/myedgeorder::ConfigurationResponse" + }, + "description": "List of configurations for the product" + }, + "costInformation": { + "type": "object", + "$ref": "#/types/myedgeorder::CostInformationResponse", + "description": "Cost information for the product system." + }, + "description": { + "type": "object", + "$ref": "#/types/myedgeorder::DescriptionResponse", + "description": "Description related to the product system." + }, + "displayName": { + "type": "string", + "description": "Display Name for the product system." + }, + "filterableProperties": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/types/myedgeorder::FilterablePropertyResponse" + }, + "description": "list of filters supported for a product" + }, + "hierarchyInformation": { + "type": "object", + "$ref": "#/types/myedgeorder::HierarchyInformationResponse", + "description": "Hierarchy information of a product." + }, + "imageInformation": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/types/myedgeorder::ImageInformationResponse" + }, + "description": "Image information for the product system." + } + }, + "type": "object", + "required": [ + "availabilityInformation", + "configurations", + "costInformation", + "description", + "displayName", + "filterableProperties", + "hierarchyInformation", + "imageInformation" + ] + }, + "myedgeorder::LinkResponse": { + "description": "Returns link related to the product", + "properties": { + "linkType": { + "type": "string", + "description": "Type of link" + }, + "linkUrl": { + "type": "string", + "description": "Url of the link" + } + }, + "type": "object", + "required": [ + "linkType", + "linkUrl" + ] + }, + "myedgeorder::PurchaseMeterDetailsResponse": { + "description": "Billing type Purchase meter details", + "properties": { + "billingType": { + "type": "string", + "description": "Represents billing type.\nExpected value is 'Purchase'.", + "const": "Purchase" + }, + "chargingType": { + "type": "string", + "description": "Charging type." + }, + "multiplier": { + "type": "number", + "description": "Billing unit applicable for Pav2 billing" + }, + "productId": { + "type": "string", + "description": "Product Id" + }, + "skuId": { + "type": "string", + "description": "Sku Id" + }, + "termId": { + "type": "string", + "description": "Term Id" + } + }, + "type": "object", + "required": [ + "billingType", + "chargingType", + "multiplier", + "productId", + "skuId", + "termId" + ] + }, + "myedgeorder::Pav2MeterDetailsResponse": { + "description": "Billing type PAV2 meter details", + "properties": { + "billingType": { + "type": "string", + "description": "Represents billing type.\nExpected value is 'Pav2'.", + "const": "Pav2" + }, + "chargingType": { + "type": "string", + "description": "Charging type." + }, + "meterGuid": { + "type": "string", + "description": "Validation status of requested data center and transport." + }, + "multiplier": { + "type": "number", + "description": "Billing unit applicable for Pav2 billing" + } + }, + "type": "object", + "required": [ + "billingType", + "chargingType", + "meterGuid", + "multiplier" + ] + } + } +} diff --git a/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/src/lib.rs b/pulumi_wasm_generator_lib/tests/output/output-funcs-edgeorder/src/lib.rs new file mode 100644 index 000000000..e69de29bb diff --git a/pulumi_wasm_generator_lib/tests/test.rs b/pulumi_wasm_generator_lib/tests/test.rs index 5468ce981..6c9b75abd 100644 --- a/pulumi_wasm_generator_lib/tests/test.rs +++ b/pulumi_wasm_generator_lib/tests/test.rs @@ -29,8 +29,6 @@ fn output_funcs() -> Result<()> { } #[test] -// https://github.com/andrzejressel/pulumi-wasm/issues/563 -#[ignore] fn output_funcs_edgeorder() -> Result<()> { run_pulumi_generator_test("output-funcs-edgeorder", "myedgeorder") } diff --git a/pulumi_wasm_provider_common/src/oneof.rs b/pulumi_wasm_provider_common/src/oneof.rs index 103a40caa..de202635b 100644 --- a/pulumi_wasm_provider_common/src/oneof.rs +++ b/pulumi_wasm_provider_common/src/oneof.rs @@ -1,7 +1,7 @@ -use std::fmt::Debug; use serde::{Deserialize, Serialize}; +use std::fmt::Debug; -#[derive(Debug, Serialize, Deserialize)] +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] #[serde(untagged)] pub enum OneOf2 { Left(A),