From 6450e8a681e1bf18a767619cd8da48b9955f4374 Mon Sep 17 00:00:00 2001 From: Joel Hendrix Date: Tue, 24 Feb 2026 13:51:36 -0800 Subject: [PATCH 1/6] Add support for tsp namespaces The code model has been refactored so that emitted artifacts are tracked in the crate and zero or more sub-modules for that crate. Added module info to adapated types so we can create the correct import statement across modules. This also required updating the Use helper to take a module param during construction. Improved the detection logic for deleting directories that contain generated code as there can now be multiple directories under src. --- packages/typespec-rust/.scripts/tspcompile.js | 3 +- packages/typespec-rust/CHANGELOG.md | 6 + packages/typespec-rust/package.json | 2 +- packages/typespec-rust/src/codegen/clients.ts | 42 ++- .../src/codegen/codeGenerator.ts | 154 +++++++-- packages/typespec-rust/src/codegen/context.ts | 10 +- .../typespec-rust/src/codegen/docTests.ts | 20 +- packages/typespec-rust/src/codegen/enums.ts | 42 +-- .../typespec-rust/src/codegen/headerTraits.ts | 25 +- packages/typespec-rust/src/codegen/helpers.ts | 14 + packages/typespec-rust/src/codegen/lib.ts | 6 +- packages/typespec-rust/src/codegen/mod.ts | 38 ++- packages/typespec-rust/src/codegen/models.ts | 63 ++-- packages/typespec-rust/src/codegen/unions.ts | 38 +-- packages/typespec-rust/src/codegen/use.ts | 34 +- .../typespec-rust/src/codemodel/client.ts | 13 +- packages/typespec-rust/src/codemodel/crate.ts | 129 ++++---- packages/typespec-rust/src/codemodel/types.ts | 20 +- packages/typespec-rust/src/emitter.ts | 56 +++- .../typespec-rust/src/tcgcadapter/adapter.ts | 146 +++++++-- packages/typespec-rust/src/utils/utils.ts | 25 ++ .../alternate_type_external_type_client.rs | 2 +- .../external_type/generated/clients/mod.rs | 7 + .../src/external_type/generated/mod.rs | 9 + .../generated/models/method_options.rs | 8 +- .../generated/models/mod.rs | 0 .../generated/models/models.rs | 0 .../generated/models/models_impl.rs | 0 .../alternate-type/src/external_type/mod.rs | 7 + .../clients/alternate_type_client.rs | 2 +- .../src/generated/clients/mod.rs | 2 - .../alternate-type/src/generated/mod.rs | 2 - .../alternate-type/src/lib.rs | 1 + .../tests/external_type_client.rs | 2 +- .../src/lib.rs | 2 + .../usage/src/generated/clients/mod.rs | 2 - .../src/generated/clients/usage_client.rs | 2 +- .../usage/src/generated/models/mod.rs | 3 - .../usage/src/generated/models/models.rs | 27 -- .../client-generator-core/usage/src/lib.rs | 1 + .../generated/clients/mod.rs | 7 + .../usage_model_in_operation_client.rs | 2 +- .../src/model_in_operation/generated/mod.rs | 9 + .../generated/models/method_options.rs | 8 +- .../generated/models/mod.rs | 0 .../generated/models/models.rs | 34 ++ .../generated/models/models_impl.rs | 0 .../usage/src/model_in_operation/mod.rs | 7 + .../tests/usage_model_in_operation_client.rs | 2 +- .../namespace/src/first/generated/mod.rs | 7 + .../src/first/generated/models/mod.rs | 8 + .../src/first/generated/models/models.rs | 14 + .../azure/client/namespace/src/first/mod.rs | 7 + .../clients/client_namespace_first_client.rs | 4 +- .../namespace/src/generated/clients/mod.rs | 2 - .../client/namespace/src/generated/mod.rs | 5 +- .../src/generated/models/method_options.rs | 7 - .../namespace/src/generated/models/mod.rs | 7 - .../spector/azure/client/namespace/src/lib.rs | 2 + .../clients/client_namespace_second_client.rs | 4 +- .../src/second/generated/clients/mod.rs | 7 + .../namespace/src/second/generated/mod.rs | 10 + .../second/generated/models/method_options.rs | 13 + .../src/second/generated/models/mod.rs | 10 + .../{ => second}/generated/models/models.rs | 9 +- .../azure/client/namespace/src/second/mod.rs | 8 + .../namespace/src/second/sub/generated/mod.rs | 7 + .../sub}/generated/models/enums.rs | 0 .../sub}/generated/models/enums_impl.rs | 0 .../sub}/generated/models/enums_serde.rs | 0 .../src/second/sub/generated/models/mod.rs | 9 + .../client/namespace/src/second/sub/mod.rs | 7 + .../tests/client_namespace_first_client.rs | 3 +- .../tests/client_namespace_second_client.rs | 11 +- .../azure/core/lro/standard/src/lib.rs | 2 - .../test/spector/azure/core/page/src/lib.rs | 2 +- .../azure/example/basic/generated/mod.rs | 7 + .../example/basic}/generated/models/enums.rs | 0 .../basic}/generated/models/enums_impl.rs | 0 .../basic}/generated/models/enums_serde.rs | 0 .../example/basic/generated/models/mod.rs | 13 + .../example/basic}/generated/models/models.rs | 0 .../basic}/generated/models/models_impl.rs | 0 .../src/_specs_/azure/example/basic/mod.rs | 7 + .../basic/src/_specs_/azure/example/mod.rs | 6 + .../example/basic/src/_specs_/azure/mod.rs | 6 + .../azure/example/basic/src/_specs_/mod.rs | 6 + .../generated/clients/azure_example_client.rs | 5 +- .../example/basic/src/generated/models/mod.rs | 8 - .../spector/azure/example/basic/src/lib.rs | 1 + .../basic/tests/azure_example_client.rs | 6 +- .../operation-templates/src/lib.rs | 2 - .../src/first_namespace/generated/mod.rs | 7 + .../first_namespace/generated/models/enums.rs | 14 + .../generated/models/enums_impl.rs | 45 +++ .../generated/models/enums_serde.rs | 26 ++ .../first_namespace/generated/models/mod.rs | 13 + .../generated/models/models.rs | 19 ++ .../generated/models/models_impl.rs | 14 + .../enum-conflict/src/first_namespace/mod.rs | 7 + .../enum_conflict_first_operations_client.rs | 5 +- .../enum_conflict_second_operations_client.rs | 5 +- .../enum-conflict/src/generated/models/mod.rs | 8 - .../spector/client/enum-conflict/src/lib.rs | 2 + .../src/second_namespace/generated/mod.rs | 7 + .../generated/models/enums.rs | 10 - .../generated/models/enums_impl.rs | 35 +- .../generated/models/enums_serde.rs | 21 +- .../second_namespace/generated/models/mod.rs | 13 + .../generated/models/models.rs | 13 +- .../generated/models/models_impl.rs | 9 +- .../enum-conflict/src/second_namespace/mod.rs | 7 + .../enum_conflict_first_operations_client.rs | 2 +- .../enum_conflict_second_operations_client.rs | 2 +- .../naming/src/generated/clients/mod.rs | 4 - .../src/generated/clients/naming_client.rs | 11 +- .../src/generated/models/method_options.rs | 28 -- .../client/naming/src/generated/models/mod.rs | 5 - .../naming/src/generated/models/models.rs | 36 -- .../test/spector/client/naming/src/lib.rs | 3 + .../naming/src/model/generated/clients/mod.rs | 7 + .../generated/clients/model_client.rs | 2 +- .../client/naming/src/model/generated/mod.rs | 9 + .../model}/generated/models/method_options.rs | 8 +- .../naming/src/model}/generated/models/mod.rs | 0 .../src/model/generated/models/models.rs | 21 ++ .../src/model/generated/models/models_impl.rs | 21 ++ .../spector/client/naming/src/model/mod.rs | 7 + .../naming/src/property/generated/mod.rs | 7 + .../src/property/generated/models/mod.rs | 9 + .../src/property/generated/models/models.rs | 28 ++ .../generated/models/models_impl.rs | 19 +- .../spector/client/naming/src/property/mod.rs | 7 + .../src/union_enum/generated/clients/mod.rs | 7 + .../clients/naming_union_enum_client.rs | 2 +- .../naming/src/union_enum/generated/mod.rs | 9 + .../generated/models/enums.rs | 0 .../generated/models/enums_impl.rs | 0 .../generated/models/enums_serde.rs | 0 .../generated/models/method_options.rs | 20 ++ .../src/union_enum/generated/models/mod.rs | 11 + .../client/naming/src/union_enum/mod.rs | 7 + .../naming/tests/client_model_client.rs | 2 +- .../client/naming/tests/naming_client.rs | 4 +- .../naming/tests/naming_union_enum_client.rs | 2 +- .../client-operation-group/src/client/mod.rs | 6 + .../generated/clients/mod.rs | 9 + .../generated/clients/second_client.rs | 8 +- .../generated/clients/second_group5_client.rs | 2 +- .../generated/mod.rs | 10 + .../generated/models/method_options.rs | 20 ++ .../generated/models/mod.rs | 0 .../another_client_operation_group/mod.rs | 7 + .../src/client/structure/mod.rs | 7 + .../client/structure/service/generated/mod.rs | 7 + .../service}/generated/models/enums.rs | 0 .../service}/generated/models/enums_impl.rs | 0 .../service}/generated/models/enums_serde.rs | 0 .../structure/service/generated/models/mod.rs | 9 + .../src/client/structure/service/mod.rs | 7 + .../src/generated/clients/first_client.rs | 9 +- .../src/generated/clients/mod.rs | 4 - .../src/generated/mod.rs | 2 +- .../src/generated/models/method_options.rs | 14 - .../src/generated/models/mod.rs | 4 - .../client-operation-group/src/lib.rs | 1 + .../tests/first_client_test.rs | 2 +- .../tests/first_group3_client_test.rs | 2 +- .../tests/first_group4_client_test.rs | 2 +- .../tests/second_client_test.rs | 5 +- .../tests/second_group5_client_test.rs | 5 +- .../default/src/baz/generated/clients/mod.rs | 9 + .../generated/clients/service_baz_client.rs | 2 +- .../clients/service_baz_foo_client.rs | 2 +- .../default/src/baz/generated/mod.rs | 9 + .../baz/generated/models/method_options.rs | 13 + .../default/src/baz}/generated/models/mod.rs | 0 .../client/structure/default/src/baz/mod.rs | 7 + .../default/src/generated/clients/mod.rs | 8 - .../src/generated/clients/service_client.rs | 10 +- .../src/generated/models/method_options.rs | 21 -- .../client/structure/default/src/lib.rs | 2 + .../default/src/qux/generated/clients/mod.rs | 9 + .../clients/service_qux_bar_client.rs | 2 +- .../generated/clients/service_qux_client.rs | 2 +- .../default/src/qux/generated/mod.rs | 9 + .../qux}/generated/models/method_options.rs | 8 +- .../default/src/qux}/generated/models/mod.rs | 0 .../client/structure/default/src/qux/mod.rs | 7 + .../structure/multi-client/src/client/mod.rs | 6 + .../multi-client/src/client/structure/mod.rs | 6 + .../client/structure/service/generated/mod.rs | 7 + .../service}/generated/models/enums.rs | 0 .../service}/generated/models/enums_impl.rs | 0 .../service}/generated/models/enums_serde.rs | 0 .../structure/service/generated/models/mod.rs | 9 + .../src/client/structure/service/mod.rs | 7 + .../src/generated/clients/client_a_client.rs | 9 +- .../src/generated/clients/client_b_client.rs | 9 +- .../multi-client/src/generated/models/mod.rs | 4 - .../client/structure/multi-client/src/lib.rs | 1 + .../tests/client_a_client_test.rs | 2 +- .../tests/client_b_client_test.rs | 2 +- .../renamed-operation/src/client/mod.rs | 6 + .../src/client/structure/mod.rs | 6 + .../client/structure/service/generated/mod.rs | 7 + .../service}/generated/models/enums.rs | 0 .../service}/generated/models/enums_impl.rs | 0 .../service}/generated/models/enums_serde.rs | 0 .../structure/service/generated/models/mod.rs | 9 + .../src/client/structure/service/mod.rs | 7 + .../clients/renamed_operation_client.rs | 13 +- .../src/generated/models/mod.rs | 4 - .../structure/renamed-operation/src/lib.rs | 1 + .../tests/renamed_operation_client_test.rs | 2 +- .../renamed_operation_group_client_test.rs | 2 +- .../two-operation-group/src/client/mod.rs | 6 + .../src/client/structure/mod.rs | 6 + .../client/structure/service/generated/mod.rs | 7 + .../service}/generated/models/enums.rs | 0 .../service}/generated/models/enums_impl.rs | 0 .../service}/generated/models/enums_serde.rs | 0 .../structure/service/generated/models/mod.rs | 9 + .../src/client/structure/service/mod.rs | 7 + .../clients/two_operation_group_client.rs | 6 +- .../src/generated/models/mod.rs | 4 - .../structure/two-operation-group/src/lib.rs | 1 + .../two_operation_group_group1_client_test.rs | 2 +- .../two_operation_group_group2_client_test.rs | 2 +- .../src/generated/clients/bytes_client.rs | 7 +- .../encode/bytes/src/generated/clients/mod.rs | 10 - .../src/generated/models/method_options.rs | 160 --------- .../encode/bytes/src/generated/models/mod.rs | 2 - .../generated/clients/bytes_header_client.rs | 2 +- .../bytes/src/header/generated/clients/mod.rs | 7 + .../encode/bytes/src/header/generated/mod.rs | 9 + .../header/generated/models/method_options.rs | 34 ++ .../bytes/src/header/generated/models/mod.rs | 7 + .../spector/encode/bytes/src/header/mod.rs | 7 + .../test/spector/encode/bytes/src/lib.rs | 5 + .../clients/bytes_property_client.rs | 13 +- .../src/property/generated/clients/mod.rs | 7 + .../bytes/src/property/generated/mod.rs | 9 + .../generated/models/method_options.rs | 34 ++ .../src/property/generated/models/mod.rs | 7 + .../spector/encode/bytes/src/property/mod.rs | 7 + .../generated/clients/bytes_query_client.rs | 2 +- .../bytes/src/query/generated/clients/mod.rs | 7 + .../encode/bytes/src/query/generated/mod.rs | 9 + .../query/generated/models/method_options.rs | 34 ++ .../bytes/src/query/generated/models/mod.rs | 7 + .../spector/encode/bytes/src/query/mod.rs | 7 + .../clients/bytes_request_body_client.rs | 2 +- .../src/request_body/generated/clients/mod.rs | 7 + .../bytes/src/request_body/generated/mod.rs | 9 + .../generated/models/method_options.rs | 41 +++ .../src/request_body/generated/models/mod.rs | 7 + .../encode/bytes/src/request_body/mod.rs | 7 + .../clients/bytes_response_body_client.rs | 2 +- .../response_body/generated/clients/mod.rs | 7 + .../bytes/src/response_body/generated/mod.rs | 9 + .../generated/models/method_options.rs | 41 +++ .../src/response_body/generated/models/mod.rs | 7 + .../encode/bytes/src/response_body/mod.rs | 7 + .../src/generated/clients/datetime_client.rs | 5 +- .../datetime/src/generated/clients/mod.rs | 8 - .../src/generated/models/method_options.rs | 139 -------- .../datetime/src/generated/models/mod.rs | 4 - .../datetime/src/generated/models/models.rs | 16 - .../clients/datetime_header_client.rs | 2 +- .../src/header/generated/clients/mod.rs | 7 + .../datetime/src/header/generated/mod.rs | 9 + .../header/generated/models/method_options.rs | 41 +++ .../src/header/generated/models/mod.rs | 7 + .../spector/encode/datetime/src/header/mod.rs | 7 + .../test/spector/encode/datetime/src/lib.rs | 4 + .../clients/datetime_property_client.rs | 15 +- .../src/property/generated/clients/mod.rs | 7 + .../datetime/src/property/generated/mod.rs | 9 + .../generated/models/method_options.rs | 41 +++ .../src/property/generated/models/mod.rs | 7 + .../encode/datetime/src/property/mod.rs | 7 + .../clients/datetime_query_client.rs | 2 +- .../src/query/generated/clients/mod.rs | 7 + .../datetime/src/query/generated/mod.rs | 9 + .../query/generated/models/method_options.rs | 41 +++ .../src/query/generated/models/mod.rs | 7 + .../spector/encode/datetime/src/query/mod.rs | 7 + .../datetime_response_header_client.rs | 10 +- .../response_header/generated/clients/mod.rs | 7 + .../src/response_header/generated/mod.rs | 9 + .../generated/models/header_traits.rs | 8 +- .../generated/models/method_options.rs | 34 ++ .../response_header/generated/models/mod.rs | 12 + .../generated/models/models.rs | 22 ++ .../datetime/src/response_header/mod.rs | 7 + .../datetime_response_header_client_test.rs | 2 +- .../src/generated/clients/duration_client.rs | 5 +- .../duration/src/generated/clients/mod.rs | 6 - .../encode/duration/src/generated/mod.rs | 2 - .../src/generated/models/method_options.rs | 300 ----------------- .../clients/duration_header_client.rs | 2 +- .../src/header/generated/clients/mod.rs | 7 + .../duration/src/header/generated/mod.rs | 9 + .../header/generated/models/method_options.rs | 104 ++++++ .../src/header/generated/models/mod.rs | 7 + .../spector/encode/duration/src/header/mod.rs | 7 + .../test/spector/encode/duration/src/lib.rs | 3 + .../clients/duration_property_client.rs | 2 +- .../src/property/generated/clients/mod.rs | 7 + .../duration/src/property/generated/mod.rs | 9 + .../generated/models/method_options.rs | 104 ++++++ .../src/property}/generated/models/mod.rs | 0 .../{ => property}/generated/models/models.rs | 0 .../generated/models/models_impl.rs | 0 .../encode/duration/src/property/mod.rs | 7 + .../clients/duration_query_client.rs | 2 +- .../src/query/generated/clients/mod.rs | 7 + .../duration/src/query/generated/mod.rs | 9 + .../query/generated/models/method_options.rs | 104 ++++++ .../src/query/generated/models/mod.rs | 7 + .../spector/encode/duration/src/query/mod.rs | 7 + .../tests/duration_property_client_test.rs | 2 +- .../numeric/src/generated/clients/mod.rs | 2 - .../src/generated/clients/numeric_client.rs | 2 +- .../encode/numeric/src/generated/mod.rs | 2 - .../test/spector/encode/numeric/src/lib.rs | 1 + .../src/property/generated/clients/mod.rs | 7 + .../clients/numeric_property_client.rs | 2 +- .../numeric/src/property/generated/mod.rs | 9 + .../generated/models/method_options.rs | 6 +- .../src/property}/generated/models/mod.rs | 0 .../{ => property}/generated/models/models.rs | 0 .../generated/models/models_impl.rs | 0 .../encode/numeric/src/property/mod.rs | 7 + .../tests/numeric_property_client_tests.rs | 2 +- .../clients/basic_explicit_body_client.rs | 2 +- .../explicit_body/generated/clients/mod.rs | 7 + .../basic/src/explicit_body/generated/mod.rs | 9 + .../generated/models/method_options.rs | 13 + .../src/explicit_body/generated/models/mod.rs | 11 + .../generated/models/models.rs | 5 - .../generated/models/models_impl.rs | 14 + .../parameters/basic/src/explicit_body/mod.rs | 7 + .../src/generated/clients/basic_client.rs | 5 +- .../basic/src/generated/clients/mod.rs | 4 - .../parameters/basic/src/generated/mod.rs | 2 - .../clients/basic_implicit_body_client.rs | 4 +- .../implicit_body/generated/clients/mod.rs | 7 + .../basic/src/implicit_body/generated/mod.rs | 9 + .../generated/models/method_options.rs | 13 + .../src/implicit_body/generated/models/mod.rs | 11 + .../implicit_body/generated/models/models.rs | 12 + .../generated/models/models_impl.rs | 9 +- .../parameters/basic/src/implicit_body/mod.rs | 7 + .../test/spector/parameters/basic/src/lib.rs | 2 + .../tests/basic_explicit_body_client_test.rs | 2 +- .../clients/body_optionality_client.rs | 6 +- .../src/generated/clients/mod.rs | 2 - .../src/generated/models/method_options.rs | 24 +- .../parameters/body-optionality/src/lib.rs | 1 + ...dy_optionality_optional_explicit_client.rs | 2 +- .../generated/clients/mod.rs | 7 + .../src/optional_explicit/generated/mod.rs | 9 + .../generated/models/method_options.rs | 28 ++ .../optional_explicit/generated/models/mod.rs | 7 + .../src/optional_explicit/mod.rs | 7 + ...dy_optionality_optional_explicit_client.rs | 2 +- .../clients/collection_format_client.rs | 4 +- .../src/generated/clients/mod.rs | 4 - .../collection-format/src/generated/mod.rs | 2 - .../collection_format_header_client.rs | 2 +- .../src/header/generated/clients/mod.rs | 7 + .../src/header/generated/mod.rs | 9 + .../header/generated/models/method_options.rs | 13 + .../src/header/generated/models/mod.rs | 7 + .../collection-format/src/header/mod.rs | 7 + .../parameters/collection-format/src/lib.rs | 2 + .../clients/collection_format_query_client.rs | 2 +- .../src/query/generated/clients/mod.rs | 7 + .../src/query/generated/mod.rs | 9 + .../generated/models/method_options.rs | 15 +- .../src/query/generated/models/mod.rs | 7 + .../collection-format/src/query/mod.rs | 7 + .../spread/src/alias/generated/clients/mod.rs | 7 + .../generated/clients/spread_alias_client.rs | 19 +- .../spread/src/alias/generated/mod.rs | 9 + .../alias/generated/models/method_options.rs | 47 +++ .../spread/src/alias/generated/models/mod.rs | 11 + .../src/alias/generated/models/models.rs | 12 + .../src/alias/generated/models/models_impl.rs | 14 + .../parameters/spread/src/alias/mod.rs | 7 + .../spread/src/generated/clients/mod.rs | 4 - .../src/generated/clients/spread_client.rs | 2 +- .../src/generated/models/method_options.rs | 82 ----- .../spread/src/generated/models/mod.rs | 6 +- .../spread/src/generated/models/models.rs | 12 - .../src/generated/models/models_impl.rs | 20 +- .../test/spector/parameters/spread/src/lib.rs | 2 + .../spread/src/model/generated/clients/mod.rs | 7 + .../generated/clients/spread_model_client.rs | 15 +- .../spread/src/model/generated/mod.rs | 9 + .../model/generated/models/method_options.rs | 41 +++ .../spread/src/model/generated/models/mod.rs | 11 + .../src/model/generated/models/models.rs | 14 + .../src/model/generated/models/models_impl.rs | 14 + .../parameters/spread/src/model/mod.rs | 7 + .../spread/tests/spread_alias_client_test.rs | 4 +- .../spread/tests/spread_model_client_test.rs | 2 +- ...ntent_negotiation_different_body_client.rs | 2 +- .../different_body/generated/clients/mod.rs | 7 + .../src/different_body/generated/mod.rs | 9 + .../generated/models/method_options.rs | 20 ++ .../generated/models/mod.rs | 0 .../generated/models/models.rs | 0 .../generated/models/models_serde.rs | 0 .../src/different_body/mod.rs | 7 + .../clients/content_negotiation_client.rs | 5 +- .../src/generated/clients/mod.rs | 4 - .../content-negotiation/src/generated/mod.rs | 2 - .../src/generated/models/method_options.rs | 34 -- .../payload/content-negotiation/src/lib.rs | 2 + .../content_negotiation_same_body_client.rs | 2 +- .../src/same_body/generated/clients/mod.rs | 7 + .../src/same_body/generated/mod.rs | 9 + .../generated/models/method_options.rs | 20 ++ .../src/same_body/generated/models/mod.rs | 7 + .../content-negotiation/src/same_body/mod.rs | 7 + ...content_negotiation_different_body_test.rs | 2 +- .../generated/clients/media_type_client.rs | 2 +- .../media-type/src/generated/clients/mod.rs | 2 - .../payload/media-type/src/generated/mod.rs | 2 - .../spector/payload/media-type/src/lib.rs | 1 + .../clients/media_type_string_body_client.rs | 2 +- .../src/string_body/generated/clients/mod.rs | 7 + .../src/string_body/generated/mod.rs | 9 + .../generated/models/method_options.rs | 8 +- .../src/string_body/generated/models/mod.rs | 7 + .../payload/media-type/src/string_body/mod.rs | 7 + .../pageable/src/generated/clients/mod.rs | 8 - .../src/generated/clients/pageable_client.rs | 6 +- .../pageable/src/generated/models/mod.rs | 4 - .../pageable/src/generated/models/models.rs | 126 ------- .../src/generated/models/models_impl.rs | 88 +---- .../test/spector/payload/pageable/src/lib.rs | 5 +- .../src/page_size/generated/clients/mod.rs | 7 + .../clients/pageable_page_size_client.rs | 2 +- .../pageable/src/page_size/generated/mod.rs | 9 + .../generated/models/method_options.rs | 47 +++ .../src/page_size/generated/models/mod.rs | 11 + .../src/page_size/generated/models/models.rs | 22 ++ .../page_size/generated/models/models_impl.rs | 27 ++ .../payload/pageable/src/page_size/mod.rs | 7 + .../generated/clients/mod.rs | 7 + ...en_pagination_continuation_token_client.rs | 30 +- .../continuation_token/generated/mod.rs | 9 + .../generated/models/header_traits.rs | 10 +- .../generated/models/method_options.rs | 148 +-------- .../generated/models/mod.rs | 13 + .../generated/models/models.rs | 76 +++++ .../generated/models/models_impl.rs | 48 +++ .../continuation_token/mod.rs | 7 + .../generated/clients/mod.rs | 7 + ...ageable_server_driven_pagination_client.rs | 6 +- .../server_driven_pagination/generated/mod.rs | 9 + .../generated/models/method_options.rs | 63 ++++ .../generated/models/mod.rs | 11 + .../generated/models/models.rs | 52 +++ .../generated/models/models_impl.rs | 36 ++ .../src/server_driven_pagination/mod.rs | 8 + .../xml_pagination/generated/clients/mod.rs | 7 + .../clients/pageable_xml_pagination_client.rs | 10 +- .../src/xml_pagination/generated/mod.rs | 9 + .../generated/models/method_options.rs | 47 +++ .../xml_pagination/generated/models/mod.rs | 7 + .../pageable/src/xml_pagination/mod.rs | 7 + .../tests/continuation_token_client_tests.rs | 8 +- .../payload/pageable/tests/pageable_client.rs | 4 +- .../pageable/tests/pagination_client_tests.rs | 2 +- .../tests/xml_pagination_client_tests.rs | 6 +- .../routes/src/generated/clients/mod.rs | 42 --- .../src/generated/clients/routes_client.rs | 7 +- .../src/generated/models/method_options.rs | 308 ------------------ .../test/spector/routes/src/lib.rs | 2 + .../path_parameters/generated/clients/mod.rs | 7 + .../clients/routes_path_parameters_client.rs | 14 +- .../src/path_parameters/generated/mod.rs | 9 + .../generated/models/method_options.rs | 27 ++ .../path_parameters/generated/models/mod.rs | 7 + .../explode/generated/clients/mod.rs | 7 + ...rameters_label_expansion_explode_client.rs | 2 +- .../label_expansion/explode/generated/mod.rs | 9 + .../generated/models/method_options.rs | 27 ++ .../explode/generated/models/mod.rs | 7 + .../label_expansion/explode/mod.rs | 7 + .../label_expansion/generated/clients/mod.rs | 7 + ..._path_parameters_label_expansion_client.rs | 6 +- .../label_expansion/generated/mod.rs | 7 + .../path_parameters/label_expansion/mod.rs | 9 + .../standard/generated/clients/mod.rs | 7 + ...ameters_label_expansion_standard_client.rs | 2 +- .../label_expansion/standard/generated/mod.rs | 9 + .../generated/models/method_options.rs | 27 ++ .../standard/generated/models/mod.rs | 7 + .../label_expansion/standard/mod.rs | 7 + .../explode/generated/clients/mod.rs | 7 + ...ameters_matrix_expansion_explode_client.rs | 2 +- .../matrix_expansion/explode/generated/mod.rs | 9 + .../generated/models/method_options.rs | 27 ++ .../explode/generated/models/mod.rs | 7 + .../matrix_expansion/explode/mod.rs | 7 + .../matrix_expansion/generated/clients/mod.rs | 7 + ...path_parameters_matrix_expansion_client.rs | 6 +- .../matrix_expansion/generated/mod.rs | 7 + .../path_parameters/matrix_expansion/mod.rs | 9 + .../standard/generated/clients/mod.rs | 7 + ...meters_matrix_expansion_standard_client.rs | 2 +- .../standard/generated/mod.rs | 9 + .../generated/models/method_options.rs | 27 ++ .../standard/generated/models/mod.rs | 7 + .../matrix_expansion/standard/mod.rs | 7 + .../spector/routes/src/path_parameters/mod.rs | 12 + .../explode/generated/clients/mod.rs | 7 + ...arameters_path_expansion_explode_client.rs | 2 +- .../path_expansion/explode/generated/mod.rs | 9 + .../generated/models/method_options.rs | 27 ++ .../explode/generated/models/mod.rs | 7 + .../path_expansion/explode/mod.rs | 7 + .../path_expansion/generated/clients/mod.rs | 7 + ...s_path_parameters_path_expansion_client.rs | 5 +- .../path_expansion/generated/mod.rs | 7 + .../src/path_parameters/path_expansion/mod.rs | 9 + .../standard/generated/clients/mod.rs | 7 + ...rameters_path_expansion_standard_client.rs | 2 +- .../path_expansion/standard/generated/mod.rs | 9 + .../generated/models/method_options.rs | 27 ++ .../standard/generated/models/mod.rs | 7 + .../path_expansion/standard/mod.rs | 7 + .../generated/clients/mod.rs | 7 + ...th_parameters_reserved_expansion_client.rs | 2 +- .../reserved_expansion/generated/mod.rs | 9 + .../generated/models/method_options.rs | 20 ++ .../generated/models/mod.rs | 7 + .../path_parameters/reserved_expansion/mod.rs | 7 + .../explode/generated/clients/mod.rs | 7 + ...ameters_simple_expansion_explode_client.rs | 2 +- .../simple_expansion/explode/generated/mod.rs | 9 + .../generated/models/method_options.rs | 27 ++ .../explode/generated/models/mod.rs | 7 + .../simple_expansion/explode/mod.rs | 7 + .../simple_expansion/generated/clients/mod.rs | 7 + ...path_parameters_simple_expansion_client.rs | 6 +- .../simple_expansion/generated/mod.rs | 7 + .../path_parameters/simple_expansion/mod.rs | 9 + .../standard/generated/clients/mod.rs | 7 + ...meters_simple_expansion_standard_client.rs | 2 +- .../standard/generated/mod.rs | 9 + .../generated/models/method_options.rs | 27 ++ .../standard/generated/models/mod.rs | 7 + .../simple_expansion/standard/mod.rs | 7 + .../query_parameters/generated/clients/mod.rs | 7 + .../clients/routes_query_parameters_client.rs | 9 +- .../src/query_parameters/generated/mod.rs | 9 + .../generated/models/method_options.rs | 27 ++ .../query_parameters/generated/models/mod.rs | 7 + .../routes/src/query_parameters/mod.rs | 9 + .../explode/generated/clients/mod.rs | 7 + ...eters_query_continuation_explode_client.rs | 2 +- .../explode/generated/mod.rs | 9 + .../generated/models/method_options.rs | 27 ++ .../explode/generated/models/mod.rs | 7 + .../query_continuation/explode/mod.rs | 7 + .../generated/clients/mod.rs | 7 + ...ry_parameters_query_continuation_client.rs | 6 +- .../query_continuation/generated/mod.rs | 7 + .../query_continuation/mod.rs | 9 + .../standard/generated/clients/mod.rs | 7 + ...ters_query_continuation_standard_client.rs | 2 +- .../standard/generated/mod.rs | 9 + .../generated/models/method_options.rs | 27 ++ .../standard/generated/models/mod.rs | 7 + .../query_continuation/standard/mod.rs | 7 + .../explode/generated/clients/mod.rs | 7 + ...rameters_query_expansion_explode_client.rs | 2 +- .../query_expansion/explode/generated/mod.rs | 9 + .../generated/models/method_options.rs | 27 ++ .../explode/generated/models/mod.rs | 7 + .../query_expansion/explode/mod.rs | 7 + .../query_expansion/generated/clients/mod.rs | 7 + ...query_parameters_query_expansion_client.rs | 6 +- .../query_expansion/generated/mod.rs | 7 + .../query_parameters/query_expansion/mod.rs | 9 + .../standard/generated/clients/mod.rs | 7 + ...ameters_query_expansion_standard_client.rs | 2 +- .../query_expansion/standard/generated/mod.rs | 9 + .../generated/models/method_options.rs | 27 ++ .../standard/generated/models/mod.rs | 7 + .../query_expansion/standard/mod.rs | 7 + .../json/src/generated/clients/json_client.rs | 2 +- .../json/src/generated/clients/mod.rs | 2 - .../encoded-name/json/src/generated/mod.rs | 2 - .../encoded-name/json/src/lib.rs | 1 + .../generated/clients/json_property_client.rs | 2 +- .../src/property/generated/clients/mod.rs | 7 + .../json/src/property/generated/mod.rs | 9 + .../generated/models/method_options.rs | 4 +- .../json/src/property/generated/models/mod.rs | 11 + .../{ => property}/generated/models/models.rs | 0 .../generated/models/models_impl.rs | 0 .../encoded-name/json/src/property/mod.rs | 7 + .../json/tests/json_property_tests.rs | 2 +- .../src/generated/clients/combined_client.rs | 4 +- .../src/generated/clients/mod.rs | 4 - .../multi-service/src/generated/mod.rs | 2 - .../spector/service/multi-service/src/lib.rs | 1 + .../service/multi-service/src/service/mod.rs | 6 + .../src/service/multi_service/mod.rs | 7 + .../generated/clients/combined_foo_client.rs | 2 +- .../service_a/generated/clients/mod.rs | 7 + .../multi_service/service_a/generated/mod.rs | 9 + .../generated/models/method_options.rs | 13 + .../service_a/generated/models/mod.rs | 7 + .../service/multi_service/service_a/mod.rs | 7 + .../generated/clients/combined_bar_client.rs | 2 +- .../service_b/generated/clients/mod.rs | 7 + .../multi_service/service_b/generated/mod.rs | 9 + .../generated/models/method_options.rs | 13 + .../service_b/generated/models/mod.rs | 7 + .../service/multi_service/service_b/mod.rs | 7 + .../src/generated/clients/mod.rs | 4 - .../generated/clients/special_words_client.rs | 7 +- .../src/generated/models/method_options.rs | 252 -------------- .../special-words/src/generated/models/mod.rs | 4 - .../test/spector/special-words/src/lib.rs | 2 + .../model_properties/generated/clients/mod.rs | 7 + .../special_words_model_properties_client.rs | 2 +- .../src/model_properties/generated/mod.rs | 9 + .../generated/models/method_options.rs | 27 ++ .../model_properties/generated/models/mod.rs | 11 + .../generated/models/models.rs | 52 +++ .../generated/models/models_impl.rs | 28 ++ .../special-words/src/model_properties/mod.rs | 7 + .../src/models/generated/clients/mod.rs | 7 + .../clients/special_words_models_client.rs | 2 +- .../special-words/src/models/generated/mod.rs | 9 + .../models/generated/models/method_options.rs | 237 ++++++++++++++ .../src/models/generated/models/mod.rs | 11 + .../{ => models}/generated/models/models.rs | 45 --- .../generated/models/models_impl.rs | 27 +- .../spector/special-words/src/models/mod.rs | 7 + .../special_words_model_properties_tests.rs | 2 +- .../tests/special_words_models_tests.rs | 2 +- .../inheritance/enum-discriminator/src/lib.rs | 2 +- .../clients/discriminated_envelope_client.rs | 2 +- .../src/envelope/generated/clients/mod.rs | 7 + .../src/envelope/generated/mod.rs | 7 + .../union/discriminated/src/envelope/mod.rs | 8 + .../discriminated_envelope_object_client.rs | 2 +- ...nvelope_object_custom_properties_client.rs | 9 +- ...iminated_envelope_object_default_client.rs | 9 +- .../envelope/object/generated/clients/mod.rs | 11 + .../src/envelope/object/generated/mod.rs | 9 + .../object/generated/models/method_options.rs | 38 +++ .../envelope/object/generated/models/mod.rs | 7 + .../discriminated/src/envelope/object/mod.rs | 7 + .../generated/clients/discriminated_client.rs | 5 +- .../src/generated/clients/mod.rs | 14 - .../src/generated/models/method_options.rs | 70 ---- .../discriminated/src/generated/models/mod.rs | 2 - .../type/union/discriminated/src/lib.rs | 2 + .../discriminated_no_envelope_client.rs | 2 +- ...no_envelope_custom_discriminator_client.rs | 9 +- ...iscriminated_no_envelope_default_client.rs | 9 +- .../src/no_envelope/generated/clients/mod.rs | 11 + .../src/no_envelope/generated/mod.rs | 9 + .../generated/models/method_options.rs | 38 +++ .../src/no_envelope/generated/models/mod.rs | 7 + .../discriminated/src/no_envelope/mod.rs | 7 + .../tests/discriminated_union_test.rs | 8 +- 679 files changed, 5807 insertions(+), 2899 deletions(-) rename packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/{ => external_type}/generated/clients/alternate_type_external_type_client.rs (99%) create mode 100644 packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/external_type/generated/clients/mod.rs create mode 100644 packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/external_type/generated/mod.rs rename packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/{ => external_type}/generated/models/method_options.rs (75%) rename packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/{ => external_type}/generated/models/mod.rs (100%) rename packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/{ => external_type}/generated/models/models.rs (100%) rename packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/{ => external_type}/generated/models/models_impl.rs (100%) create mode 100644 packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/external_type/mod.rs create mode 100644 packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/model_in_operation/generated/clients/mod.rs rename packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/{ => model_in_operation}/generated/clients/usage_model_in_operation_client.rs (99%) create mode 100644 packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/model_in_operation/generated/mod.rs rename packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/{ => model_in_operation}/generated/models/method_options.rs (72%) rename packages/typespec-rust/test/spector/{encode/duration/src => azure/client-generator-core/usage/src/model_in_operation}/generated/models/mod.rs (100%) create mode 100644 packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/model_in_operation/generated/models/models.rs rename packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/{ => model_in_operation}/generated/models/models_impl.rs (100%) create mode 100644 packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/model_in_operation/mod.rs create mode 100644 packages/typespec-rust/test/spector/azure/client/namespace/src/first/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/azure/client/namespace/src/first/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/azure/client/namespace/src/first/generated/models/models.rs create mode 100644 packages/typespec-rust/test/spector/azure/client/namespace/src/first/mod.rs rename packages/typespec-rust/test/spector/azure/client/namespace/src/{ => second}/generated/clients/client_namespace_second_client.rs (96%) create mode 100644 packages/typespec-rust/test/spector/azure/client/namespace/src/second/generated/clients/mod.rs create mode 100644 packages/typespec-rust/test/spector/azure/client/namespace/src/second/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/azure/client/namespace/src/second/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/azure/client/namespace/src/second/generated/models/mod.rs rename packages/typespec-rust/test/spector/azure/client/namespace/src/{ => second}/generated/models/models.rs (67%) create mode 100644 packages/typespec-rust/test/spector/azure/client/namespace/src/second/mod.rs create mode 100644 packages/typespec-rust/test/spector/azure/client/namespace/src/second/sub/generated/mod.rs rename packages/typespec-rust/test/spector/azure/client/namespace/src/{ => second/sub}/generated/models/enums.rs (100%) rename packages/typespec-rust/test/spector/azure/client/namespace/src/{ => second/sub}/generated/models/enums_impl.rs (100%) rename packages/typespec-rust/test/spector/azure/client/namespace/src/{ => second/sub}/generated/models/enums_serde.rs (100%) create mode 100644 packages/typespec-rust/test/spector/azure/client/namespace/src/second/sub/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/azure/client/namespace/src/second/sub/mod.rs create mode 100644 packages/typespec-rust/test/spector/azure/example/basic/src/_specs_/azure/example/basic/generated/mod.rs rename packages/typespec-rust/test/spector/azure/example/basic/src/{ => _specs_/azure/example/basic}/generated/models/enums.rs (100%) rename packages/typespec-rust/test/spector/azure/example/basic/src/{ => _specs_/azure/example/basic}/generated/models/enums_impl.rs (100%) rename packages/typespec-rust/test/spector/azure/example/basic/src/{ => _specs_/azure/example/basic}/generated/models/enums_serde.rs (100%) create mode 100644 packages/typespec-rust/test/spector/azure/example/basic/src/_specs_/azure/example/basic/generated/models/mod.rs rename packages/typespec-rust/test/spector/azure/example/basic/src/{ => _specs_/azure/example/basic}/generated/models/models.rs (100%) rename packages/typespec-rust/test/spector/azure/example/basic/src/{ => _specs_/azure/example/basic}/generated/models/models_impl.rs (100%) create mode 100644 packages/typespec-rust/test/spector/azure/example/basic/src/_specs_/azure/example/basic/mod.rs create mode 100644 packages/typespec-rust/test/spector/azure/example/basic/src/_specs_/azure/example/mod.rs create mode 100644 packages/typespec-rust/test/spector/azure/example/basic/src/_specs_/azure/mod.rs create mode 100644 packages/typespec-rust/test/spector/azure/example/basic/src/_specs_/mod.rs create mode 100644 packages/typespec-rust/test/spector/client/enum-conflict/src/first_namespace/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/client/enum-conflict/src/first_namespace/generated/models/enums.rs create mode 100644 packages/typespec-rust/test/spector/client/enum-conflict/src/first_namespace/generated/models/enums_impl.rs create mode 100644 packages/typespec-rust/test/spector/client/enum-conflict/src/first_namespace/generated/models/enums_serde.rs create mode 100644 packages/typespec-rust/test/spector/client/enum-conflict/src/first_namespace/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/client/enum-conflict/src/first_namespace/generated/models/models.rs create mode 100644 packages/typespec-rust/test/spector/client/enum-conflict/src/first_namespace/generated/models/models_impl.rs create mode 100644 packages/typespec-rust/test/spector/client/enum-conflict/src/first_namespace/mod.rs create mode 100644 packages/typespec-rust/test/spector/client/enum-conflict/src/second_namespace/generated/mod.rs rename packages/typespec-rust/test/spector/client/enum-conflict/src/{ => second_namespace}/generated/models/enums.rs (66%) rename packages/typespec-rust/test/spector/client/enum-conflict/src/{ => second_namespace}/generated/models/enums_impl.rs (57%) rename packages/typespec-rust/test/spector/client/enum-conflict/src/{ => second_namespace}/generated/models/enums_serde.rs (58%) create mode 100644 packages/typespec-rust/test/spector/client/enum-conflict/src/second_namespace/generated/models/mod.rs rename packages/typespec-rust/test/spector/client/enum-conflict/src/{ => second_namespace}/generated/models/models.rs (62%) rename packages/typespec-rust/test/spector/client/enum-conflict/src/{ => second_namespace}/generated/models/models_impl.rs (64%) create mode 100644 packages/typespec-rust/test/spector/client/enum-conflict/src/second_namespace/mod.rs create mode 100644 packages/typespec-rust/test/spector/client/naming/src/model/generated/clients/mod.rs rename packages/typespec-rust/test/spector/client/naming/src/{ => model}/generated/clients/model_client.rs (98%) create mode 100644 packages/typespec-rust/test/spector/client/naming/src/model/generated/mod.rs rename packages/typespec-rust/test/spector/{service/multi-service/src => client/naming/src/model}/generated/models/method_options.rs (61%) rename packages/typespec-rust/test/spector/{encode/numeric/src => client/naming/src/model}/generated/models/mod.rs (100%) create mode 100644 packages/typespec-rust/test/spector/client/naming/src/model/generated/models/models.rs create mode 100644 packages/typespec-rust/test/spector/client/naming/src/model/generated/models/models_impl.rs create mode 100644 packages/typespec-rust/test/spector/client/naming/src/model/mod.rs create mode 100644 packages/typespec-rust/test/spector/client/naming/src/property/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/client/naming/src/property/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/client/naming/src/property/generated/models/models.rs rename packages/typespec-rust/test/spector/client/naming/src/{ => property}/generated/models/models_impl.rs (64%) create mode 100644 packages/typespec-rust/test/spector/client/naming/src/property/mod.rs create mode 100644 packages/typespec-rust/test/spector/client/naming/src/union_enum/generated/clients/mod.rs rename packages/typespec-rust/test/spector/client/naming/src/{ => union_enum}/generated/clients/naming_union_enum_client.rs (98%) create mode 100644 packages/typespec-rust/test/spector/client/naming/src/union_enum/generated/mod.rs rename packages/typespec-rust/test/spector/client/naming/src/{ => union_enum}/generated/models/enums.rs (100%) rename packages/typespec-rust/test/spector/client/naming/src/{ => union_enum}/generated/models/enums_impl.rs (100%) rename packages/typespec-rust/test/spector/client/naming/src/{ => union_enum}/generated/models/enums_serde.rs (100%) create mode 100644 packages/typespec-rust/test/spector/client/naming/src/union_enum/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/client/naming/src/union_enum/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/client/naming/src/union_enum/mod.rs create mode 100644 packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/mod.rs create mode 100644 packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/another_client_operation_group/generated/clients/mod.rs rename packages/typespec-rust/test/spector/client/structure/client-operation-group/src/{ => client/structure/another_client_operation_group}/generated/clients/second_client.rs (94%) rename packages/typespec-rust/test/spector/client/structure/client-operation-group/src/{ => client/structure/another_client_operation_group}/generated/clients/second_group5_client.rs (93%) create mode 100644 packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/another_client_operation_group/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/another_client_operation_group/generated/models/method_options.rs rename packages/typespec-rust/test/spector/{parameters/collection-format/src => client/structure/client-operation-group/src/client/structure/another_client_operation_group}/generated/models/mod.rs (100%) create mode 100644 packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/another_client_operation_group/mod.rs create mode 100644 packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/mod.rs create mode 100644 packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/service/generated/mod.rs rename packages/typespec-rust/test/spector/client/structure/client-operation-group/src/{ => client/structure/service}/generated/models/enums.rs (100%) rename packages/typespec-rust/test/spector/client/structure/client-operation-group/src/{ => client/structure/service}/generated/models/enums_impl.rs (100%) rename packages/typespec-rust/test/spector/client/structure/client-operation-group/src/{ => client/structure/service}/generated/models/enums_serde.rs (100%) create mode 100644 packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/service/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/service/mod.rs create mode 100644 packages/typespec-rust/test/spector/client/structure/default/src/baz/generated/clients/mod.rs rename packages/typespec-rust/test/spector/client/structure/default/src/{ => baz}/generated/clients/service_baz_client.rs (93%) rename packages/typespec-rust/test/spector/client/structure/default/src/{ => baz}/generated/clients/service_baz_foo_client.rs (95%) create mode 100644 packages/typespec-rust/test/spector/client/structure/default/src/baz/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/client/structure/default/src/baz/generated/models/method_options.rs rename packages/typespec-rust/test/spector/{payload/media-type/src => client/structure/default/src/baz}/generated/models/mod.rs (100%) create mode 100644 packages/typespec-rust/test/spector/client/structure/default/src/baz/mod.rs create mode 100644 packages/typespec-rust/test/spector/client/structure/default/src/qux/generated/clients/mod.rs rename packages/typespec-rust/test/spector/client/structure/default/src/{ => qux}/generated/clients/service_qux_bar_client.rs (95%) rename packages/typespec-rust/test/spector/client/structure/default/src/{ => qux}/generated/clients/service_qux_client.rs (95%) create mode 100644 packages/typespec-rust/test/spector/client/structure/default/src/qux/generated/mod.rs rename packages/typespec-rust/test/spector/{parameters/basic/src => client/structure/default/src/qux}/generated/models/method_options.rs (58%) rename packages/typespec-rust/test/spector/{service/multi-service/src => client/structure/default/src/qux}/generated/models/mod.rs (100%) create mode 100644 packages/typespec-rust/test/spector/client/structure/default/src/qux/mod.rs create mode 100644 packages/typespec-rust/test/spector/client/structure/multi-client/src/client/mod.rs create mode 100644 packages/typespec-rust/test/spector/client/structure/multi-client/src/client/structure/mod.rs create mode 100644 packages/typespec-rust/test/spector/client/structure/multi-client/src/client/structure/service/generated/mod.rs rename packages/typespec-rust/test/spector/client/structure/multi-client/src/{ => client/structure/service}/generated/models/enums.rs (100%) rename packages/typespec-rust/test/spector/client/structure/multi-client/src/{ => client/structure/service}/generated/models/enums_impl.rs (100%) rename packages/typespec-rust/test/spector/client/structure/multi-client/src/{ => client/structure/service}/generated/models/enums_serde.rs (100%) create mode 100644 packages/typespec-rust/test/spector/client/structure/multi-client/src/client/structure/service/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/client/structure/multi-client/src/client/structure/service/mod.rs create mode 100644 packages/typespec-rust/test/spector/client/structure/renamed-operation/src/client/mod.rs create mode 100644 packages/typespec-rust/test/spector/client/structure/renamed-operation/src/client/structure/mod.rs create mode 100644 packages/typespec-rust/test/spector/client/structure/renamed-operation/src/client/structure/service/generated/mod.rs rename packages/typespec-rust/test/spector/client/structure/renamed-operation/src/{ => client/structure/service}/generated/models/enums.rs (100%) rename packages/typespec-rust/test/spector/client/structure/renamed-operation/src/{ => client/structure/service}/generated/models/enums_impl.rs (100%) rename packages/typespec-rust/test/spector/client/structure/renamed-operation/src/{ => client/structure/service}/generated/models/enums_serde.rs (100%) create mode 100644 packages/typespec-rust/test/spector/client/structure/renamed-operation/src/client/structure/service/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/client/structure/renamed-operation/src/client/structure/service/mod.rs create mode 100644 packages/typespec-rust/test/spector/client/structure/two-operation-group/src/client/mod.rs create mode 100644 packages/typespec-rust/test/spector/client/structure/two-operation-group/src/client/structure/mod.rs create mode 100644 packages/typespec-rust/test/spector/client/structure/two-operation-group/src/client/structure/service/generated/mod.rs rename packages/typespec-rust/test/spector/client/structure/two-operation-group/src/{ => client/structure/service}/generated/models/enums.rs (100%) rename packages/typespec-rust/test/spector/client/structure/two-operation-group/src/{ => client/structure/service}/generated/models/enums_impl.rs (100%) rename packages/typespec-rust/test/spector/client/structure/two-operation-group/src/{ => client/structure/service}/generated/models/enums_serde.rs (100%) create mode 100644 packages/typespec-rust/test/spector/client/structure/two-operation-group/src/client/structure/service/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/client/structure/two-operation-group/src/client/structure/service/mod.rs delete mode 100644 packages/typespec-rust/test/spector/encode/bytes/src/generated/models/method_options.rs rename packages/typespec-rust/test/spector/encode/bytes/src/{ => header}/generated/clients/bytes_header_client.rs (99%) create mode 100644 packages/typespec-rust/test/spector/encode/bytes/src/header/generated/clients/mod.rs create mode 100644 packages/typespec-rust/test/spector/encode/bytes/src/header/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/encode/bytes/src/header/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/encode/bytes/src/header/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/encode/bytes/src/header/mod.rs rename packages/typespec-rust/test/spector/encode/bytes/src/{ => property}/generated/clients/bytes_property_client.rs (93%) create mode 100644 packages/typespec-rust/test/spector/encode/bytes/src/property/generated/clients/mod.rs create mode 100644 packages/typespec-rust/test/spector/encode/bytes/src/property/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/encode/bytes/src/property/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/encode/bytes/src/property/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/encode/bytes/src/property/mod.rs rename packages/typespec-rust/test/spector/encode/bytes/src/{ => query}/generated/clients/bytes_query_client.rs (99%) create mode 100644 packages/typespec-rust/test/spector/encode/bytes/src/query/generated/clients/mod.rs create mode 100644 packages/typespec-rust/test/spector/encode/bytes/src/query/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/encode/bytes/src/query/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/encode/bytes/src/query/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/encode/bytes/src/query/mod.rs rename packages/typespec-rust/test/spector/encode/bytes/src/{ => request_body}/generated/clients/bytes_request_body_client.rs (99%) create mode 100644 packages/typespec-rust/test/spector/encode/bytes/src/request_body/generated/clients/mod.rs create mode 100644 packages/typespec-rust/test/spector/encode/bytes/src/request_body/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/encode/bytes/src/request_body/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/encode/bytes/src/request_body/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/encode/bytes/src/request_body/mod.rs rename packages/typespec-rust/test/spector/encode/bytes/src/{ => response_body}/generated/clients/bytes_response_body_client.rs (99%) create mode 100644 packages/typespec-rust/test/spector/encode/bytes/src/response_body/generated/clients/mod.rs create mode 100644 packages/typespec-rust/test/spector/encode/bytes/src/response_body/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/encode/bytes/src/response_body/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/encode/bytes/src/response_body/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/encode/bytes/src/response_body/mod.rs delete mode 100644 packages/typespec-rust/test/spector/encode/datetime/src/generated/models/method_options.rs rename packages/typespec-rust/test/spector/encode/datetime/src/{ => header}/generated/clients/datetime_header_client.rs (99%) create mode 100644 packages/typespec-rust/test/spector/encode/datetime/src/header/generated/clients/mod.rs create mode 100644 packages/typespec-rust/test/spector/encode/datetime/src/header/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/encode/datetime/src/header/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/encode/datetime/src/header/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/encode/datetime/src/header/mod.rs rename packages/typespec-rust/test/spector/encode/datetime/src/{ => property}/generated/clients/datetime_property_client.rs (93%) create mode 100644 packages/typespec-rust/test/spector/encode/datetime/src/property/generated/clients/mod.rs create mode 100644 packages/typespec-rust/test/spector/encode/datetime/src/property/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/encode/datetime/src/property/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/encode/datetime/src/property/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/encode/datetime/src/property/mod.rs rename packages/typespec-rust/test/spector/encode/datetime/src/{ => query}/generated/clients/datetime_query_client.rs (99%) create mode 100644 packages/typespec-rust/test/spector/encode/datetime/src/query/generated/clients/mod.rs create mode 100644 packages/typespec-rust/test/spector/encode/datetime/src/query/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/encode/datetime/src/query/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/encode/datetime/src/query/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/encode/datetime/src/query/mod.rs rename packages/typespec-rust/test/spector/encode/datetime/src/{ => response_header}/generated/clients/datetime_response_header_client.rs (93%) create mode 100644 packages/typespec-rust/test/spector/encode/datetime/src/response_header/generated/clients/mod.rs create mode 100644 packages/typespec-rust/test/spector/encode/datetime/src/response_header/generated/mod.rs rename packages/typespec-rust/test/spector/encode/datetime/src/{ => response_header}/generated/models/header_traits.rs (89%) create mode 100644 packages/typespec-rust/test/spector/encode/datetime/src/response_header/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/encode/datetime/src/response_header/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/encode/datetime/src/response_header/generated/models/models.rs create mode 100644 packages/typespec-rust/test/spector/encode/datetime/src/response_header/mod.rs delete mode 100644 packages/typespec-rust/test/spector/encode/duration/src/generated/models/method_options.rs rename packages/typespec-rust/test/spector/encode/duration/src/{ => header}/generated/clients/duration_header_client.rs (99%) create mode 100644 packages/typespec-rust/test/spector/encode/duration/src/header/generated/clients/mod.rs create mode 100644 packages/typespec-rust/test/spector/encode/duration/src/header/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/encode/duration/src/header/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/encode/duration/src/header/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/encode/duration/src/header/mod.rs rename packages/typespec-rust/test/spector/encode/duration/src/{ => property}/generated/clients/duration_property_client.rs (99%) create mode 100644 packages/typespec-rust/test/spector/encode/duration/src/property/generated/clients/mod.rs create mode 100644 packages/typespec-rust/test/spector/encode/duration/src/property/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/encode/duration/src/property/generated/models/method_options.rs rename packages/typespec-rust/test/spector/{parameters/basic/src => encode/duration/src/property}/generated/models/mod.rs (100%) rename packages/typespec-rust/test/spector/encode/duration/src/{ => property}/generated/models/models.rs (100%) rename packages/typespec-rust/test/spector/encode/duration/src/{ => property}/generated/models/models_impl.rs (100%) create mode 100644 packages/typespec-rust/test/spector/encode/duration/src/property/mod.rs rename packages/typespec-rust/test/spector/encode/duration/src/{ => query}/generated/clients/duration_query_client.rs (99%) create mode 100644 packages/typespec-rust/test/spector/encode/duration/src/query/generated/clients/mod.rs create mode 100644 packages/typespec-rust/test/spector/encode/duration/src/query/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/encode/duration/src/query/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/encode/duration/src/query/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/encode/duration/src/query/mod.rs create mode 100644 packages/typespec-rust/test/spector/encode/numeric/src/property/generated/clients/mod.rs rename packages/typespec-rust/test/spector/encode/numeric/src/{ => property}/generated/clients/numeric_property_client.rs (99%) create mode 100644 packages/typespec-rust/test/spector/encode/numeric/src/property/generated/mod.rs rename packages/typespec-rust/test/spector/encode/numeric/src/{ => property}/generated/models/method_options.rs (78%) rename packages/typespec-rust/test/spector/{serialization/encoded-name/json/src => encode/numeric/src/property}/generated/models/mod.rs (100%) rename packages/typespec-rust/test/spector/encode/numeric/src/{ => property}/generated/models/models.rs (100%) rename packages/typespec-rust/test/spector/encode/numeric/src/{ => property}/generated/models/models_impl.rs (100%) create mode 100644 packages/typespec-rust/test/spector/encode/numeric/src/property/mod.rs rename packages/typespec-rust/test/spector/parameters/basic/src/{ => explicit_body}/generated/clients/basic_explicit_body_client.rs (95%) create mode 100644 packages/typespec-rust/test/spector/parameters/basic/src/explicit_body/generated/clients/mod.rs create mode 100644 packages/typespec-rust/test/spector/parameters/basic/src/explicit_body/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/parameters/basic/src/explicit_body/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/parameters/basic/src/explicit_body/generated/models/mod.rs rename packages/typespec-rust/test/spector/parameters/basic/src/{ => explicit_body}/generated/models/models.rs (78%) create mode 100644 packages/typespec-rust/test/spector/parameters/basic/src/explicit_body/generated/models/models_impl.rs create mode 100644 packages/typespec-rust/test/spector/parameters/basic/src/explicit_body/mod.rs rename packages/typespec-rust/test/spector/parameters/basic/src/{ => implicit_body}/generated/clients/basic_implicit_body_client.rs (94%) create mode 100644 packages/typespec-rust/test/spector/parameters/basic/src/implicit_body/generated/clients/mod.rs create mode 100644 packages/typespec-rust/test/spector/parameters/basic/src/implicit_body/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/parameters/basic/src/implicit_body/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/parameters/basic/src/implicit_body/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/parameters/basic/src/implicit_body/generated/models/models.rs rename packages/typespec-rust/test/spector/parameters/basic/src/{ => implicit_body}/generated/models/models_impl.rs (67%) create mode 100644 packages/typespec-rust/test/spector/parameters/basic/src/implicit_body/mod.rs rename packages/typespec-rust/test/spector/parameters/body-optionality/src/{ => optional_explicit}/generated/clients/body_optionality_optional_explicit_client.rs (98%) create mode 100644 packages/typespec-rust/test/spector/parameters/body-optionality/src/optional_explicit/generated/clients/mod.rs create mode 100644 packages/typespec-rust/test/spector/parameters/body-optionality/src/optional_explicit/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/parameters/body-optionality/src/optional_explicit/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/parameters/body-optionality/src/optional_explicit/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/parameters/body-optionality/src/optional_explicit/mod.rs rename packages/typespec-rust/test/spector/parameters/collection-format/src/{ => header}/generated/clients/collection_format_header_client.rs (95%) create mode 100644 packages/typespec-rust/test/spector/parameters/collection-format/src/header/generated/clients/mod.rs create mode 100644 packages/typespec-rust/test/spector/parameters/collection-format/src/header/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/parameters/collection-format/src/header/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/parameters/collection-format/src/header/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/parameters/collection-format/src/header/mod.rs rename packages/typespec-rust/test/spector/parameters/collection-format/src/{ => query}/generated/clients/collection_format_query_client.rs (99%) create mode 100644 packages/typespec-rust/test/spector/parameters/collection-format/src/query/generated/clients/mod.rs create mode 100644 packages/typespec-rust/test/spector/parameters/collection-format/src/query/generated/mod.rs rename packages/typespec-rust/test/spector/parameters/collection-format/src/{ => query}/generated/models/method_options.rs (67%) create mode 100644 packages/typespec-rust/test/spector/parameters/collection-format/src/query/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/parameters/collection-format/src/query/mod.rs create mode 100644 packages/typespec-rust/test/spector/parameters/spread/src/alias/generated/clients/mod.rs rename packages/typespec-rust/test/spector/parameters/spread/src/{ => alias}/generated/clients/spread_alias_client.rs (94%) create mode 100644 packages/typespec-rust/test/spector/parameters/spread/src/alias/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/parameters/spread/src/alias/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/parameters/spread/src/alias/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/parameters/spread/src/alias/generated/models/models.rs create mode 100644 packages/typespec-rust/test/spector/parameters/spread/src/alias/generated/models/models_impl.rs create mode 100644 packages/typespec-rust/test/spector/parameters/spread/src/alias/mod.rs delete mode 100644 packages/typespec-rust/test/spector/parameters/spread/src/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/parameters/spread/src/model/generated/clients/mod.rs rename packages/typespec-rust/test/spector/parameters/spread/src/{ => model}/generated/clients/spread_model_client.rs (95%) create mode 100644 packages/typespec-rust/test/spector/parameters/spread/src/model/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/parameters/spread/src/model/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/parameters/spread/src/model/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/parameters/spread/src/model/generated/models/models.rs create mode 100644 packages/typespec-rust/test/spector/parameters/spread/src/model/generated/models/models_impl.rs create mode 100644 packages/typespec-rust/test/spector/parameters/spread/src/model/mod.rs rename packages/typespec-rust/test/spector/payload/content-negotiation/src/{ => different_body}/generated/clients/content_negotiation_different_body_client.rs (98%) create mode 100644 packages/typespec-rust/test/spector/payload/content-negotiation/src/different_body/generated/clients/mod.rs create mode 100644 packages/typespec-rust/test/spector/payload/content-negotiation/src/different_body/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/payload/content-negotiation/src/different_body/generated/models/method_options.rs rename packages/typespec-rust/test/spector/payload/content-negotiation/src/{ => different_body}/generated/models/mod.rs (100%) rename packages/typespec-rust/test/spector/payload/content-negotiation/src/{ => different_body}/generated/models/models.rs (100%) rename packages/typespec-rust/test/spector/payload/content-negotiation/src/{ => different_body}/generated/models/models_serde.rs (100%) create mode 100644 packages/typespec-rust/test/spector/payload/content-negotiation/src/different_body/mod.rs delete mode 100644 packages/typespec-rust/test/spector/payload/content-negotiation/src/generated/models/method_options.rs rename packages/typespec-rust/test/spector/payload/content-negotiation/src/{ => same_body}/generated/clients/content_negotiation_same_body_client.rs (98%) create mode 100644 packages/typespec-rust/test/spector/payload/content-negotiation/src/same_body/generated/clients/mod.rs create mode 100644 packages/typespec-rust/test/spector/payload/content-negotiation/src/same_body/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/payload/content-negotiation/src/same_body/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/payload/content-negotiation/src/same_body/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/payload/content-negotiation/src/same_body/mod.rs rename packages/typespec-rust/test/spector/payload/media-type/src/{ => string_body}/generated/clients/media_type_string_body_client.rs (99%) create mode 100644 packages/typespec-rust/test/spector/payload/media-type/src/string_body/generated/clients/mod.rs create mode 100644 packages/typespec-rust/test/spector/payload/media-type/src/string_body/generated/mod.rs rename packages/typespec-rust/test/spector/payload/media-type/src/{ => string_body}/generated/models/method_options.rs (77%) create mode 100644 packages/typespec-rust/test/spector/payload/media-type/src/string_body/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/payload/media-type/src/string_body/mod.rs create mode 100644 packages/typespec-rust/test/spector/payload/pageable/src/page_size/generated/clients/mod.rs rename packages/typespec-rust/test/spector/payload/pageable/src/{ => page_size}/generated/clients/pageable_page_size_client.rs (99%) create mode 100644 packages/typespec-rust/test/spector/payload/pageable/src/page_size/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/payload/pageable/src/page_size/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/payload/pageable/src/page_size/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/payload/pageable/src/page_size/generated/models/models.rs create mode 100644 packages/typespec-rust/test/spector/payload/pageable/src/page_size/generated/models/models_impl.rs create mode 100644 packages/typespec-rust/test/spector/payload/pageable/src/page_size/mod.rs create mode 100644 packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/continuation_token/generated/clients/mod.rs rename packages/typespec-rust/test/spector/payload/pageable/src/{ => server_driven_pagination/continuation_token}/generated/clients/pageable_server_driven_pagination_continuation_token_client.rs (93%) create mode 100644 packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/continuation_token/generated/mod.rs rename packages/typespec-rust/test/spector/payload/pageable/src/{ => server_driven_pagination/continuation_token}/generated/models/header_traits.rs (81%) rename packages/typespec-rust/test/spector/payload/pageable/src/{ => server_driven_pagination/continuation_token}/generated/models/method_options.rs (52%) create mode 100644 packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/continuation_token/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/continuation_token/generated/models/models.rs create mode 100644 packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/continuation_token/generated/models/models_impl.rs create mode 100644 packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/continuation_token/mod.rs create mode 100644 packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/generated/clients/mod.rs rename packages/typespec-rust/test/spector/payload/pageable/src/{ => server_driven_pagination}/generated/clients/pageable_server_driven_pagination_client.rs (98%) create mode 100644 packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/generated/models/models.rs create mode 100644 packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/generated/models/models_impl.rs create mode 100644 packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/mod.rs create mode 100644 packages/typespec-rust/test/spector/payload/pageable/src/xml_pagination/generated/clients/mod.rs rename packages/typespec-rust/test/spector/payload/pageable/src/{ => xml_pagination}/generated/clients/pageable_xml_pagination_client.rs (96%) create mode 100644 packages/typespec-rust/test/spector/payload/pageable/src/xml_pagination/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/payload/pageable/src/xml_pagination/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/payload/pageable/src/xml_pagination/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/payload/pageable/src/xml_pagination/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/generated/clients/mod.rs rename packages/typespec-rust/test/spector/routes/src/{ => path_parameters}/generated/clients/routes_path_parameters_client.rs (94%) create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/explode/generated/clients/mod.rs rename packages/typespec-rust/test/spector/routes/src/{ => path_parameters/label_expansion/explode}/generated/clients/routes_path_parameters_label_expansion_explode_client.rs (98%) create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/explode/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/explode/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/explode/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/explode/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/generated/clients/mod.rs rename packages/typespec-rust/test/spector/routes/src/{ => path_parameters/label_expansion}/generated/clients/routes_path_parameters_label_expansion_client.rs (87%) create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/standard/generated/clients/mod.rs rename packages/typespec-rust/test/spector/routes/src/{ => path_parameters/label_expansion/standard}/generated/clients/routes_path_parameters_label_expansion_standard_client.rs (98%) create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/standard/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/standard/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/standard/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/standard/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/explode/generated/clients/mod.rs rename packages/typespec-rust/test/spector/routes/src/{ => path_parameters/matrix_expansion/explode}/generated/clients/routes_path_parameters_matrix_expansion_explode_client.rs (98%) create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/explode/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/explode/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/explode/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/explode/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/generated/clients/mod.rs rename packages/typespec-rust/test/spector/routes/src/{ => path_parameters/matrix_expansion}/generated/clients/routes_path_parameters_matrix_expansion_client.rs (87%) create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/standard/generated/clients/mod.rs rename packages/typespec-rust/test/spector/routes/src/{ => path_parameters/matrix_expansion/standard}/generated/clients/routes_path_parameters_matrix_expansion_standard_client.rs (98%) create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/standard/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/standard/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/standard/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/standard/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/explode/generated/clients/mod.rs rename packages/typespec-rust/test/spector/routes/src/{ => path_parameters/path_expansion/explode}/generated/clients/routes_path_parameters_path_expansion_explode_client.rs (98%) create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/explode/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/explode/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/explode/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/explode/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/generated/clients/mod.rs rename packages/typespec-rust/test/spector/routes/src/{ => path_parameters/path_expansion}/generated/clients/routes_path_parameters_path_expansion_client.rs (87%) create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/standard/generated/clients/mod.rs rename packages/typespec-rust/test/spector/routes/src/{ => path_parameters/path_expansion/standard}/generated/clients/routes_path_parameters_path_expansion_standard_client.rs (98%) create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/standard/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/standard/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/standard/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/standard/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/reserved_expansion/generated/clients/mod.rs rename packages/typespec-rust/test/spector/routes/src/{ => path_parameters/reserved_expansion}/generated/clients/routes_path_parameters_reserved_expansion_client.rs (98%) create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/reserved_expansion/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/reserved_expansion/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/reserved_expansion/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/reserved_expansion/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/explode/generated/clients/mod.rs rename packages/typespec-rust/test/spector/routes/src/{ => path_parameters/simple_expansion/explode}/generated/clients/routes_path_parameters_simple_expansion_explode_client.rs (98%) create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/explode/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/explode/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/explode/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/explode/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/generated/clients/mod.rs rename packages/typespec-rust/test/spector/routes/src/{ => path_parameters/simple_expansion}/generated/clients/routes_path_parameters_simple_expansion_client.rs (87%) create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/standard/generated/clients/mod.rs rename packages/typespec-rust/test/spector/routes/src/{ => path_parameters/simple_expansion/standard}/generated/clients/routes_path_parameters_simple_expansion_standard_client.rs (98%) create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/standard/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/standard/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/standard/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/standard/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/query_parameters/generated/clients/mod.rs rename packages/typespec-rust/test/spector/routes/src/{ => query_parameters}/generated/clients/routes_query_parameters_client.rs (96%) create mode 100644 packages/typespec-rust/test/spector/routes/src/query_parameters/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/query_parameters/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/query_parameters/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/query_parameters/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/explode/generated/clients/mod.rs rename packages/typespec-rust/test/spector/routes/src/{ => query_parameters/query_continuation/explode}/generated/clients/routes_query_parameters_query_continuation_explode_client.rs (98%) create mode 100644 packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/explode/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/explode/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/explode/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/explode/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/generated/clients/mod.rs rename packages/typespec-rust/test/spector/routes/src/{ => query_parameters/query_continuation}/generated/clients/routes_query_parameters_query_continuation_client.rs (87%) create mode 100644 packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/standard/generated/clients/mod.rs rename packages/typespec-rust/test/spector/routes/src/{ => query_parameters/query_continuation/standard}/generated/clients/routes_query_parameters_query_continuation_standard_client.rs (98%) create mode 100644 packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/standard/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/standard/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/standard/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/standard/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/explode/generated/clients/mod.rs rename packages/typespec-rust/test/spector/routes/src/{ => query_parameters/query_expansion/explode}/generated/clients/routes_query_parameters_query_expansion_explode_client.rs (98%) create mode 100644 packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/explode/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/explode/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/explode/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/explode/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/generated/clients/mod.rs rename packages/typespec-rust/test/spector/routes/src/{ => query_parameters/query_expansion}/generated/clients/routes_query_parameters_query_expansion_client.rs (87%) create mode 100644 packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/standard/generated/clients/mod.rs rename packages/typespec-rust/test/spector/routes/src/{ => query_parameters/query_expansion/standard}/generated/clients/routes_query_parameters_query_expansion_standard_client.rs (98%) create mode 100644 packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/standard/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/standard/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/standard/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/standard/mod.rs rename packages/typespec-rust/test/spector/serialization/encoded-name/json/src/{ => property}/generated/clients/json_property_client.rs (98%) create mode 100644 packages/typespec-rust/test/spector/serialization/encoded-name/json/src/property/generated/clients/mod.rs create mode 100644 packages/typespec-rust/test/spector/serialization/encoded-name/json/src/property/generated/mod.rs rename packages/typespec-rust/test/spector/serialization/encoded-name/json/src/{ => property}/generated/models/method_options.rs (86%) create mode 100644 packages/typespec-rust/test/spector/serialization/encoded-name/json/src/property/generated/models/mod.rs rename packages/typespec-rust/test/spector/serialization/encoded-name/json/src/{ => property}/generated/models/models.rs (100%) rename packages/typespec-rust/test/spector/serialization/encoded-name/json/src/{ => property}/generated/models/models_impl.rs (100%) create mode 100644 packages/typespec-rust/test/spector/serialization/encoded-name/json/src/property/mod.rs create mode 100644 packages/typespec-rust/test/spector/service/multi-service/src/service/mod.rs create mode 100644 packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/mod.rs rename packages/typespec-rust/test/spector/service/multi-service/src/{ => service/multi_service/service_a}/generated/clients/combined_foo_client.rs (94%) create mode 100644 packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_a/generated/clients/mod.rs create mode 100644 packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_a/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_a/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_a/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_a/mod.rs rename packages/typespec-rust/test/spector/service/multi-service/src/{ => service/multi_service/service_b}/generated/clients/combined_bar_client.rs (94%) create mode 100644 packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_b/generated/clients/mod.rs create mode 100644 packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_b/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_b/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_b/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_b/mod.rs create mode 100644 packages/typespec-rust/test/spector/special-words/src/model_properties/generated/clients/mod.rs rename packages/typespec-rust/test/spector/special-words/src/{ => model_properties}/generated/clients/special_words_model_properties_client.rs (98%) create mode 100644 packages/typespec-rust/test/spector/special-words/src/model_properties/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/special-words/src/model_properties/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/special-words/src/model_properties/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/special-words/src/model_properties/generated/models/models.rs create mode 100644 packages/typespec-rust/test/spector/special-words/src/model_properties/generated/models/models_impl.rs create mode 100644 packages/typespec-rust/test/spector/special-words/src/model_properties/mod.rs create mode 100644 packages/typespec-rust/test/spector/special-words/src/models/generated/clients/mod.rs rename packages/typespec-rust/test/spector/special-words/src/{ => models}/generated/clients/special_words_models_client.rs (99%) create mode 100644 packages/typespec-rust/test/spector/special-words/src/models/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/special-words/src/models/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/special-words/src/models/generated/models/mod.rs rename packages/typespec-rust/test/spector/special-words/src/{ => models}/generated/models/models.rs (81%) rename packages/typespec-rust/test/spector/special-words/src/{ => models}/generated/models/models_impl.rs (88%) create mode 100644 packages/typespec-rust/test/spector/special-words/src/models/mod.rs rename packages/typespec-rust/test/spector/type/union/discriminated/src/{ => envelope}/generated/clients/discriminated_envelope_client.rs (92%) create mode 100644 packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/generated/clients/mod.rs create mode 100644 packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/mod.rs rename packages/typespec-rust/test/spector/type/union/discriminated/src/{ => envelope/object}/generated/clients/discriminated_envelope_object_client.rs (96%) rename packages/typespec-rust/test/spector/type/union/discriminated/src/{ => envelope/object}/generated/clients/discriminated_envelope_object_custom_properties_client.rs (93%) rename packages/typespec-rust/test/spector/type/union/discriminated/src/{ => envelope/object}/generated/clients/discriminated_envelope_object_default_client.rs (93%) create mode 100644 packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/object/generated/clients/mod.rs create mode 100644 packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/object/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/object/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/object/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/object/mod.rs delete mode 100644 packages/typespec-rust/test/spector/type/union/discriminated/src/generated/models/method_options.rs rename packages/typespec-rust/test/spector/type/union/discriminated/src/{ => no_envelope}/generated/clients/discriminated_no_envelope_client.rs (96%) rename packages/typespec-rust/test/spector/type/union/discriminated/src/{ => no_envelope}/generated/clients/discriminated_no_envelope_custom_discriminator_client.rs (93%) rename packages/typespec-rust/test/spector/type/union/discriminated/src/{ => no_envelope}/generated/clients/discriminated_no_envelope_default_client.rs (94%) create mode 100644 packages/typespec-rust/test/spector/type/union/discriminated/src/no_envelope/generated/clients/mod.rs create mode 100644 packages/typespec-rust/test/spector/type/union/discriminated/src/no_envelope/generated/mod.rs create mode 100644 packages/typespec-rust/test/spector/type/union/discriminated/src/no_envelope/generated/models/method_options.rs create mode 100644 packages/typespec-rust/test/spector/type/union/discriminated/src/no_envelope/generated/models/mod.rs create mode 100644 packages/typespec-rust/test/spector/type/union/discriminated/src/no_envelope/mod.rs diff --git a/packages/typespec-rust/.scripts/tspcompile.js b/packages/typespec-rust/.scripts/tspcompile.js index fe6de142e..6046c1142 100644 --- a/packages/typespec-rust/.scripts/tspcompile.js +++ b/packages/typespec-rust/.scripts/tspcompile.js @@ -252,6 +252,7 @@ function generate(crate, input, outputDir, additionalArgs) { options.push(`--option="@azure-tools/typespec-rust.crate-name=${crate}"`); options.push(`--option="@azure-tools/typespec-rust.crate-version=0.1.0"`); options.push(`--option="@azure-tools/typespec-rust.emitter-output-dir=${fullOutputDir}"`); + //options.push(`--option="@azure-tools/typespec-rust.overwrite-lib-rs=true"`); const command = `node ${compiler} compile ${input} --emit=${pkgRoot} ${options.join(' ')} ${additionalArgs.join(' ')}`; if (switches.includes('--verbose')) { console.log(command); @@ -261,7 +262,7 @@ function generate(crate, input, outputDir, additionalArgs) { const maxRmRetries = 4; const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms)); for (let attempt = 0; attempt < maxRmRetries; ++attempt) { - const rmPath = path.join(fullOutputDir, 'src', 'generated') + const rmPath = path.join(fullOutputDir, 'src', 'generated'); try { fs.rmSync(rmPath, { force: true, recursive: true }); break; diff --git a/packages/typespec-rust/CHANGELOG.md b/packages/typespec-rust/CHANGELOG.md index 9c14223d4..542d309eb 100644 --- a/packages/typespec-rust/CHANGELOG.md +++ b/packages/typespec-rust/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +## 0.36.0 (unreleased) + +### Breaking Changes + +* TypeSpec namespaces are now honored and emitted as sub-modules. + ## 0.35.0 (2026-02-13) ### Breaking Changes diff --git a/packages/typespec-rust/package.json b/packages/typespec-rust/package.json index 39bb7e457..a03d587ae 100644 --- a/packages/typespec-rust/package.json +++ b/packages/typespec-rust/package.json @@ -1,6 +1,6 @@ { "name": "@azure-tools/typespec-rust", - "version": "0.35.0", + "version": "0.36.0", "description": "TypeSpec emitter for Rust SDKs", "type": "module", "packageManager": "pnpm@10.10.0", diff --git a/packages/typespec-rust/src/codegen/clients.ts b/packages/typespec-rust/src/codegen/clients.ts index 3cddc8ba5..f3de702e4 100644 --- a/packages/typespec-rust/src/codegen/clients.ts +++ b/packages/typespec-rust/src/codegen/clients.ts @@ -19,17 +19,17 @@ export interface ClientModules { modules: Array; /** the client method options module */ - options: helpers.Module; + options?: helpers.Module; } /** * emits the content for all client files * - * @param crate the crate for which to emit clients - * @returns client content or undefined if the crate contains no clients + * @param module the module for which to emit clients + * @returns client content or undefined if the module contains no clients */ -export function emitClients(crate: rust.Crate): ClientModules | undefined { - if (crate.clients.length === 0) { +export function emitClients(module: rust.ModuleContainer): ClientModules | undefined { + if (module.clients.length === 0) { return undefined; } @@ -49,8 +49,8 @@ export function emitClients(crate: rust.Crate): ClientModules | undefined { const clientModules = new Array(); // emit the clients, one file per client - for (const client of crate.clients) { - const use = new Use('clients'); + for (const client of module.clients) { + const use = new Use(module, 'clients'); const indent = new helpers.indentation(); let body = helpers.formatDocComment(client.docs); @@ -196,6 +196,8 @@ export function emitClients(crate: rust.Crate): ClientModules | undefined { body += `${indent.push().get()}&self.${client.endpoint.name}\n`; body += `${indent.pop().get()}}\n\n`; + const crate = helpers.getCrate(module); + for (let i = 0; i < client.methods.length; ++i) { const method = client.methods[i]; const returnType = helpers.getTypeDeclaration(method.returns); @@ -295,7 +297,8 @@ export function emitClients(crate: rust.Crate): ClientModules | undefined { // add using for method_options as required for (const method of client.methods) { if (method.kind !== 'clientaccessor') { - use.add('crate::generated::models', method.options.type.name); + // client method options types are always in the same module as their client method + use.add(`${utils.buildImportPath(client.module, client.module)}::models`, method.options.type.name); } } @@ -313,17 +316,17 @@ export function emitClients(crate: rust.Crate): ClientModules | undefined { return { modules: clientModules, - options: getMethodOptions(crate), + options: getMethodOptions(module), }; } -function getMethodOptions(crate: rust.Crate): helpers.Module { - const use = new Use('modelsOther'); +function getMethodOptions(module: rust.ModuleContainer): helpers.Module | undefined { + const use = new Use(module, 'modelsOther'); const indent = new helpers.indentation(); const visTracker = new helpers.VisibilityTracker(); let body = ''; - for (const client of crate.clients) { + for (const client of module.clients) { for (let i = 0; i < client.methods.length; ++i) { const method = client.methods[i]; if (method.kind === 'clientaccessor') { @@ -377,6 +380,11 @@ function getMethodOptions(crate: rust.Crate): helpers.Module { } } + if (body === '') { + // client is top-level only, no methods just accessors + return undefined; + } + let content = helpers.contentPreamble(); content += use.text(); content += body; @@ -516,11 +524,11 @@ function getMethodParamsCountAndSig(method: rust.MethodType, use: Use): { count: * returns documentation for header trait access if the method has response headers. * * @param indent the current indentation level - * @param crate the crate to which method belongs + * @param module the module to which method belongs * @param method the method for which to generate header trait documentation * @returns the header trait documentation or empty string if not applicable */ -function getHeaderTraitDocComment(indent: helpers.indentation, crate: rust.Crate, method: ClientMethod): string { +function getHeaderTraitDocComment(indent: helpers.indentation, module: rust.ModuleContainer, method: ClientMethod): string { if (!method.responseHeaders) { return ''; } @@ -543,17 +551,17 @@ function getHeaderTraitDocComment(indent: helpers.indentation, crate: rust.Crate headerDocs += `${indent.get()}/// The returned [${helpers.wrapInBackTicks(returnType)}](azure_core::http::${returnType}) implements the [${helpers.wrapInBackTicks(traitName)}] trait, which provides\n`; headerDocs += `${indent.get()}/// access to response headers. For example:\n`; headerDocs += `${indent.get()}///\n`; - headerDocs += emitHeaderTraitDocExample(crate.name, method.responseHeaders, indent); + headerDocs += emitHeaderTraitDocExample(method.responseHeaders, indent); headerDocs += `${indent.get()}///\n`; headerDocs += `${indent.get()}/// ### Available headers\n`; // List all available headers for (const header of method.responseHeaders.headers) { - headerDocs += `${indent.get()}/// * [${helpers.wrapInBackTicks(header.name)}()](crate::generated::models::${traitName}::${header.name}) - ${header.header}\n`; + headerDocs += `${indent.get()}/// * [${helpers.wrapInBackTicks(header.name)}()](${utils.buildImportPath(module, module)}::models::${traitName}::${header.name}) - ${header.header}\n`; } headerDocs += `${indent.get()}///\n`; - headerDocs += `${indent.get()}/// [${helpers.wrapInBackTicks(traitName)}]: crate::generated::models::${traitName}\n`; + headerDocs += `${indent.get()}/// [${helpers.wrapInBackTicks(traitName)}]: ${utils.buildImportPath(module, module)}::models::${traitName}\n`; return headerDocs; } diff --git a/packages/typespec-rust/src/codegen/codeGenerator.ts b/packages/typespec-rust/src/codegen/codeGenerator.ts index 64aa79e88..36a91f1b5 100644 --- a/packages/typespec-rust/src/codegen/codeGenerator.ts +++ b/packages/typespec-rust/src/codegen/codeGenerator.ts @@ -11,7 +11,7 @@ import { emitUnions } from './unions.js'; import { Module } from './helpers.js'; import { emitLibRs } from './lib.js'; import { emitHeaderTraits } from './headerTraits.js'; -import { emitClientsModRs, emitGeneratedModRs, emitModelsModRs } from './mod.js'; +import { emitClientsModRs, emitGeneratedModRs, emitModelsModRs, emitSubModRs } from './mod.js'; import { emitModels } from './models.js'; import * as rust from '../codemodel/index.js'; @@ -37,6 +37,7 @@ export class CodeGenerator { constructor(crate: rust.Crate) { this.context = new Context(crate); this.crate = crate; + sortContent(this.crate); } /** @@ -54,7 +55,7 @@ export class CodeGenerator { * @returns the content for lib.rs */ emitLibRs(): string { - return emitLibRs(); + return emitLibRs(this.crate); } /** @@ -63,54 +64,141 @@ export class CodeGenerator { * @returns an array of files to emit */ emitContent(): Array { - const modelsModRS = new Array(); - const files = new Array(); - const clientsSubDir = 'clients'; - const modelsSubDir = 'models'; + const generatedSubDir = 'generated'; + const clientsSubDir = `${generatedSubDir}/clients`; + const modelsSubDir = `${generatedSubDir}/models`; - const addModelsFile = function (module: Module | undefined): void { + const addModelsFile = function (dir: string, files: Array, modelsModRS: Array, module: Module | undefined): void { if (!module) { return; } - files.push({ name: `${modelsSubDir}/${module.name}.rs`, content: module.content }); + files.push({ name: `${dir}${modelsSubDir}/${module.name}.rs`, content: module.content }); modelsModRS.push(`${module.visibility === 'pubCrate' ? 'pub(crate) ' : ''}mod ${module.name}`); if (module.visibility !== 'internal') { modelsModRS.push(`pub${module.visibility === 'pubCrate' ? '(crate)' : ''} use ${module.name}::*`); } }; - const clientModules = emitClients(this.crate); - if (clientModules) { - files.push(...clientModules.modules.map((module) => { return { name: `${clientsSubDir}/${module.name}.rs`, content: module.content }; })); - files.push({ name: `${clientsSubDir}/mod.rs`, content: emitClientsModRs(clientModules.modules.map((module) => module.name)) }); - addModelsFile(clientModules.options); - } + return this.recursiveEmit((module: rust.ModuleContainer, dir: string): Array => { + const modelsModRS = new Array(); + const files = new Array(); + + const clientModules = emitClients(module); + if (clientModules) { + files.push(...clientModules.modules.map((module) => { return { name: `${dir}${clientsSubDir}/${module.name}.rs`, content: module.content }; })); + files.push({ name: `${dir}${clientsSubDir}/mod.rs`, content: emitClientsModRs(clientModules.modules.map((module) => module.name)) }); + addModelsFile(dir, files, modelsModRS, clientModules.options); + } + + const enums = emitEnums(module, this.context); + addModelsFile(dir, files, modelsModRS, enums.definitions); + addModelsFile(dir, files, modelsModRS, enums.serde); + addModelsFile(dir, files, modelsModRS, enums.impls); + + const unions = emitUnions(module, this.context); + addModelsFile(dir, files, modelsModRS, unions.definitions); + addModelsFile(dir, files, modelsModRS, unions.impls); + addModelsFile(dir, files, modelsModRS, unions.serde); + + const models = emitModels(module, this.context); + addModelsFile(dir, files, modelsModRS, models.definitions); + addModelsFile(dir, files, modelsModRS, models.serde); + addModelsFile(dir, files, modelsModRS, models.impls); + addModelsFile(dir, files, modelsModRS, models.xmlHelpers); + + addModelsFile(dir, files, modelsModRS, emitHeaderTraits(module)); + + if (modelsModRS.length > 0) { + files.push({ name: `${dir}${modelsSubDir}/mod.rs`, content: emitModelsModRs(modelsModRS) }) + } + + if (module.clients.length > 0 || module.enums.length > 0 || module.models.length > 0 || module.unions.length > 0) { + files.push({ name: `${dir}${generatedSubDir}/mod.rs`, content: emitGeneratedModRs(module) }); + } + + return files; + }); + } + + /** + * recursively emits module contents. + * + * @param emitForModule the module contents to emit + */ + private recursiveEmit(emitForModule: (module: rust.ModuleContainer, dir: string) => Array): Array { + const content = new Array(); + const recursiveEmit = (module: rust.ModuleContainer, dir: string): void => { + content.push(...emitForModule(module, dir)); + + // recursively emit any sub-modules + for (const subModule of module.subModules) { + const subModuleDir = `${dir}${subModule.name}/`; + content.push({ + name: `${subModuleDir}mod.rs`, + content: emitSubModRs(subModule), + }); + recursiveEmit(subModule, subModuleDir); + } + }; - const enums = emitEnums(this.crate, this.context); - addModelsFile(enums.definitions); - addModelsFile(enums.serde); - addModelsFile(enums.impls); + recursiveEmit(this.crate, ''); + return content + } +} - const unions = emitUnions(this.crate, this.context); - addModelsFile(unions.definitions); - addModelsFile(unions.impls); - addModelsFile(unions.serde); +/** + * recursively sorts code model contents by name in alphabetical order. + * + * @param content the contents to sort + */ +function sortContent(content: rust.ModuleContainer): void { + const sortAscending = function(a: string, b: string): number { + return a < b ? -1 : a > b ? 1 : 0; + }; + + if (content.kind === 'crate') { + content.dependencies.sort((a: rust.CrateDependency, b: rust.CrateDependency) => { return sortAscending(a.name, b.name); }); + } - const models = emitModels(this.crate, this.context); - addModelsFile(models.definitions); - addModelsFile(models.serde); - addModelsFile(models.impls); - addModelsFile(models.xmlHelpers); + content.unions.sort((a: rust.DiscriminatedUnion, b: rust.DiscriminatedUnion) => { return sortAscending(a.name, b.name); }); + for (const rustUnion of content.unions) { + rustUnion.members.sort((a: rust.DiscriminatedUnionMember, b: rust.DiscriminatedUnionMember) => { return sortAscending(a.type.name, b.type.name); }); + } - addModelsFile(emitHeaderTraits(this.crate)); + content.enums.sort((a: rust.Enum, b: rust.Enum) => { return sortAscending(a.name, b.name); }); + for (const rustEnum of content.enums) { + rustEnum.values.sort((a: rust.EnumValue, b: rust.EnumValue) => { return sortAscending(a.name, b.name); }); + } + + content.models.sort((a: rust.MarkerType | rust.Model, b: rust.MarkerType | rust.Model) => { return sortAscending(a.name, b.name); }); + for (const model of content.models) { + if (model.kind === 'marker') { + continue; + } + model.fields.sort((a: rust.ModelFieldType, b: rust.ModelFieldType) => { return sortAscending(a.name, b.name); }); + } - if (modelsModRS.length > 0) { - files.push({ name: `${modelsSubDir}/mod.rs`, content: emitModelsModRs(modelsModRS) }) + content.clients.sort((a: rust.Client, b: rust.Client) => { return sortAscending(a.name, b.name); }); + for (const client of content.clients) { + client.fields.sort((a: rust.StructField, b: rust.StructField) => { return sortAscending(a.name, b.name); }); + client.methods.sort((a: rust.MethodType, b: rust.MethodType) => { return sortAscending(a.name, b.name); }); + if (client.constructable) { + client.constructable.options.type.fields.sort((a: rust.StructField, b: rust.StructField) => { return sortAscending(a.name, b.name); }); } + for (const method of client.methods) { + if (method.kind === 'clientaccessor') { + continue; + } else if (method.kind === 'pageable' && method.strategy?.kind === 'nextLink') { + method.strategy.reinjectedParams.sort((a: rust.MethodParameter, b: rust.MethodParameter) => sortAscending(a.name, b.name)); + } + method.options.type.fields.sort((a: rust.StructField, b: rust.StructField) => { return sortAscending(a.name, b.name); }); + method.responseHeaders?.headers.sort((a: rust.ResponseHeader, b: rust.ResponseHeader) => sortAscending(a.header, b.header)); + } + } - // there will always be something in the generated/mod.rs file - files.push({ name: 'mod.rs', content: emitGeneratedModRs(this.crate) }); + content.subModules.sort((a: rust.SubModule, b: rust.SubModule) => sortAscending(a.name, b.name)); - return files; + for (const subModule of content.subModules) { + sortContent(subModule); } } diff --git a/packages/typespec-rust/src/codegen/context.ts b/packages/typespec-rust/src/codegen/context.ts index d10fc3b73..a380eaae8 100644 --- a/packages/typespec-rust/src/codegen/context.ts +++ b/packages/typespec-rust/src/codegen/context.ts @@ -27,6 +27,10 @@ export class Context { * @param crate the crate for which the context will be constructed */ constructor(crate: rust.Crate) { + this.recursivePopulate(crate); + } + + private recursivePopulate(module: rust.ModuleContainer): void { const recursiveAddBodyFormat = (type: rust.Type, format: helpers.ModelFormat) => { type = helpers.unwrapType(type); if (type.kind !== 'model') { @@ -50,7 +54,7 @@ export class Context { // enumerate all client methods, looking for enum and model // params/responses and their wire format (JSON/XML etc). - for (const client of crate.clients) { + for (const client of module.clients) { for (const method of client.methods) { if (method.kind === 'clientaccessor') { continue; @@ -96,6 +100,10 @@ export class Context { } } } + + for (const subModule of module.subModules) { + this.recursivePopulate(subModule); + } } /** diff --git a/packages/typespec-rust/src/codegen/docTests.ts b/packages/typespec-rust/src/codegen/docTests.ts index 0ec15ca89..32124b52b 100644 --- a/packages/typespec-rust/src/codegen/docTests.ts +++ b/packages/typespec-rust/src/codegen/docTests.ts @@ -5,16 +5,16 @@ import * as helpers from './helpers.js'; import * as rust from '../codemodel/index.js'; +import * as utils from '../utils/utils.js'; /** * emit doc examples for accessing header traits * - * @param crateName the name of the containing crate * @param trait the trait for which to emit the examples * @param indent the indentation helper in scope or undefined for no indentation * @returns the examples text */ -export function emitHeaderTraitDocExample(crateName: string, trait: rust.ResponseHeadersTrait, indent?: helpers.indentation): string { +export function emitHeaderTraitDocExample(trait: rust.ResponseHeadersTrait, indent?: helpers.indentation): string { if (!indent) { // missing indent means no indentation indent = new helpers.indentation(0); @@ -42,7 +42,21 @@ export function emitHeaderTraitDocExample(crateName: string, trait: rust.Respons // internal types aren't accessible in doc tests so we ignore them let headerDocs = `${indent.get()}/// ${helpers.emitBackTicks(3)}${trait.visibility === 'pub' ? 'no_run' : 'ignore'}\n`; headerDocs += `${indent.get()}/// use azure_core::{Result, ${useFromHttp}};\n`; - headerDocs += `${indent.get()}/// use ${crateName}::models::{${helpers.getTypeDeclaration(targetType)}, ${trait.name}};\n`; + + const crateName = helpers.getCrate(trait.module).name; + if (targetType.kind !== 'model' || targetType.module === trait.module) { + // this is either a marker type or a model in the same module as the trait. + // either way, we can combine them into a single import statement. + headerDocs += `${indent.get()}/// use ${utils.buildImportPath(trait.module, trait.module, crateName)}::models::{${helpers.getTypeDeclaration(targetType)}, ${trait.name}};\n`; + } else { + // the model and trait are in different modules, so we need to import both + const imports = new Array( + `${utils.buildImportPath(trait.module, trait.module, crateName)}::models::${trait.name}`, + `${utils.buildImportPath(trait.module, targetType.module, crateName)}::models::${helpers.getTypeDeclaration(targetType)}`, + ); + headerDocs += imports.sort().map(imp => `${indent.get()}/// use ${imp};\n`).join(''); + } + headerDocs += `${indent.get()}/// async fn example() -> Result<()> {\n`; headerDocs += `${indent.get()}/// let response: ${helpers.getTypeDeclaration(trait.implFor)} = unimplemented!();\n`; headerDocs += `${indent.get()}/// // Access response headers\n`; diff --git a/packages/typespec-rust/src/codegen/enums.ts b/packages/typespec-rust/src/codegen/enums.ts index dd22af0d9..e3fcc7779 100644 --- a/packages/typespec-rust/src/codegen/enums.ts +++ b/packages/typespec-rust/src/codegen/enums.ts @@ -22,36 +22,36 @@ export interface Enums { /** * returns the emitted enum types, or empty if the - * crate contains no enum types. + * module contains no enum types. * - * @param crate the crate for which to emit enums - * @param context the context for the provided crate + * @param module the module for which to emit enums + * @param context the context for the provided module * @returns the enum models or empty */ -export function emitEnums(crate: rust.Crate, context: Context): Enums { - if (crate.enums.length === 0) { +export function emitEnums(module: rust.ModuleContainer, context: Context): Enums { + if (module.enums.length === 0) { return {}; } return { - definitions: emitEnumDefinitions(crate), - serde: emitEnumsSerde(crate), - impls: emitEnumsImpls(crate, context), + definitions: emitEnumDefinitions(module), + serde: emitEnumsSerde(module), + impls: emitEnumsImpls(module, context), }; } /** * emits the definitions for enums * - * @param crate the crate for which to emit enums + * @param module the module for which to emit enums * @returns the enum definitions */ -function emitEnumDefinitions(crate: rust.Crate): helpers.Module { +function emitEnumDefinitions(module: rust.ModuleContainer): helpers.Module { const indent = new helpers.indentation(); const visTracker = new helpers.VisibilityTracker(); let body = ''; - for (const rustEnum of crate.enums) { + for (const rustEnum of module.enums) { visTracker.update(rustEnum.visibility); body += emitEnumPublicDefinitions(indent, rustEnum); } @@ -69,15 +69,15 @@ function emitEnumDefinitions(crate: rust.Crate): helpers.Module { /** * emits the serde helpers for enums * - * @param crate the crate for which to emit serde helpers + * @param module the module for which to emit serde helpers * @returns the enum serde helpers */ -function emitEnumsSerde(crate: rust.Crate): helpers.Module { - const use = new Use('modelsOther'); +function emitEnumsSerde(module: rust.ModuleContainer): helpers.Module { + const use = new Use(module, 'modelsOther'); const indent = new helpers.indentation(); let body = ''; - for (const rustEnum of crate.enums) { + for (const rustEnum of module.enums) { body += emitEnumSerdeDefinitions(indent, use, rustEnum); } @@ -95,21 +95,21 @@ function emitEnumsSerde(crate: rust.Crate): helpers.Module { /** * emits the trait impls for enums * - * @param crate the crate for which to emit trait impls - * @param context the context for the provided crate + * @param module the module for which to emit trait impls + * @param context the context for the provided module * @returns the enum trait impls */ -function emitEnumsImpls(crate: rust.Crate, context: Context): helpers.Module { - const use = new Use('modelsOther'); +function emitEnumsImpls(module: rust.ModuleContainer, context: Context): helpers.Module { + const use = new Use(module, 'modelsOther'); const indent = new helpers.indentation(); let body = ''; - for (const rustEnum of crate.enums) { + for (const rustEnum of module.enums) { body += emitEnumImplDefinitions(indent, use, rustEnum); } // emit impls as required - for (const rustEnum of crate.enums) { + for (const rustEnum of module.enums) { body += context.getTryFromForRequestContent(rustEnum, use); } diff --git a/packages/typespec-rust/src/codegen/headerTraits.ts b/packages/typespec-rust/src/codegen/headerTraits.ts index fca0eff55..d123b9f1f 100644 --- a/packages/typespec-rust/src/codegen/headerTraits.ts +++ b/packages/typespec-rust/src/codegen/headerTraits.ts @@ -15,13 +15,13 @@ import * as utils from '../utils/utils.js'; * are no header traits. * the header traits provide access to typed response headers * - * @param crate the crate for which to emit header traits + * @param module the module for which to emit header traits * @returns the header traits content or undefined */ -export function emitHeaderTraits(crate: rust.Crate): helpers.Module | undefined { +export function emitHeaderTraits(module: rust.ModuleContainer): helpers.Module | undefined { const srcTraits = new Map>(); - for (const client of crate.clients) { + for (const client of module.clients) { for (const method of client.methods) { if (method.kind === 'clientaccessor') { continue; @@ -63,8 +63,14 @@ export function emitHeaderTraits(crate: rust.Crate): helpers.Module | undefined // for traits with multiple impls, merge them into a single trait const mergedHeaders = new Array(); let mergedDocs = '/// Provides access to typed response headers for the following methods:\n'; + let module: rust.ModuleContainer | undefined; for (const src of srcTrait) { mergedDocs += `/// * ${src.docs}\n`; + if (!module) { + module = src.module; + } else if (module !== src.module) { + throw new CodegenError('InternalError', 'cannot merge header traits from different modules'); + } for (const responseHeader of src.headers) { const matchingHeader = mergedHeaders.find(h => h.header === responseHeader.header); @@ -77,7 +83,7 @@ export function emitHeaderTraits(crate: rust.Crate): helpers.Module | undefined } } - const mergedTrait = new rust.ResponseHeadersTrait(srcTrait[0].name, srcTrait[0].implFor, mergedDocs, srcTrait[0].visibility); + const mergedTrait = new rust.ResponseHeadersTrait(srcTrait[0].name, srcTrait[0].implFor, mergedDocs, srcTrait[0].visibility, module!); mergedTrait.headers = mergedHeaders; traits.push(mergedTrait); addHeaders(...mergedHeaders); @@ -119,7 +125,7 @@ export function emitHeaderTraits(crate: rust.Crate): helpers.Module | undefined return `fn ${header.name}(&self) -> Result<${resultType}>`; }; - const use = new Use('modelsOther'); + const use = new Use(module, 'modelsOther'); use.add('azure_core', 'Result'); use.add('azure_core::http', 'headers::HeaderName', 'Response'); @@ -147,7 +153,7 @@ export function emitHeaderTraits(crate: rust.Crate): helpers.Module | undefined body += `///\n`; body += `/// # Examples\n`; body += `///\n`; - body += emitHeaderTraitDocExample(crate.name, trait); + body += emitHeaderTraitDocExample(trait); } body += `${helpers.emitVisibility(trait.visibility)}trait ${trait.name}: private::Sealed {\n`; for (const header of trait.headers) { @@ -170,7 +176,7 @@ export function emitHeaderTraits(crate: rust.Crate): helpers.Module | undefined let content = helpers.contentPreamble(); content += use.text(); content += body; - content += getSealedImpls(traits); + content += getSealedImpls(module, traits); return { name: 'header_traits', @@ -241,13 +247,14 @@ function getHeaderDeserialization(indent: helpers.indentation, use: Use, header: /** * returns the mod private {...} section used to seal the header traits. * + * @param module the module being processed * @param traitDefs the trait definitions to seal * @returns the private mod definition */ -function getSealedImpls(traitDefs: Array): string { +function getSealedImpls(module: rust.ModuleContainer, traitDefs: Array): string { // we set nestedModAssumesTypesInParentScope to true as all of the types // required in this mod are already in scope within our parent mod. - const use = new Use('modelsOther'); + const use = new Use(module, 'modelsOther'); const indent = new helpers.indentation(); use.add('azure_core::http', 'Response'); diff --git a/packages/typespec-rust/src/codegen/helpers.ts b/packages/typespec-rust/src/codegen/helpers.ts index 017f34e16..b9aa786c5 100644 --- a/packages/typespec-rust/src/codegen/helpers.ts +++ b/packages/typespec-rust/src/codegen/helpers.ts @@ -666,3 +666,17 @@ export function isQueryParameter(param: rust.MethodParameter): param is rust.Que return false; } } + +/** + * returns the containing crate for a module. + * + * @param module the module + * @returns the containing crate + */ +export function getCrate(module: rust.ModuleContainer): rust.Crate { + let cur = module; + while (cur.kind !== 'crate') { + cur = cur.parent; + } + return cur; +} diff --git a/packages/typespec-rust/src/codegen/lib.ts b/packages/typespec-rust/src/codegen/lib.ts index 4bcef3c4b..cc0c9356c 100644 --- a/packages/typespec-rust/src/codegen/lib.ts +++ b/packages/typespec-rust/src/codegen/lib.ts @@ -4,17 +4,21 @@ *--------------------------------------------------------------------------------------------*/ import * as helpers from './helpers.js'; +import * as rust from '../codemodel/index.js'; /** * emits the contents of the lib.rs file * * @returns the contents of the lib.rs file */ -export function emitLibRs(): string { +export function emitLibRs(crate: rust.Crate): string { let content = helpers.contentPreamble(false); content += '#![cfg_attr(docsrs, feature(doc_cfg))]\n'; content += '\n'; content += 'mod generated;\n'; content += 'pub use generated::*;\n'; + for (const subModule of crate.subModules) { + content += `pub mod ${subModule.name};\n`; + } return content; } diff --git a/packages/typespec-rust/src/codegen/mod.ts b/packages/typespec-rust/src/codegen/mod.ts index 18cb88b78..1322f24a4 100644 --- a/packages/typespec-rust/src/codegen/mod.ts +++ b/packages/typespec-rust/src/codegen/mod.ts @@ -31,25 +31,25 @@ export function emitClientsModRs(modules: Array): string { /** * emits the contents of the generated/mod.rs file * - * @param crate the crate for which to emit the mod.rs file + * @param module the module for which to emit the mod.rs file * @returns the contents of the mod.rs file */ -export function emitGeneratedModRs(crate: rust.Crate): string { +export function emitGeneratedModRs(module: rust.ModuleContainer): string { let content = helpers.contentPreamble(); const pubModModels = '/// Contains all the data structures and types used by the client library.\npub mod models;\n' - if (crate.clients.length > 0) { + if (module.clients.length > 0) { content += '/// Clients used to communicate with the service.\n'; content += 'pub mod clients;\n'; - // client method options are in the models module - content += pubModModels; - } else if (crate.enums.length > 0 || crate.models.length > 0 || crate.unions.length > 0) { + } + + if (module.clients.find((client) => client.methods.find((method) => method.kind !== 'clientaccessor')) || module.enums.length > 0 || module.models.length > 0 || module.unions.length > 0) { content += pubModModels; } - if (crate.clients.length > 0) { + if (module.clients.length > 0) { // the instantiable clients and their options types get re-exported from the root const clientsAndClientOptions = new Array(); - for (const client of crate.clients) { + for (const client of module.clients) { if (client.constructable) { clientsAndClientOptions.push(client.name); @@ -59,7 +59,10 @@ export function emitGeneratedModRs(crate: rust.Crate): string { } } } - content += `pub use clients::{${clientsAndClientOptions.join(', ')}};\n`; + + if (clientsAndClientOptions.length > 0) { + content += `pub use clients::{${clientsAndClientOptions.join(', ')}};\n`; + } } return content; @@ -76,3 +79,20 @@ export function emitModelsModRs(modules: Array): string { return helpers.contentPreamble() + modules.sort().map((module) => module.match(/mod models$/) ? `#[allow(clippy::module_inception)]\n${module}` : module).join(';\n') + ';\n'; } + +/** + * emits the contents of mod.rs for a sub-module + * + * @param module the sub-module for which to emit the content + * @returns the contents of the mod.rs file + */ +export function emitSubModRs(module: rust.SubModule): string { + let content = helpers.contentPreamble();// + if (module.clients.length > 0 || module.enums.length > 0 || module.models.length > 0 || module.unions.length > 0) { + content += 'mod generated;\npub use generated::*;\n'; + } + for (const subModule of module.subModules) { + content += `pub mod ${subModule.name};\n`; + } + return content; +} diff --git a/packages/typespec-rust/src/codegen/models.ts b/packages/typespec-rust/src/codegen/models.ts index 523dd2361..e2a8b2b55 100644 --- a/packages/typespec-rust/src/codegen/models.ts +++ b/packages/typespec-rust/src/codegen/models.ts @@ -29,42 +29,46 @@ export interface Models { /** * returns the emitted model types, or empty if the - * crate contains no model types. + * module contains no model types. * - * @param crate the crate for which to emit models - * @param context the context for the provided crate + * @param module the module for which to emit models + * @param context the context for the provided module * @returns the model content or empty */ -export function emitModels(crate: rust.Crate, context: Context): Models { - if (crate.models.length === 0) { +export function emitModels(module: rust.ModuleContainer, context: Context): Models { + if (module.models.length === 0) { return {}; } + serdeHelpers.clear(); + serdeHelpersForXmlAddlProps.clear(); + xmlListWrappers.clear(); + return { - definitions: emitModelDefinitions(crate, context), - serde: emitModelsSerde(), - impls: emitModelImpls(crate, context), - xmlHelpers: emitXMLListWrappers(), + definitions: emitModelDefinitions(module, context), + serde: emitModelsSerde(module), + impls: emitModelImpls(module, context), + xmlHelpers: emitXMLListWrappers(module), }; } /** * the implementation of emitModels * - * @param crate the crate for which to emit models - * @param context the context for the provided crate + * @param module the module for which to emit models + * @param context the context for the provided module * @returns the model content or empty */ -function emitModelDefinitions(crate: rust.Crate, context: Context): helpers.Module | undefined { +function emitModelDefinitions(module: rust.ModuleContainer, context: Context): helpers.Module | undefined { // for the internal models we might need to use public model types - const use = new Use('models'); + const use = new Use(module, 'models'); use.add('azure_core::fmt', 'SafeDebug'); const indent = new helpers.indentation(); const visTracker = new helpers.VisibilityTracker(); let body = ''; - for (const model of crate.models) { + for (const model of module.models) { visTracker.update(model.visibility); if (model.kind === 'marker') { body += helpers.formatDocComment(model.docs); @@ -116,7 +120,7 @@ function emitModelDefinitions(crate: rust.Crate, context: Context): helpers.Modu } else if (discriminator) { // find the matching DU member for this model let duMember: rust.DiscriminatedUnionMember | undefined; - for (const union of crate.unions) { + for (const union of module.unions) { for (const member of union.members) { if (member.type === model) { duMember = member; @@ -169,7 +173,7 @@ function emitModelDefinitions(crate: rust.Crate, context: Context): helpers.Modu const deserializeWith = field.customizations.find((each) => each.kind === 'deserializeWith'); if (unwrappedType.kind === 'encodedBytes' || unwrappedType.kind === 'enumValue' || unwrappedType.kind === 'literal' || unwrappedType.kind === 'offsetDateTime' || encodeAsString(unwrappedType)) { - addSerDeHelper(field, serdeParams, bodyFormat, use, deserializeWith); + addSerDeHelper(module, field, serdeParams, bodyFormat, use, deserializeWith); } else if (bodyFormat === 'xml' && utils.unwrapOption(field.type).kind === 'Vec' && field.xmlKind !== 'unwrappedList') { // this is a wrapped list so we need a helper type for serde const xmlListWrapper = getXMLListWrapper(field); @@ -229,10 +233,11 @@ function emitModelDefinitions(crate: rust.Crate, context: Context): helpers.Modu * returns serde helpers for public models. * if no helpers are required, undefined is returned. * + * @param module the module being processed * @returns the model serde helpers content or undefined */ -function emitModelsSerde(): helpers.Module | undefined { - const use = new Use('modelsOther'); +function emitModelsSerde(module: rust.ModuleContainer): helpers.Module | undefined { + const use = new Use(module, 'modelsOther'); const serdeHelpers = emitSerDeHelpers(use); if (!serdeHelpers) { @@ -255,16 +260,16 @@ function emitModelsSerde(): helpers.Module | undefined { * returns any trait impls for public models. * if no helpers are required, undefined is returned. * - * @param crate the crate for which to emit model serde helpers - * @param context the context for the provided crate + * @param module the module for which to emit model serde helpers + * @param context the context for the provided module * @returns the model serde helpers content or undefined */ -function emitModelImpls(crate: rust.Crate, context: Context): helpers.Module | undefined { - const use = new Use('modelsOther'); +function emitModelImpls(module: rust.ModuleContainer, context: Context): helpers.Module | undefined { + const use = new Use(module, 'modelsOther'); const entries = new Array(); // emit From for tagged enum types - for (const union of crate.unions) { + for (const union of module.unions) { const indent = new helpers.indentation(); use.addForType(union); for (const member of union.members) { @@ -279,7 +284,7 @@ function emitModelImpls(crate: rust.Crate, context: Context): helpers.Module | u } // emit TryFrom as required - for (const model of crate.models) { + for (const model of module.models) { if (model.kind === 'marker') { // no impls for marker types continue; @@ -468,9 +473,10 @@ function getXMLListWrapper(field: rust.ModelField): XMLListWrapper { * emits helper types for XML lists or returns undefined * if no XMLListWrappers are required. * + * @param module the module being processed * @returns the helper models for wrapped XML lists or undefined */ -function emitXMLListWrappers(): helpers.Module | undefined { +function emitXMLListWrappers(module: rust.ModuleContainer): helpers.Module | undefined { if (xmlListWrappers.size === 0) { return undefined; } @@ -479,7 +485,7 @@ function emitXMLListWrappers(): helpers.Module | undefined { wrapperTypes.sort((a, b) => { return helpers.sortAscending(a.name, b.name); }); const indent = new helpers.indentation(); - const use = new Use('modelsOther'); + const use = new Use(module, 'modelsOther'); use.add('serde', 'Deserialize', 'Deserializer', 'Serialize', 'Serializer'); @@ -541,13 +547,14 @@ const serdeHelpersForXmlAddlProps = new Map, format: helpers.ModelFormat, use: Use, deserializeWith?: rust.DeserializeWith): void { +function addSerDeHelper(module: rust.ModuleContainer, field: rust.ModelField, serdeParams: Set, format: helpers.ModelFormat, use: Use, deserializeWith?: rust.DeserializeWith): void { const unwrapped = helpers.unwrapType(field.type); switch (unwrapped.kind) { case 'encodedBytes': @@ -607,7 +614,7 @@ function addSerDeHelper(field: rust.ModelField, serdeParams: Set, format // we can reuse identical helpers across model types if (!serdeHelpers.has(name)) { serdeHelpers.set(name, (indent: helpers.indentation): string => { - const modUse = new Use('modelsOther'); + const modUse = new Use(module, 'modelsOther'); let modContent = `pub mod ${name} {\n`; modContent += `${indent.get()}#![allow(clippy::type_complexity)]\n`; const deserialize = deserializeWith ? '' : `${buildDeserialize(indent, field.type, modUse)}\n`; diff --git a/packages/typespec-rust/src/codegen/unions.ts b/packages/typespec-rust/src/codegen/unions.ts index 1232a3c4e..ce1282ebd 100644 --- a/packages/typespec-rust/src/codegen/unions.ts +++ b/packages/typespec-rust/src/codegen/unions.ts @@ -23,23 +23,23 @@ export interface Unions { /** * returns the union enum types, or undefined if the - * crate contains no union types. + * module contains no union types. * - * @param crate the crate for which to emit unions - * @param context the context for the provided crate + * @param module the module for which to emit unions + * @param context the context for the provided module * @returns the union content or undefined */ -export function emitUnions(crate: rust.Crate, context: Context): Unions { - if (crate.unions.length === 0) { +export function emitUnions(module: rust.ModuleContainer, context: Context): Unions { + if (module.unions.length === 0) { return {}; } - const use = new Use('modelsOther'); + const use = new Use(module, 'modelsOther'); const indent = new helpers.indentation(); const visTracker = new helpers.VisibilityTracker(); let body = ''; - for (const rustUnion of crate.unions) { + for (const rustUnion of module.unions) { visTracker.update(rustUnion.visibility); const docs = helpers.formatDocComment(rustUnion.docs, true); if (docs.length > 0) { @@ -92,8 +92,8 @@ export function emitUnions(crate: rust.Crate, context: Context): Unions { content: content, visibility: visTracker.get(), }, - impls: emitUnionImpls(crate, context), - serde: emitUnionSerde(crate), + impls: emitUnionImpls(module, context), + serde: emitUnionSerde(module), }; } @@ -139,15 +139,15 @@ function getPolymorphicUnknownVariant(indent: helpers.indentation, use: Use, bas * returns any trait impls for union types. * if no helpers are required, undefined is returned. * - * @param crate the crate for which to emit model impls - * @param context the context for the provided crate + * @param module the module for which to emit model impls + * @param context the context for the provided module * @returns the union impls content or undefined */ -function emitUnionImpls(crate: rust.Crate, context: Context): helpers.Module | undefined { - const use = new Use('modelsOther'); +function emitUnionImpls(module: rust.ModuleContainer, context: Context): helpers.Module | undefined { + const use = new Use(module, 'modelsOther'); const entries = new Array(); - for (const rustUnion of crate.unions) { + for (const rustUnion of module.unions) { const forReq = context.getTryFromForRequestContent(rustUnion, use); // helpers aren't required for all types, so only @@ -178,19 +178,19 @@ function emitUnionImpls(crate: rust.Crate, context: Context): helpers.Module | u * returns the content for unions_serde.rs. * if no helpers are required, undefined is returned. * - * @param crate the crate for which to emit model impls + * @param module the module for which to emit model impls * @returns the union serde helpers or undefined */ -function emitUnionSerde(crate: rust.Crate): helpers.Module | undefined { - if (crate.unions.length === 0) { +function emitUnionSerde(module: rust.ModuleContainer): helpers.Module | undefined { + if (module.unions.length === 0) { return undefined; } - const use = new Use('modelsOther'); + const use = new Use(module, 'modelsOther'); const indent = new helpers.indentation(); let body = ''; - for (const rustUnion of crate.unions) { + for (const rustUnion of module.unions) { if (!isPolymorphicDU(rustUnion.unionKind) || rustUnion.unionKind.kind !== 'discriminatedUnionBase') { continue; } diff --git a/packages/typespec-rust/src/codegen/use.ts b/packages/typespec-rust/src/codegen/use.ts index fbd4dd70d..5ec29f85f 100644 --- a/packages/typespec-rust/src/codegen/use.ts +++ b/packages/typespec-rust/src/codegen/use.ts @@ -6,22 +6,26 @@ import * as helpers from './helpers.js'; import { CodegenError } from './errors.js'; import * as rust from '../codemodel/index.js'; +import * as utils from '../utils/utils.js'; /** used to generate use statements */ export class Use { + private readonly module: rust.ModuleContainer; private readonly trees: Array; private readonly scope: 'clients' | 'models' | 'modelsOther'; /** * instantiates a new instance of the Use type * + * @param module the module that contains the files in scope * @param scope indicates a scope in which use statements are constructed. * this is only applicable when constructing the path to generated types. * clients - we're in generated/clients * models - we're in generated/models/models.rs * modelsOther - we're in generated/models but not models.rs */ - constructor(scope: 'clients' | 'models' | 'modelsOther') { + constructor(module: rust.ModuleContainer, scope: 'clients' | 'models' | 'modelsOther') { + this.module = module; this.trees = new Array(); this.scope = scope; } @@ -70,12 +74,16 @@ export class Use { return this.addForType(type.type); case 'client': { // client type are only referenced from other things in generated/clients so we ignore any scope - this.add('crate::generated::clients', type.name); + this.add(`${utils.buildImportPath(this.module, type.module)}::clients`, type.name); break; } case 'discriminatedUnion': case 'enum': - this.add(this.scope === 'clients' ? 'crate::generated::models' : 'super', type.name); + if (this.scope === 'clients' || this.module !== type.module) { + this.add(`${utils.buildImportPath(this.module, type.module)}::models`, type.name); + } else { + this.add('super', type.name); + } break; case 'enumValue': this.addForType(type.type); @@ -83,7 +91,8 @@ export class Use { case 'marker': switch (this.scope) { case 'clients': - this.add('crate::generated::models', type.name); + // marker types are always in the same module as their client method + this.add(`${utils.buildImportPath(this.module, this.module)}::models`, type.name); break; case 'modelsOther': this.add('super', type.name); @@ -95,16 +104,10 @@ export class Use { } break; case 'model': - switch (this.scope) { - case 'clients': - this.add('crate::generated::models', type.name); - break; - case 'models': - // we're in models so no need to bring another model into scope - break; - case 'modelsOther': - this.add('super', type.name); - break; + if (this.scope === 'clients' || this.module !== type.module) { + this.add(`${utils.buildImportPath(this.module, type.module)}::models`, type.name); + } else if (this.scope === 'modelsOther') { + this.add('super', type.name); } break; case 'asyncResponse': @@ -149,7 +152,8 @@ export class Use { case 'responseHeadersTrait': switch (this.scope) { case 'clients': - this.add(`crate::generated::models`, type.name); + // header response traits are always in the same module as their client method + this.add(`${utils.buildImportPath(this.module, this.module)}::models`, type.name); break; case 'models': case 'modelsOther': diff --git a/packages/typespec-rust/src/codemodel/client.ts b/packages/typespec-rust/src/codemodel/client.ts index 3cd1f0b69..25b92299c 100644 --- a/packages/typespec-rust/src/codemodel/client.ts +++ b/packages/typespec-rust/src/codemodel/client.ts @@ -3,6 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import { ModuleContainer } from './crate.js'; import * as method from './method.js'; import * as types from './types.js'; @@ -43,6 +44,9 @@ export interface Client { /** all the methods for this client */ methods: Array; + /** the module to which this client belongs */ + module: ModuleContainer; + /** the parent client in a hierarchical client */ parent?: Client; } @@ -556,6 +560,9 @@ export interface ResponseHeadersTrait { /** indicates the visibility of the trait */ visibility: types.Visibility; + + /** the module to which this trait belongs */ + module: ModuleContainer; } /////////////////////////////////////////////////////////////////////////////////////////////////// @@ -662,11 +669,12 @@ export class BodyParameter extends HTTPParameterBase implements BodyParameter { } export class Client implements Client { - constructor(name: string) { + constructor(name: string, module: ModuleContainer) { this.kind = 'client'; this.name = name; this.fields = new Array(); this.methods = new Array(); + this.module = module; this.docs = {}; } } @@ -904,13 +912,14 @@ export class ResponseHeaderScalar implements ResponseHeaderScalar { } export class ResponseHeadersTrait implements ResponseHeadersTrait { - constructor(name: string, implFor: types.AsyncResponse | types.Response, docs: string, visibility: types.Visibility) { + constructor(name: string, implFor: types.AsyncResponse | types.Response, docs: string, visibility: types.Visibility, module: ModuleContainer) { this.kind = 'responseHeadersTrait'; this.name = name; this.implFor = implFor; this.docs = docs; this.headers = new Array(); this.visibility = visibility; + this.module = module; } } diff --git a/packages/typespec-rust/src/codemodel/crate.ts b/packages/typespec-rust/src/codemodel/crate.ts index edd08c9d1..7e11b390b 100644 --- a/packages/typespec-rust/src/codemodel/crate.ts +++ b/packages/typespec-rust/src/codemodel/crate.ts @@ -10,7 +10,9 @@ import * as types from './types.js'; * Crate is a Rust crate * the Rust edition is centrally managed */ -export interface Crate { +export interface Crate extends ModuleBase { + kind: 'crate'; + /** the name of the Crate */ name: string; @@ -23,17 +25,8 @@ export interface Crate { /** the Crates on which this Crate depends */ dependencies: Array; - /** unions contains all of the discriminated unions for this crate. can be empty */ - unions: Array; - - /** enums contains all of the enums for this crate. can be empty */ - enums: Array; - - /** models contains all of the models for this crate. can be empty */ - models: Array; - - /** clients contains all the clients for this crate. can be empty */ - clients: Array; + /** any sub-modules. can be empty */ + subModules: Array; } /** ServiceType defines the possible service types */ @@ -52,19 +45,70 @@ export interface CrateDependency { features: Array; } +/** defines the container for emitted content */ +export type ModuleContainer = Crate | SubModule; + +/** + * SubModule is a Rust module within a crate. it contains + * a mod.rs file and generated directory with its contents. + * + * sub1 /src/sub1/mod.rs + * /src/sub1/generated/* + * nested /src/sub1/nested/mod.rs + * /src/sub1/nested/generated/* + */ +export interface SubModule extends ModuleBase { + kind: 'module'; + + /** the name of this module */ + name: string; + + /** any sub-modules. can be empty */ + subModules: Array; + + /** this module's parent */ + parent: ModuleContainer; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// base types +/////////////////////////////////////////////////////////////////////////////////////////////////// + +interface ModuleBase { + /** clients contains all the clients for this module. can be empty */ + clients: Array; + + /** enums contains all of the enums for this module. can be empty */ + enums: Array; + + /** models contains all of the models for this module. can be empty */ + models: Array; + + /** unions contains all of the discriminated unions for this module. can be empty */ + unions: Array; +} + +class ModuleBase implements ModuleBase { + constructor() { + this.clients = new Array(); + this.enums = new Array(); + this.models = new Array(); + this.unions = new Array(); + } +} + /////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////// -export class Crate implements Crate { +export class Crate extends ModuleBase implements Crate { constructor(name: string, version: string, type: ServiceType) { + super(); + this.kind = 'crate'; this.name = name; this.version = version; this.type = type; this.dependencies = new Array(); - this.unions = new Array(); - this.enums = new Array(); - this.models = new Array(); - this.clients = new Array(); + this.subModules = new Array(); } /** @@ -81,47 +125,6 @@ export class Crate implements Crate { } this.dependencies.push(dependency); } - - /** lexicographically sorts all content */ - sortContent(): void { - const sortAscending = function(a: string, b: string): number { - return a < b ? -1 : a > b ? 1 : 0; - }; - - this.dependencies.sort((a: CrateDependency, b: CrateDependency) => { return sortAscending(a.name, b.name); }); - this.unions.sort((a: types.DiscriminatedUnion, b: types.DiscriminatedUnion) => { return sortAscending(a.name, b.name); }); - for (const rustUnion of this.unions) { - rustUnion.members.sort((a: types.DiscriminatedUnionMember, b: types.DiscriminatedUnionMember) => { return sortAscending(a.type.name, b.type.name); }); - } - this.enums.sort((a: types.Enum, b: types.Enum) => { return sortAscending(a.name, b.name); }); - for (const rustEnum of this.enums) { - rustEnum.values.sort((a: types.EnumValue, b: types.EnumValue) => { return sortAscending(a.name, b.name); }); - } - this.models.sort((a: types.MarkerType | types.Model, b: types.MarkerType | types.Model) => { return sortAscending(a.name, b.name); }); - for (const model of this.models) { - if (model.kind === 'marker') { - continue; - } - model.fields.sort((a: types.ModelFieldType, b: types.ModelFieldType) => { return sortAscending(a.name, b.name); }); - } - this.clients.sort((a: client.Client, b: client.Client) => { return sortAscending(a.name, b.name); }); - for (const client of this.clients) { - client.fields.sort((a: types.StructField, b: types.StructField) => { return sortAscending(a.name, b.name); }); - client.methods.sort((a: client.MethodType, b: client.MethodType) => { return sortAscending(a.name, b.name); }); - if (client.constructable) { - client.constructable.options.type.fields.sort((a: types.StructField, b: types.StructField) => { return sortAscending(a.name, b.name); }); - } - for (const method of client.methods) { - if (method.kind === 'clientaccessor') { - continue; - } else if (method.kind === 'pageable' && method.strategy?.kind === 'nextLink') { - method.strategy.reinjectedParams.sort((a: client.MethodParameter, b: client.MethodParameter) => sortAscending(a.name, b.name)); - } - method.options.type.fields.sort((a: types.StructField, b: types.StructField) => { return sortAscending(a.name, b.name); }); - method.responseHeaders?.headers.sort((a: client.ResponseHeader, b: client.ResponseHeader) => sortAscending(a.header, b.header)); - } - } - } } export class CrateDependency implements CrateDependency { @@ -130,3 +133,13 @@ export class CrateDependency implements CrateDependency { this.features = features; } } + +export class SubModule extends ModuleBase implements SubModule { + constructor(name: string, parent: ModuleContainer) { + super(); + this.kind = 'module'; + this.name = name; + this.subModules = new Array(); + this.parent = parent; + } +} diff --git a/packages/typespec-rust/src/codemodel/types.ts b/packages/typespec-rust/src/codemodel/types.ts index 272f6a642..a9410aaf6 100644 --- a/packages/typespec-rust/src/codemodel/types.ts +++ b/packages/typespec-rust/src/codemodel/types.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Crate, CrateDependency } from './crate.js'; +import { Crate, CrateDependency, ModuleContainer } from './crate.js'; import { ModelFieldCustomizations } from './customizations.js'; /** Docs contains the values used in doc comment generation. */ @@ -113,6 +113,9 @@ export interface Enum { /** the underlying type of the enum */ type: EnumType; + + /** the module to which this enum belongs */ + module: ModuleContainer; } /** EnumValue is an enum value for a specific Enum */ @@ -153,6 +156,9 @@ export interface DiscriminatedUnion { /** the kind of discriminated union */ unionKind?: DiscriminatedUnionKind; + + /** the module to which this discriminated union belongs */ + module: ModuleContainer; } /** DiscriminatedUnionKind contains the kinds of discriminated unions */ @@ -279,6 +285,9 @@ export interface Model extends StructBase { /** the flags set for this model */ flags: ModelFlags; + /** the module to which this model belongs */ + module: ModuleContainer; + /** * the name of the type over the wire if it's * different from the type's name. @@ -752,13 +761,14 @@ export class EncodedBytes implements EncodedBytes { } export class Enum implements Enum { - constructor(name: string, visibility: Visibility, extensible: boolean, type: EnumType) { + constructor(name: string, visibility: Visibility, extensible: boolean, type: EnumType, module: ModuleContainer) { this.kind = 'enum'; this.name = name; this.visibility = visibility; this.values = new Array(); this.extensible = extensible; this.type = type; + this.module = module; this.docs = {}; } } @@ -834,12 +844,13 @@ export class MarkerType implements MarkerType { } export class DiscriminatedUnion implements DiscriminatedUnion { - constructor(name: string, visibility: Visibility, discriminant: string) { + constructor(name: string, visibility: Visibility, discriminant: string, module: ModuleContainer) { this.kind = 'discriminatedUnion'; this.name = name; this.visibility = visibility; this.members = new Array(); this.discriminant = discriminant; + this.module = module; this.docs = {}; } } @@ -874,10 +885,11 @@ export class DiscriminatedUnionSealed implements DiscriminatedUnionSealed { } export class Model extends StructBase implements Model { - constructor(name: string, visibility: Visibility, flags: ModelFlags) { + constructor(name: string, visibility: Visibility, flags: ModelFlags, module: ModuleContainer) { super('model', name, visibility); this.fields = new Array(); this.flags = flags; + this.module = module; } } diff --git a/packages/typespec-rust/src/emitter.ts b/packages/typespec-rust/src/emitter.ts index e641072ba..743620bc5 100644 --- a/packages/typespec-rust/src/emitter.ts +++ b/packages/typespec-rust/src/emitter.ts @@ -10,8 +10,8 @@ import { CodegenError } from './codegen/errors.js'; import { Adapter, AdapterError, ExternalError } from './tcgcadapter/adapter.js'; import { reportDiagnostic, RustEmitterOptions } from './lib.js'; import { execSync } from 'child_process'; -import { existsSync, rmSync } from 'fs'; -import { mkdir, writeFile } from 'fs/promises'; +import * as fs from 'fs'; +import { mkdir, readdir, writeFile } from 'fs/promises'; import * as path from 'path'; import { EmitContext, NoTarget } from '@typespec/compiler'; import 'source-map-support/register.js'; @@ -25,14 +25,14 @@ export async function $onEmit(context: EmitContext) { let failed = false; try { const adapter = await Adapter.create(context); - const crate = adapter.tcgcToCrate(context); - - await mkdir(`${context.emitterOutputDir}/src`, { recursive: true }); - + const crate = adapter.tcgcToCrate(); const codegen = new CodeGenerator(crate); - const libRsPath = `${context.emitterOutputDir}/src/lib.rs`; - if (existsSync(libRsPath) && context.options['overwrite-lib-rs'] !== true) { + const srcDir = path.join(context.emitterOutputDir, 'src'); + await mkdir(srcDir, { recursive: true }); + + const libRsPath = path.join(srcDir, 'lib.rs'); + if (fs.existsSync(libRsPath) && context.options['overwrite-lib-rs'] !== true) { context.program.reportDiagnostic({ code: 'FileAlreadyExists', severity: 'warning', @@ -43,10 +43,21 @@ export async function $onEmit(context: EmitContext) { await writeFile(libRsPath, codegen.emitLibRs()); } + // remove all directories under src that contain generated code + const srcEntries = await readdir(srcDir, { withFileTypes: true }); + for (const entry of srcEntries) { + if (!entry.isDirectory()) { + continue; + } + const targetDir = path.join(srcDir, entry.name); + if (shouldRmDir(targetDir)) { + fs.rmSync(targetDir, { force: true, recursive: true }); + } + } + const files = codegen.emitContent(); - rmSync(path.join(context.emitterOutputDir, 'src', 'generated'), { force: true, recursive: true }); for (const file of files) { - await writeToGeneratedDir(context.emitterOutputDir, file.name, file.content); + await writeToCrateDir(context.emitterOutputDir, file.name, file.content); } // NOTE: To allow the generated code to add cargo dependencies as needed (by calling crate.addDependency()), @@ -56,8 +67,8 @@ export async function $onEmit(context: EmitContext) { // don't overwrite an existing Cargo.toml file by default // TODO: consider merging existing dependencies with emitted dependencies when overwriting // https://github.com/Azure/typespec-rust/issues/22 - const cargoTomlPath = `${context.emitterOutputDir}/Cargo.toml`; - if (existsSync(cargoTomlPath) && context.options['overwrite-cargo-toml'] !== true) { + const cargoTomlPath = path.join(context.emitterOutputDir, 'Cargo.toml'); + if (fs.existsSync(cargoTomlPath) && context.options['overwrite-cargo-toml'] !== true) { context.program.reportDiagnostic({ code: 'FileAlreadyExists', severity: 'warning', @@ -138,8 +149,8 @@ export async function $onEmit(context: EmitContext) { * @param filename the name of the file to write. can contain sub-directories * @param content the contents of the file */ -async function writeToGeneratedDir(outDir: string, filename: string, content: string): Promise { - const fullFilePath = path.join(outDir, 'src', 'generated', filename); +async function writeToCrateDir(outDir: string, filename: string, content: string): Promise { + const fullFilePath = path.join(outDir, 'src', filename); const fullDirPath = fullFilePath.substring(0, fullFilePath.lastIndexOf(path.sep)); await mkdir(fullDirPath, { recursive: true }); await writeFile(fullFilePath, content); @@ -162,3 +173,20 @@ function truncateStack(stack: string, finalFrame: string): string { } return stack; } + +/** + * returns true if the directory contains generated code that should be deleted. + * + * @param dirName the name of the directory to check + * @returns true if the directory should be deleted, false otherwise + */ +function shouldRmDir(dirName: string): boolean { + // if the directory contains a mod.rs file with the Rust Code Generator comment, + // then we can be reasonably sure that it is a generated directory and safe to delete. + const modRs = path.join(dirName, 'mod.rs'); + if (!fs.existsSync(modRs)) { + return false; + } + const content = fs.readFileSync(modRs, { encoding: 'utf-8' }); + return content.match(/Rust Code Generator/) !== null; +} diff --git a/packages/typespec-rust/src/tcgcadapter/adapter.ts b/packages/typespec-rust/src/tcgcadapter/adapter.ts index 9b3c303a1..12feb2533 100644 --- a/packages/typespec-rust/src/tcgcadapter/adapter.ts +++ b/packages/typespec-rust/src/tcgcadapter/adapter.ts @@ -14,7 +14,7 @@ import * as utils from '../utils/utils.js'; import * as tcgc from '@azure-tools/typespec-client-generator-core'; import * as rust from '../codemodel/index.js'; import {FinalStateValue} from "@azure-tools/typespec-azure-core"; -import {EmitContext, NoTarget} from "@typespec/compiler"; +import {NoTarget} from "@typespec/compiler"; /** ErrorCode defines the types of adapter errors */ export type ErrorCode = @@ -89,6 +89,7 @@ export class Adapter { private readonly crate: rust.Crate; private readonly ctx: tcgc.SdkContext; private readonly options: RustEmitterOptions; + private readonly rootNamespace: string = ''; // cache of adapted types private readonly types: Map; @@ -106,6 +107,26 @@ export class Adapter { this.ctx = ctx; this.options = options; + // this and adjacent code was taken from + // https://github.com/microsoft/typespec/blob/c0f464728f60fe3672204dd7f2907ea4c047dfcb/packages/http-client-python/emitter/src/utils.ts#L274 + if (this.ctx.sdkPackage.clients.length > 0) { + this.rootNamespace = this.ctx.sdkPackage.clients[0].namespace; + } else if (this.ctx.sdkPackage.models.length > 0) { + const result = this.ctx.sdkPackage.models + .map((model) => model.namespace) + .filter((namespace) => !LIB_NAMESPACE.includes(namespace)); + if (result.length > 0) { + result.sort(); + this.rootNamespace = result[0]; + } + } else if (this.ctx.sdkPackage.namespaces.length > 0) { + this.rootNamespace = this.ctx.sdkPackage.namespaces[0].fullName; + } + + if (this.rootNamespace === '') { + throw new Error('missing namespace'); + } + let serviceType: rust.ServiceType = 'data-plane'; if (this.ctx.arm === true) { serviceType = 'azure-arm'; @@ -115,20 +136,10 @@ export class Adapter { } /** performs all the steps to convert tcgc to a crate */ - tcgcToCrate(context: EmitContext): rust.Crate { - this.adaptTypes(context); + tcgcToCrate(): rust.Crate { + this.adaptTypes(); this.adaptClients(); - // marker models don't require serde so exclude them from the check - if (this.crate.enums.length > 0 || this.crate.models.some(e => e.kind === 'model')) { - this.crate.addDependency(new rust.CrateDependency('serde')); - } - - if (this.crate.clients.length > 0 || this.crate.enums.length > 0 || this.crate.models.length > 0 || this.crate.unions.length > 0) { - this.crate.addDependency(new rust.CrateDependency('azure_core')); - } - - this.crate.sortContent(); return this.crate; } @@ -146,12 +157,54 @@ export class Adapter { } } + /** + * adapts the specified namespace to a hierarchy of Rust modules + * + * @param namespace the namespace for which to return the package + * @returns the leaf module in the namespace + */ + private adaptNamespace(namespace: string): rust.ModuleContainer { + // some example namespaces + // foo + // foo.bar + // foo.bar.baz + // + + // if the namespace is empty (why that happens or what it means is a mystery) or + // it's one of the core lib namespaces then switch that to the root namespace. + if (namespace === '' || LIB_NAMESPACE.some((item) => namespace.toLowerCase().startsWith(item))) { + namespace = this.rootNamespace; + } + + // trim off the root namespace. if the result is the empty + // string it means the contents goes into the crate's root + if (namespace.toLowerCase().startsWith(this.rootNamespace.toLowerCase())) { + namespace = namespace.substring(this.rootNamespace.length + 1); + } + + const namespaces = namespace.split('.').filter(Boolean); + + let cur: rust.ModuleContainer = this.crate; + for (const namespace of namespaces) { + const modName = utils.snakeCaseName(namespace); + let subMod: rust.SubModule | undefined = cur.subModules.find((each: rust.SubModule) => each.name === modName); + if (!subMod) { + subMod = new rust.SubModule(modName, cur); + cur.subModules.push(subMod); + } + cur = subMod; + } + + return cur; + } + /** converts all tcgc types to their Rust type equivalent */ - private adaptTypes(context: EmitContext): void { + private adaptTypes(): void { + let needsCoreAndSerde = false; for (const sdkUnion of this.ctx.sdkPackage.unions.filter(u => u.kind === 'union')) { if (!sdkUnion.discriminatedOptions) { // When https://github.com/microsoft/typespec/issues/9749 is fixed, we can return to throwing an exception here. - context.program.reportDiagnostic({ + this.ctx.program.reportDiagnostic({ code: 'UnsupportedTsp', severity: 'warning', message: `Non-discriminated unions ('${sdkUnion.name}') are not supported. No type will be generated.`, @@ -160,7 +213,8 @@ export class Adapter { continue; } const rustUnion = this.getDiscriminatedUnion(sdkUnion); - this.crate.unions.push(rustUnion); + this.adaptNamespace(sdkUnion.namespace).unions.push(rustUnion); + needsCoreAndSerde = true; } for (const sdkEnum of this.ctx.sdkPackage.enums) { @@ -174,7 +228,8 @@ export class Adapter { this.getExternalType(sdkEnum.external); } else { const rustEnum = this.getEnum(sdkEnum); - this.crate.enums.push(rustEnum); + this.adaptNamespace(sdkEnum.namespace).enums.push(rustEnum); + needsCoreAndSerde = true; } } @@ -188,6 +243,8 @@ export class Adapter { continue; } + needsCoreAndSerde = true; + // TODO: workaround for https://github.com/Azure/typespec-azure/issues/3614 if (processedTypes.has(model.name)) { continue; @@ -198,7 +255,7 @@ export class Adapter { if (model.discriminatedSubtypes) { const rustUnion = this.getDiscriminatedUnion(model); - this.crate.unions.push(rustUnion); + this.adaptNamespace(model.namespace).unions.push(rustUnion); // we don't want to add the base type to the array // of models to emit as we hijack its name to be used @@ -210,9 +267,14 @@ export class Adapter { this.getExternalType(model.external); } else { const rustModel = this.getModel(model); - this.crate.models.push(rustModel); + this.adaptNamespace(model.namespace).models.push(rustModel); } } + + if (needsCoreAndSerde) { + this.crate.addDependency(new rust.CrateDependency('azure_core')); + this.crate.addDependency(new rust.CrateDependency('serde')); + } } /** @@ -252,7 +314,7 @@ export class Adapter { throw new AdapterError('UnsupportedTsp', `unsupported enum underlying type ${sdkEnum.valueType.kind}`, sdkEnum.__raw?.node); } - rustEnum = new rust.Enum(enumName, adaptAccessFlags(sdkEnum.access), !sdkEnum.isFixed, enumType); + rustEnum = new rust.Enum(enumName, adaptAccessFlags(sdkEnum.access), !sdkEnum.isFixed, enumType, this.adaptNamespace(sdkEnum.namespace)); rustEnum.docs = this.adaptDocs(sdkEnum.summary, sdkEnum.doc); this.types.set(enumName, rustEnum); @@ -378,7 +440,7 @@ export class Adapter { modelFlags |= rust.ModelFlags.Output; } - rustModel = new rust.Model(modelName, model.access === 'internal' ? 'pubCrate' : 'pub', modelFlags); + rustModel = new rust.Model(modelName, model.access === 'internal' ? 'pubCrate' : 'pub', modelFlags, this.adaptNamespace(model.namespace)); rustModel.docs = this.adaptDocs(model.summary, model.doc); rustModel.xmlName = getXMLName(model.decorators); this.types.set(modelName, rustModel); @@ -495,7 +557,7 @@ export class Adapter { throw new AdapterError('InternalError', `failed to find discriminator field for type ${src.name}`, src.__raw?.node); } - rustUnion = new rust.DiscriminatedUnion(unionName, adaptAccessFlags(src.access), discriminatorProperty.name); + rustUnion = new rust.DiscriminatedUnion(unionName, adaptAccessFlags(src.access), discriminatorProperty.name, this.adaptNamespace(src.namespace)); if (discriminatorProperty.type.kind === 'enum' && discriminatorProperty.type.isFixed) { // when the DU is a fixed enum, it means we don't fall back to the // base type when the discriminator value is unknown or missing. @@ -522,7 +584,7 @@ export class Adapter { throw new AdapterError('InternalError', 'getDiscriminatedUnion called for non-discriminated union', src.__raw?.node); } - rustUnion = new rust.DiscriminatedUnion(unionName, adaptAccessFlags(src.access), src.discriminatedOptions.discriminatorPropertyName); + rustUnion = new rust.DiscriminatedUnion(unionName, adaptAccessFlags(src.access), src.discriminatedOptions.discriminatorPropertyName, this.adaptNamespace(src.namespace)); if (src.discriminatedOptions.envelopePropertyName) { rustUnion.unionKind = new rust.DiscriminatedUnionEnvelope(src.discriminatedOptions.envelopePropertyName); } @@ -1071,8 +1133,14 @@ export class Adapter { /** converts all tcgc clients and their methods into Rust clients/methods */ private adaptClients(): void { + let needsCore = false; for (const client of this.ctx.sdkPackage.clients) { + // start with instantiable clients and recursively work down this.recursiveAdaptClient(client); + needsCore = true; + } + if (needsCore) { + this.crate.addDependency(new rust.CrateDependency('azure_core')); } } @@ -1126,7 +1194,7 @@ export class Adapter { clientName += 'Client'; } - const rustClient = new rust.Client(clientName); + const rustClient = new rust.Client(clientName, this.adaptNamespace(client.namespace)); rustClient.docs = this.adaptDocs(client.summary, client.doc); rustClient.parent = parent; rustClient.fields.push(new rust.StructField('pipeline', 'pubCrate', new rust.ExternalType(this.crate, 'Pipeline', 'azure_core::http'))); @@ -1345,7 +1413,7 @@ export class Adapter { // Set the tracing namespace for tracing based on the client's namespace rustClient.languageIndependentName = client.crossLanguageDefinitionId; - this.crate.clients.push(rustClient); + this.adaptNamespace(client.namespace).clients.push(rustClient); return rustClient; } @@ -1487,7 +1555,7 @@ export class Adapter { const optionsLifetime = new rust.Lifetime('a'); const methodOptionsStruct = new rust.Struct(`${rustClient.name}${utils.pascalCase(srcMethodName, false)}Options`, pub); methodOptionsStruct.lifetime = optionsLifetime; - methodOptionsStruct.docs.summary = `Options to be passed to ${this.asDocLink(`${rustClient.name}::${methodName}()`, `crate::generated::clients::${rustClient.name}::${methodName}()`)}`; + methodOptionsStruct.docs.summary = `Options to be passed to ${this.asDocLink(`${rustClient.name}::${methodName}()`, `${utils.buildImportPath(rustClient.module, rustClient.module)}::clients::${rustClient.name}::${methodName}()`)}`; let clientMethodOptions: rust.ClientMethodOptions | rust.PagerOptions | rust.PollerOptions; switch (method.kind) { @@ -1725,9 +1793,6 @@ export class Adapter { } const synthesizedModel = this.getModel(synthesizedType, new Array()); - if (!this.crate.models.includes(synthesizedModel)) { - this.crate.models.push(synthesizedModel); - } // for the pager response type, remove the Option around the Vec for the page items if (!method.pagingMetadata.pageItemsSegments) { @@ -1794,11 +1859,11 @@ export class Adapter { throw new AdapterError('InternalError', `status type for an LRO method '${method.name}' is not a model`, method.__raw?.node); } const pushModels = (model: rust.Model, crate: rust.Crate): void => { - if (crate.models.some(m => m === model)) { + if (rustClient.module.models.some(m => m === model)) { return; } - crate.models.push(model); + rustClient.module.models.push(model); for (const field of model.fields) { let fieldType = field.type; fieldType = fieldType.kind === 'option' ? fieldType.type : fieldType; @@ -1830,7 +1895,7 @@ export class Adapter { // we need to return a marker type const markerType = new rust.MarkerType(`${rustClient.name}${utils.pascalCase(method.name, false)}Result`, rustMethod.visibility); markerType.docs.summary = `Contains results for ${this.asDocLink(`${rustClient.name}::${methodName}()`, `crate::generated::clients::${rustClient.name}::${methodName}()`)}`; - this.crate.models.push(markerType); + rustClient.module.models.push(markerType); let resultType: rust.ResultTypes; if (method.response.type && method.response.type.kind === 'bytes' && method.response.type.encode === 'bytes') { // method returns a streaming binary response with headers @@ -1982,7 +2047,7 @@ export class Adapter { // NOTE: the complete doc text will be emitted at codegen time const docs = this.asDocLink(`${client.name}::${method.name}()`, `crate::generated::clients::${client.name}::${method.name}()`); - const responseHeadersTrait = new rust.ResponseHeadersTrait(traitName, implFor, docs, method.visibility); + const responseHeadersTrait = new rust.ResponseHeadersTrait(traitName, implFor, docs, method.visibility, client.module); responseHeadersTrait.headers.push(...responseHeaders); return responseHeadersTrait; @@ -2615,3 +2680,18 @@ const reservedParams = new Set( 'options', ] ); + +/** + * possible namespaces from core libraries. + * all types from these namespaces will be placed + * into the root namespace. + * if more core libs show up, add their namespaces here. + */ +const LIB_NAMESPACE = [ + "azure.core", + "azure.resourcemanager", + "azure.clientgenerator.core", + "typespec.rest", + "typespec.http", + "typespec.versioning", +]; diff --git a/packages/typespec-rust/src/utils/utils.ts b/packages/typespec-rust/src/utils/utils.ts index 6054e894f..e05351e2a 100644 --- a/packages/typespec-rust/src/utils/utils.ts +++ b/packages/typespec-rust/src/utils/utils.ts @@ -116,6 +116,31 @@ function unwrap(type: rust.Type): rust.Type | undefined { } } +/** + * builds the complete import path based on src and dst. + * + * @param dst the module where the import statement will be used + * @param src the module that contains the type being referenced + * @param [root='crate'] optional import root + * @returns the fully qualified import path + */ +export function buildImportPath(dst: rust.ModuleContainer, src: rust.ModuleContainer, root: string = 'crate'): string { + const chunks = new Array(); + let cur = src; + while (cur.kind === 'module') { + chunks.unshift(cur.name); + cur = cur.parent; + } + chunks.unshift(root); + const path = chunks.join('::'); + + if (dst === src && root === 'crate') { + return `${path}::generated`; + } else { + return path; + } +} + // the following was copied from @azure-tools/codegen as it's deprecated /** diff --git a/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/generated/clients/alternate_type_external_type_client.rs b/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/external_type/generated/clients/alternate_type_external_type_client.rs similarity index 99% rename from packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/generated/clients/alternate_type_external_type_client.rs rename to packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/external_type/generated/clients/alternate_type_external_type_client.rs index 37f30f8aa..8e9a0448d 100644 --- a/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/generated/clients/alternate_type_external_type_client.rs +++ b/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/external_type/generated/clients/alternate_type_external_type_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::external_type::generated::models::{ AlternateTypeExternalTypeClientGetModelOptions, AlternateTypeExternalTypeClientGetPropertyOptions, AlternateTypeExternalTypeClientPutModelOptions, diff --git a/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/external_type/generated/clients/mod.rs b/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/external_type/generated/clients/mod.rs new file mode 100644 index 000000000..93d3d61c4 --- /dev/null +++ b/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/external_type/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod alternate_type_external_type_client; +pub use alternate_type_external_type_client::*; diff --git a/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/external_type/generated/mod.rs b/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/external_type/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/external_type/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/generated/models/method_options.rs b/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/external_type/generated/models/method_options.rs similarity index 75% rename from packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/generated/models/method_options.rs rename to packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/external_type/generated/models/method_options.rs index f67487314..24fa4186f 100644 --- a/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/generated/models/method_options.rs +++ b/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/external_type/generated/models/method_options.rs @@ -5,28 +5,28 @@ use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; -/// Options to be passed to [`AlternateTypeExternalTypeClient::get_model()`](crate::generated::clients::AlternateTypeExternalTypeClient::get_model()) +/// Options to be passed to [`AlternateTypeExternalTypeClient::get_model()`](crate::external_type::generated::clients::AlternateTypeExternalTypeClient::get_model()) #[derive(Clone, Default, SafeDebug)] pub struct AlternateTypeExternalTypeClientGetModelOptions<'a> { /// Allows customization of the method call. pub method_options: ClientMethodOptions<'a>, } -/// Options to be passed to [`AlternateTypeExternalTypeClient::get_property()`](crate::generated::clients::AlternateTypeExternalTypeClient::get_property()) +/// Options to be passed to [`AlternateTypeExternalTypeClient::get_property()`](crate::external_type::generated::clients::AlternateTypeExternalTypeClient::get_property()) #[derive(Clone, Default, SafeDebug)] pub struct AlternateTypeExternalTypeClientGetPropertyOptions<'a> { /// Allows customization of the method call. pub method_options: ClientMethodOptions<'a>, } -/// Options to be passed to [`AlternateTypeExternalTypeClient::put_model()`](crate::generated::clients::AlternateTypeExternalTypeClient::put_model()) +/// Options to be passed to [`AlternateTypeExternalTypeClient::put_model()`](crate::external_type::generated::clients::AlternateTypeExternalTypeClient::put_model()) #[derive(Clone, Default, SafeDebug)] pub struct AlternateTypeExternalTypeClientPutModelOptions<'a> { /// Allows customization of the method call. pub method_options: ClientMethodOptions<'a>, } -/// Options to be passed to [`AlternateTypeExternalTypeClient::put_property()`](crate::generated::clients::AlternateTypeExternalTypeClient::put_property()) +/// Options to be passed to [`AlternateTypeExternalTypeClient::put_property()`](crate::external_type::generated::clients::AlternateTypeExternalTypeClient::put_property()) #[derive(Clone, Default, SafeDebug)] pub struct AlternateTypeExternalTypeClientPutPropertyOptions<'a> { /// Allows customization of the method call. diff --git a/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/generated/models/mod.rs b/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/external_type/generated/models/mod.rs similarity index 100% rename from packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/generated/models/mod.rs rename to packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/external_type/generated/models/mod.rs diff --git a/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/generated/models/models.rs b/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/external_type/generated/models/models.rs similarity index 100% rename from packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/generated/models/models.rs rename to packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/external_type/generated/models/models.rs diff --git a/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/generated/models/models_impl.rs b/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/external_type/generated/models/models_impl.rs similarity index 100% rename from packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/generated/models/models_impl.rs rename to packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/external_type/generated/models/models_impl.rs diff --git a/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/external_type/mod.rs b/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/external_type/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/external_type/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/generated/clients/alternate_type_client.rs b/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/generated/clients/alternate_type_client.rs index f9c29a29e..ce07f66b6 100644 --- a/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/generated/clients/alternate_type_client.rs +++ b/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/generated/clients/alternate_type_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::clients::AlternateTypeExternalTypeClient; +use crate::external_type::clients::AlternateTypeExternalTypeClient; use azure_core::{ fmt::SafeDebug, http::{ClientOptions, Pipeline, Url}, diff --git a/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/generated/clients/mod.rs b/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/generated/clients/mod.rs index 214766457..be5e20e7d 100644 --- a/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/generated/clients/mod.rs +++ b/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/generated/clients/mod.rs @@ -4,6 +4,4 @@ // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. mod alternate_type_client; -mod alternate_type_external_type_client; pub use alternate_type_client::*; -pub use alternate_type_external_type_client::*; diff --git a/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/generated/mod.rs b/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/generated/mod.rs index debd6e390..bbe6398ef 100644 --- a/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/generated/mod.rs +++ b/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/generated/mod.rs @@ -5,6 +5,4 @@ /// Clients used to communicate with the service. pub mod clients; -/// Contains all the data structures and types used by the client library. -pub mod models; pub use clients::{AlternateTypeClient, AlternateTypeClientOptions}; diff --git a/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/lib.rs b/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/lib.rs index cc784e401..90a79fe2b 100644 --- a/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/lib.rs +++ b/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/src/lib.rs @@ -7,3 +7,4 @@ mod generated; pub use generated::*; +pub mod external_type; diff --git a/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/tests/external_type_client.rs b/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/tests/external_type_client.rs index 127b5f36f..43b179231 100644 --- a/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/tests/external_type_client.rs +++ b/packages/typespec-rust/test/spector/azure/client-generator-core/alternate-type/tests/external_type_client.rs @@ -5,7 +5,7 @@ use azure_core::http::RequestContent; use geojson::{Feature, Geometry, Value}; use serde_json::Map; -use spector_alternatetype::{models::ModelWithFeatureProperty, AlternateTypeClient}; +use spector_alternatetype::{external_type::models::ModelWithFeatureProperty, AlternateTypeClient}; fn create_feature() -> Feature { let geometry = Geometry::new(Value::Point(vec![-122.25, 37.87])); diff --git a/packages/typespec-rust/test/spector/azure/client-generator-core/deserialize-empty-string-as-null/src/lib.rs b/packages/typespec-rust/test/spector/azure/client-generator-core/deserialize-empty-string-as-null/src/lib.rs index 1dc6b80fa..cc784e401 100644 --- a/packages/typespec-rust/test/spector/azure/client-generator-core/deserialize-empty-string-as-null/src/lib.rs +++ b/packages/typespec-rust/test/spector/azure/client-generator-core/deserialize-empty-string-as-null/src/lib.rs @@ -3,5 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. +#![cfg_attr(docsrs, feature(doc_cfg))] + mod generated; pub use generated::*; diff --git a/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/generated/clients/mod.rs b/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/generated/clients/mod.rs index 49de04924..bc237e2dd 100644 --- a/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/generated/clients/mod.rs +++ b/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/generated/clients/mod.rs @@ -4,6 +4,4 @@ // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. mod usage_client; -mod usage_model_in_operation_client; pub use usage_client::*; -pub use usage_model_in_operation_client::*; diff --git a/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/generated/clients/usage_client.rs b/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/generated/clients/usage_client.rs index f6faa4d60..746073ea5 100644 --- a/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/generated/clients/usage_client.rs +++ b/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/generated/clients/usage_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::clients::UsageModelInOperationClient; +use crate::model_in_operation::clients::UsageModelInOperationClient; use azure_core::{ fmt::SafeDebug, http::{ClientOptions, Pipeline, Url}, diff --git a/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/generated/models/mod.rs b/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/generated/models/mod.rs index 5dfb21b69..2a1c99bdc 100644 --- a/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/generated/models/mod.rs +++ b/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/generated/models/mod.rs @@ -3,9 +3,6 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -mod method_options; #[allow(clippy::module_inception)] mod models; -mod models_impl; -pub use method_options::*; pub use models::*; diff --git a/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/generated/models/models.rs b/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/generated/models/models.rs index ed26f0af1..7f280c0c3 100644 --- a/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/generated/models/models.rs +++ b/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/generated/models/models.rs @@ -6,13 +6,6 @@ use azure_core::fmt::SafeDebug; use serde::{Deserialize, Serialize}; -/// Usage additive to roundtrip. -#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] -pub struct InputModel { - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, -} - /// Not used anywhere, but access is override to public so still need to be generated and exported with serialization. #[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] pub struct OrphanModel { @@ -22,23 +15,3 @@ pub struct OrphanModel { #[serde(rename = "name", skip_serializing_if = "Option::is_none")] pub model_name: Option, } - -/// Usage additive to roundtrip. -#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] -pub struct OutputModel { - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] -#[non_exhaustive] -pub struct ResultModel { - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] -pub struct RoundTripModel { - #[serde(skip_serializing_if = "Option::is_none")] - pub result: Option, -} diff --git a/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/lib.rs b/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/lib.rs index cc784e401..bfa345859 100644 --- a/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/lib.rs +++ b/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/lib.rs @@ -7,3 +7,4 @@ mod generated; pub use generated::*; +pub mod model_in_operation; diff --git a/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/model_in_operation/generated/clients/mod.rs b/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/model_in_operation/generated/clients/mod.rs new file mode 100644 index 000000000..3a6cedfdf --- /dev/null +++ b/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/model_in_operation/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod usage_model_in_operation_client; +pub use usage_model_in_operation_client::*; diff --git a/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/generated/clients/usage_model_in_operation_client.rs b/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/model_in_operation/generated/clients/usage_model_in_operation_client.rs similarity index 99% rename from packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/generated/clients/usage_model_in_operation_client.rs rename to packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/model_in_operation/generated/clients/usage_model_in_operation_client.rs index bd8a341d1..2939c5dc0 100644 --- a/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/generated/clients/usage_model_in_operation_client.rs +++ b/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/model_in_operation/generated/clients/usage_model_in_operation_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::model_in_operation::generated::models::{ InputModel, OutputModel, RoundTripModel, UsageModelInOperationClientInputToInputOutputOptions, UsageModelInOperationClientModelInReadOnlyPropertyOptions, UsageModelInOperationClientOrphanModelSerializableOptions, diff --git a/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/model_in_operation/generated/mod.rs b/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/model_in_operation/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/model_in_operation/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/generated/models/method_options.rs b/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/model_in_operation/generated/models/method_options.rs similarity index 72% rename from packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/generated/models/method_options.rs rename to packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/model_in_operation/generated/models/method_options.rs index 745511a6d..b449ea9e2 100644 --- a/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/generated/models/method_options.rs +++ b/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/model_in_operation/generated/models/method_options.rs @@ -5,28 +5,28 @@ use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; -/// Options to be passed to [`UsageModelInOperationClient::input_to_input_output()`](crate::generated::clients::UsageModelInOperationClient::input_to_input_output()) +/// Options to be passed to [`UsageModelInOperationClient::input_to_input_output()`](crate::model_in_operation::generated::clients::UsageModelInOperationClient::input_to_input_output()) #[derive(Clone, Default, SafeDebug)] pub struct UsageModelInOperationClientInputToInputOutputOptions<'a> { /// Allows customization of the method call. pub method_options: ClientMethodOptions<'a>, } -/// Options to be passed to [`UsageModelInOperationClient::model_in_read_only_property()`](crate::generated::clients::UsageModelInOperationClient::model_in_read_only_property()) +/// Options to be passed to [`UsageModelInOperationClient::model_in_read_only_property()`](crate::model_in_operation::generated::clients::UsageModelInOperationClient::model_in_read_only_property()) #[derive(Clone, Default, SafeDebug)] pub struct UsageModelInOperationClientModelInReadOnlyPropertyOptions<'a> { /// Allows customization of the method call. pub method_options: ClientMethodOptions<'a>, } -/// Options to be passed to [`UsageModelInOperationClient::orphan_model_serializable()`](crate::generated::clients::UsageModelInOperationClient::orphan_model_serializable()) +/// Options to be passed to [`UsageModelInOperationClient::orphan_model_serializable()`](crate::model_in_operation::generated::clients::UsageModelInOperationClient::orphan_model_serializable()) #[derive(Clone, Default, SafeDebug)] pub struct UsageModelInOperationClientOrphanModelSerializableOptions<'a> { /// Allows customization of the method call. pub method_options: ClientMethodOptions<'a>, } -/// Options to be passed to [`UsageModelInOperationClient::output_to_input_output()`](crate::generated::clients::UsageModelInOperationClient::output_to_input_output()) +/// Options to be passed to [`UsageModelInOperationClient::output_to_input_output()`](crate::model_in_operation::generated::clients::UsageModelInOperationClient::output_to_input_output()) #[derive(Clone, Default, SafeDebug)] pub struct UsageModelInOperationClientOutputToInputOutputOptions<'a> { /// Allows customization of the method call. diff --git a/packages/typespec-rust/test/spector/encode/duration/src/generated/models/mod.rs b/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/model_in_operation/generated/models/mod.rs similarity index 100% rename from packages/typespec-rust/test/spector/encode/duration/src/generated/models/mod.rs rename to packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/model_in_operation/generated/models/mod.rs diff --git a/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/model_in_operation/generated/models/models.rs b/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/model_in_operation/generated/models/models.rs new file mode 100644 index 000000000..ba45aed9f --- /dev/null +++ b/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/model_in_operation/generated/models/models.rs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::fmt::SafeDebug; +use serde::{Deserialize, Serialize}; + +/// Usage additive to roundtrip. +#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] +pub struct InputModel { + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +/// Usage additive to roundtrip. +#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] +pub struct OutputModel { + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] +#[non_exhaustive] +pub struct ResultModel { + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, +} + +#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] +pub struct RoundTripModel { + #[serde(skip_serializing_if = "Option::is_none")] + pub result: Option, +} diff --git a/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/generated/models/models_impl.rs b/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/model_in_operation/generated/models/models_impl.rs similarity index 100% rename from packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/generated/models/models_impl.rs rename to packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/model_in_operation/generated/models/models_impl.rs diff --git a/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/model_in_operation/mod.rs b/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/model_in_operation/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/azure/client-generator-core/usage/src/model_in_operation/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/azure/client-generator-core/usage/tests/usage_model_in_operation_client.rs b/packages/typespec-rust/test/spector/azure/client-generator-core/usage/tests/usage_model_in_operation_client.rs index 0be6275be..0743bab3b 100644 --- a/packages/typespec-rust/test/spector/azure/client-generator-core/usage/tests/usage_model_in_operation_client.rs +++ b/packages/typespec-rust/test/spector/azure/client-generator-core/usage/tests/usage_model_in_operation_client.rs @@ -4,7 +4,7 @@ use azure_core::http::RequestContent; use spector_coreusage::{ - models::{InputModel, OutputModel, RoundTripModel}, + model_in_operation::models::{InputModel, OutputModel, RoundTripModel}, UsageClient, }; diff --git a/packages/typespec-rust/test/spector/azure/client/namespace/src/first/generated/mod.rs b/packages/typespec-rust/test/spector/azure/client/namespace/src/first/generated/mod.rs new file mode 100644 index 000000000..4f2be13f2 --- /dev/null +++ b/packages/typespec-rust/test/spector/azure/client/namespace/src/first/generated/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/azure/client/namespace/src/first/generated/models/mod.rs b/packages/typespec-rust/test/spector/azure/client/namespace/src/first/generated/models/mod.rs new file mode 100644 index 000000000..2a1c99bdc --- /dev/null +++ b/packages/typespec-rust/test/spector/azure/client/namespace/src/first/generated/models/mod.rs @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +#[allow(clippy::module_inception)] +mod models; +pub use models::*; diff --git a/packages/typespec-rust/test/spector/azure/client/namespace/src/first/generated/models/models.rs b/packages/typespec-rust/test/spector/azure/client/namespace/src/first/generated/models/models.rs new file mode 100644 index 000000000..275340b79 --- /dev/null +++ b/packages/typespec-rust/test/spector/azure/client/namespace/src/first/generated/models/models.rs @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::fmt::SafeDebug; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] +#[non_exhaustive] +pub struct FirstClientResult { + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, +} diff --git a/packages/typespec-rust/test/spector/azure/client/namespace/src/first/mod.rs b/packages/typespec-rust/test/spector/azure/client/namespace/src/first/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/azure/client/namespace/src/first/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/azure/client/namespace/src/generated/clients/client_namespace_first_client.rs b/packages/typespec-rust/test/spector/azure/client/namespace/src/generated/clients/client_namespace_first_client.rs index 88c1f0df9..f7d5bdf71 100644 --- a/packages/typespec-rust/test/spector/azure/client/namespace/src/generated/clients/client_namespace_first_client.rs +++ b/packages/typespec-rust/test/spector/azure/client/namespace/src/generated/clients/client_namespace_first_client.rs @@ -3,7 +3,9 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ClientNamespaceFirstClientGetFirstOptions, FirstClientResult}; +use crate::{ + first::models::FirstClientResult, generated::models::ClientNamespaceFirstClientGetFirstOptions, +}; use azure_core::{ error::CheckSuccessOptions, fmt::SafeDebug, diff --git a/packages/typespec-rust/test/spector/azure/client/namespace/src/generated/clients/mod.rs b/packages/typespec-rust/test/spector/azure/client/namespace/src/generated/clients/mod.rs index d655e1f58..ef654114a 100644 --- a/packages/typespec-rust/test/spector/azure/client/namespace/src/generated/clients/mod.rs +++ b/packages/typespec-rust/test/spector/azure/client/namespace/src/generated/clients/mod.rs @@ -4,6 +4,4 @@ // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. mod client_namespace_first_client; -mod client_namespace_second_client; pub use client_namespace_first_client::*; -pub use client_namespace_second_client::*; diff --git a/packages/typespec-rust/test/spector/azure/client/namespace/src/generated/mod.rs b/packages/typespec-rust/test/spector/azure/client/namespace/src/generated/mod.rs index 34896e807..d91ca5334 100644 --- a/packages/typespec-rust/test/spector/azure/client/namespace/src/generated/mod.rs +++ b/packages/typespec-rust/test/spector/azure/client/namespace/src/generated/mod.rs @@ -7,7 +7,4 @@ pub mod clients; /// Contains all the data structures and types used by the client library. pub mod models; -pub use clients::{ - ClientNamespaceFirstClient, ClientNamespaceFirstClientOptions, ClientNamespaceSecondClient, - ClientNamespaceSecondClientOptions, -}; +pub use clients::{ClientNamespaceFirstClient, ClientNamespaceFirstClientOptions}; diff --git a/packages/typespec-rust/test/spector/azure/client/namespace/src/generated/models/method_options.rs b/packages/typespec-rust/test/spector/azure/client/namespace/src/generated/models/method_options.rs index 2224c0243..3fdbb957a 100644 --- a/packages/typespec-rust/test/spector/azure/client/namespace/src/generated/models/method_options.rs +++ b/packages/typespec-rust/test/spector/azure/client/namespace/src/generated/models/method_options.rs @@ -11,10 +11,3 @@ pub struct ClientNamespaceFirstClientGetFirstOptions<'a> { /// Allows customization of the method call. pub method_options: ClientMethodOptions<'a>, } - -/// Options to be passed to [`ClientNamespaceSecondClient::get_second()`](crate::generated::clients::ClientNamespaceSecondClient::get_second()) -#[derive(Clone, Default, SafeDebug)] -pub struct ClientNamespaceSecondClientGetSecondOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} diff --git a/packages/typespec-rust/test/spector/azure/client/namespace/src/generated/models/mod.rs b/packages/typespec-rust/test/spector/azure/client/namespace/src/generated/models/mod.rs index 95075bbc0..3e484b1ed 100644 --- a/packages/typespec-rust/test/spector/azure/client/namespace/src/generated/models/mod.rs +++ b/packages/typespec-rust/test/spector/azure/client/namespace/src/generated/models/mod.rs @@ -3,12 +3,5 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -mod enums; -mod enums_impl; -mod enums_serde; mod method_options; -#[allow(clippy::module_inception)] -mod models; -pub use enums::*; pub use method_options::*; -pub use models::*; diff --git a/packages/typespec-rust/test/spector/azure/client/namespace/src/lib.rs b/packages/typespec-rust/test/spector/azure/client/namespace/src/lib.rs index cc784e401..c19e5d5b2 100644 --- a/packages/typespec-rust/test/spector/azure/client/namespace/src/lib.rs +++ b/packages/typespec-rust/test/spector/azure/client/namespace/src/lib.rs @@ -7,3 +7,5 @@ mod generated; pub use generated::*; +pub mod first; +pub mod second; diff --git a/packages/typespec-rust/test/spector/azure/client/namespace/src/generated/clients/client_namespace_second_client.rs b/packages/typespec-rust/test/spector/azure/client/namespace/src/second/generated/clients/client_namespace_second_client.rs similarity index 96% rename from packages/typespec-rust/test/spector/azure/client/namespace/src/generated/clients/client_namespace_second_client.rs rename to packages/typespec-rust/test/spector/azure/client/namespace/src/second/generated/clients/client_namespace_second_client.rs index 4665d4a8b..076eccb20 100644 --- a/packages/typespec-rust/test/spector/azure/client/namespace/src/generated/clients/client_namespace_second_client.rs +++ b/packages/typespec-rust/test/spector/azure/client/namespace/src/second/generated/clients/client_namespace_second_client.rs @@ -3,7 +3,9 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ClientNamespaceSecondClientGetSecondOptions, SecondClientResult}; +use crate::second::generated::models::{ + ClientNamespaceSecondClientGetSecondOptions, SecondClientResult, +}; use azure_core::{ error::CheckSuccessOptions, fmt::SafeDebug, diff --git a/packages/typespec-rust/test/spector/azure/client/namespace/src/second/generated/clients/mod.rs b/packages/typespec-rust/test/spector/azure/client/namespace/src/second/generated/clients/mod.rs new file mode 100644 index 000000000..6ca9db627 --- /dev/null +++ b/packages/typespec-rust/test/spector/azure/client/namespace/src/second/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod client_namespace_second_client; +pub use client_namespace_second_client::*; diff --git a/packages/typespec-rust/test/spector/azure/client/namespace/src/second/generated/mod.rs b/packages/typespec-rust/test/spector/azure/client/namespace/src/second/generated/mod.rs new file mode 100644 index 000000000..2a9082da9 --- /dev/null +++ b/packages/typespec-rust/test/spector/azure/client/namespace/src/second/generated/mod.rs @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; +pub use clients::{ClientNamespaceSecondClient, ClientNamespaceSecondClientOptions}; diff --git a/packages/typespec-rust/test/spector/azure/client/namespace/src/second/generated/models/method_options.rs b/packages/typespec-rust/test/spector/azure/client/namespace/src/second/generated/models/method_options.rs new file mode 100644 index 000000000..64add0a7d --- /dev/null +++ b/packages/typespec-rust/test/spector/azure/client/namespace/src/second/generated/models/method_options.rs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`ClientNamespaceSecondClient::get_second()`](crate::second::generated::clients::ClientNamespaceSecondClient::get_second()) +#[derive(Clone, Default, SafeDebug)] +pub struct ClientNamespaceSecondClientGetSecondOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/azure/client/namespace/src/second/generated/models/mod.rs b/packages/typespec-rust/test/spector/azure/client/namespace/src/second/generated/models/mod.rs new file mode 100644 index 000000000..4234131b2 --- /dev/null +++ b/packages/typespec-rust/test/spector/azure/client/namespace/src/second/generated/models/mod.rs @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +#[allow(clippy::module_inception)] +mod models; +pub use method_options::*; +pub use models::*; diff --git a/packages/typespec-rust/test/spector/azure/client/namespace/src/generated/models/models.rs b/packages/typespec-rust/test/spector/azure/client/namespace/src/second/generated/models/models.rs similarity index 67% rename from packages/typespec-rust/test/spector/azure/client/namespace/src/generated/models/models.rs rename to packages/typespec-rust/test/spector/azure/client/namespace/src/second/generated/models/models.rs index d9d62bc3e..63c61e374 100644 --- a/packages/typespec-rust/test/spector/azure/client/namespace/src/generated/models/models.rs +++ b/packages/typespec-rust/test/spector/azure/client/namespace/src/second/generated/models/models.rs @@ -3,17 +3,10 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use super::SecondClientEnumType; +use crate::second::sub::models::SecondClientEnumType; use azure_core::fmt::SafeDebug; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] -#[non_exhaustive] -pub struct FirstClientResult { - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, -} - #[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] #[non_exhaustive] pub struct SecondClientResult { diff --git a/packages/typespec-rust/test/spector/azure/client/namespace/src/second/mod.rs b/packages/typespec-rust/test/spector/azure/client/namespace/src/second/mod.rs new file mode 100644 index 000000000..67725b021 --- /dev/null +++ b/packages/typespec-rust/test/spector/azure/client/namespace/src/second/mod.rs @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; +pub mod sub; diff --git a/packages/typespec-rust/test/spector/azure/client/namespace/src/second/sub/generated/mod.rs b/packages/typespec-rust/test/spector/azure/client/namespace/src/second/sub/generated/mod.rs new file mode 100644 index 000000000..4f2be13f2 --- /dev/null +++ b/packages/typespec-rust/test/spector/azure/client/namespace/src/second/sub/generated/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/azure/client/namespace/src/generated/models/enums.rs b/packages/typespec-rust/test/spector/azure/client/namespace/src/second/sub/generated/models/enums.rs similarity index 100% rename from packages/typespec-rust/test/spector/azure/client/namespace/src/generated/models/enums.rs rename to packages/typespec-rust/test/spector/azure/client/namespace/src/second/sub/generated/models/enums.rs diff --git a/packages/typespec-rust/test/spector/azure/client/namespace/src/generated/models/enums_impl.rs b/packages/typespec-rust/test/spector/azure/client/namespace/src/second/sub/generated/models/enums_impl.rs similarity index 100% rename from packages/typespec-rust/test/spector/azure/client/namespace/src/generated/models/enums_impl.rs rename to packages/typespec-rust/test/spector/azure/client/namespace/src/second/sub/generated/models/enums_impl.rs diff --git a/packages/typespec-rust/test/spector/azure/client/namespace/src/generated/models/enums_serde.rs b/packages/typespec-rust/test/spector/azure/client/namespace/src/second/sub/generated/models/enums_serde.rs similarity index 100% rename from packages/typespec-rust/test/spector/azure/client/namespace/src/generated/models/enums_serde.rs rename to packages/typespec-rust/test/spector/azure/client/namespace/src/second/sub/generated/models/enums_serde.rs diff --git a/packages/typespec-rust/test/spector/azure/client/namespace/src/second/sub/generated/models/mod.rs b/packages/typespec-rust/test/spector/azure/client/namespace/src/second/sub/generated/models/mod.rs new file mode 100644 index 000000000..f2c583f3a --- /dev/null +++ b/packages/typespec-rust/test/spector/azure/client/namespace/src/second/sub/generated/models/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod enums; +mod enums_impl; +mod enums_serde; +pub use enums::*; diff --git a/packages/typespec-rust/test/spector/azure/client/namespace/src/second/sub/mod.rs b/packages/typespec-rust/test/spector/azure/client/namespace/src/second/sub/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/azure/client/namespace/src/second/sub/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/azure/client/namespace/tests/client_namespace_first_client.rs b/packages/typespec-rust/test/spector/azure/client/namespace/tests/client_namespace_first_client.rs index ab0fcc9fe..f50d87466 100644 --- a/packages/typespec-rust/test/spector/azure/client/namespace/tests/client_namespace_first_client.rs +++ b/packages/typespec-rust/test/spector/azure/client/namespace/tests/client_namespace_first_client.rs @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. -// -// Licensed under the MIT License. See License.txt in the project root for license information. +// Licensed under the MIT License. use spector_azure_client_namespace::ClientNamespaceFirstClient; diff --git a/packages/typespec-rust/test/spector/azure/client/namespace/tests/client_namespace_second_client.rs b/packages/typespec-rust/test/spector/azure/client/namespace/tests/client_namespace_second_client.rs index e4ee2e7d7..b36b0962c 100644 --- a/packages/typespec-rust/test/spector/azure/client/namespace/tests/client_namespace_second_client.rs +++ b/packages/typespec-rust/test/spector/azure/client/namespace/tests/client_namespace_second_client.rs @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. -// -// Licensed under the MIT License. See License.txt in the project root for license information. +// Licensed under the MIT License. -use spector_azure_client_namespace::ClientNamespaceSecondClient; +use spector_azure_client_namespace::second::sub::models::SecondClientEnumType; +use spector_azure_client_namespace::second::ClientNamespaceSecondClient; #[tokio::test] async fn client_namespace_second() { @@ -10,8 +10,5 @@ async fn client_namespace_second() { ClientNamespaceSecondClient::with_no_credential("http://localhost:3000", None).unwrap(); let resp = client.get_second(None).await.unwrap(); let result = resp.into_model().unwrap(); - assert_eq!( - result.type_prop, - Some(spector_azure_client_namespace::models::SecondClientEnumType::Second) - ); + assert_eq!(result.type_prop, Some(SecondClientEnumType::Second)); } diff --git a/packages/typespec-rust/test/spector/azure/core/lro/standard/src/lib.rs b/packages/typespec-rust/test/spector/azure/core/lro/standard/src/lib.rs index 5b9b3c63d..cc784e401 100644 --- a/packages/typespec-rust/test/spector/azure/core/lro/standard/src/lib.rs +++ b/packages/typespec-rust/test/spector/azure/core/lro/standard/src/lib.rs @@ -4,8 +4,6 @@ // Code generated by Microsoft (R) Rust Code Generator. #![cfg_attr(docsrs, feature(doc_cfg))] -#![allow(dead_code)] -#![allow(unused_imports)] mod generated; pub use generated::*; diff --git a/packages/typespec-rust/test/spector/azure/core/page/src/lib.rs b/packages/typespec-rust/test/spector/azure/core/page/src/lib.rs index cf33a8855..cc784e401 100644 --- a/packages/typespec-rust/test/spector/azure/core/page/src/lib.rs +++ b/packages/typespec-rust/test/spector/azure/core/page/src/lib.rs @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // -// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. +// Code generated by Microsoft (R) Rust Code Generator. #![cfg_attr(docsrs, feature(doc_cfg))] diff --git a/packages/typespec-rust/test/spector/azure/example/basic/src/_specs_/azure/example/basic/generated/mod.rs b/packages/typespec-rust/test/spector/azure/example/basic/src/_specs_/azure/example/basic/generated/mod.rs new file mode 100644 index 000000000..4f2be13f2 --- /dev/null +++ b/packages/typespec-rust/test/spector/azure/example/basic/src/_specs_/azure/example/basic/generated/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/azure/example/basic/src/generated/models/enums.rs b/packages/typespec-rust/test/spector/azure/example/basic/src/_specs_/azure/example/basic/generated/models/enums.rs similarity index 100% rename from packages/typespec-rust/test/spector/azure/example/basic/src/generated/models/enums.rs rename to packages/typespec-rust/test/spector/azure/example/basic/src/_specs_/azure/example/basic/generated/models/enums.rs diff --git a/packages/typespec-rust/test/spector/azure/example/basic/src/generated/models/enums_impl.rs b/packages/typespec-rust/test/spector/azure/example/basic/src/_specs_/azure/example/basic/generated/models/enums_impl.rs similarity index 100% rename from packages/typespec-rust/test/spector/azure/example/basic/src/generated/models/enums_impl.rs rename to packages/typespec-rust/test/spector/azure/example/basic/src/_specs_/azure/example/basic/generated/models/enums_impl.rs diff --git a/packages/typespec-rust/test/spector/azure/example/basic/src/generated/models/enums_serde.rs b/packages/typespec-rust/test/spector/azure/example/basic/src/_specs_/azure/example/basic/generated/models/enums_serde.rs similarity index 100% rename from packages/typespec-rust/test/spector/azure/example/basic/src/generated/models/enums_serde.rs rename to packages/typespec-rust/test/spector/azure/example/basic/src/_specs_/azure/example/basic/generated/models/enums_serde.rs diff --git a/packages/typespec-rust/test/spector/azure/example/basic/src/_specs_/azure/example/basic/generated/models/mod.rs b/packages/typespec-rust/test/spector/azure/example/basic/src/_specs_/azure/example/basic/generated/models/mod.rs new file mode 100644 index 000000000..2700f3f29 --- /dev/null +++ b/packages/typespec-rust/test/spector/azure/example/basic/src/_specs_/azure/example/basic/generated/models/mod.rs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod enums; +mod enums_impl; +mod enums_serde; +#[allow(clippy::module_inception)] +mod models; +mod models_impl; +pub use enums::*; +pub use models::*; diff --git a/packages/typespec-rust/test/spector/azure/example/basic/src/generated/models/models.rs b/packages/typespec-rust/test/spector/azure/example/basic/src/_specs_/azure/example/basic/generated/models/models.rs similarity index 100% rename from packages/typespec-rust/test/spector/azure/example/basic/src/generated/models/models.rs rename to packages/typespec-rust/test/spector/azure/example/basic/src/_specs_/azure/example/basic/generated/models/models.rs diff --git a/packages/typespec-rust/test/spector/azure/example/basic/src/generated/models/models_impl.rs b/packages/typespec-rust/test/spector/azure/example/basic/src/_specs_/azure/example/basic/generated/models/models_impl.rs similarity index 100% rename from packages/typespec-rust/test/spector/azure/example/basic/src/generated/models/models_impl.rs rename to packages/typespec-rust/test/spector/azure/example/basic/src/_specs_/azure/example/basic/generated/models/models_impl.rs diff --git a/packages/typespec-rust/test/spector/azure/example/basic/src/_specs_/azure/example/basic/mod.rs b/packages/typespec-rust/test/spector/azure/example/basic/src/_specs_/azure/example/basic/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/azure/example/basic/src/_specs_/azure/example/basic/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/azure/example/basic/src/_specs_/azure/example/mod.rs b/packages/typespec-rust/test/spector/azure/example/basic/src/_specs_/azure/example/mod.rs new file mode 100644 index 000000000..d1bc28a51 --- /dev/null +++ b/packages/typespec-rust/test/spector/azure/example/basic/src/_specs_/azure/example/mod.rs @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +pub mod basic; diff --git a/packages/typespec-rust/test/spector/azure/example/basic/src/_specs_/azure/mod.rs b/packages/typespec-rust/test/spector/azure/example/basic/src/_specs_/azure/mod.rs new file mode 100644 index 000000000..20772262a --- /dev/null +++ b/packages/typespec-rust/test/spector/azure/example/basic/src/_specs_/azure/mod.rs @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +pub mod example; diff --git a/packages/typespec-rust/test/spector/azure/example/basic/src/_specs_/mod.rs b/packages/typespec-rust/test/spector/azure/example/basic/src/_specs_/mod.rs new file mode 100644 index 000000000..e5ba41ff0 --- /dev/null +++ b/packages/typespec-rust/test/spector/azure/example/basic/src/_specs_/mod.rs @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +pub mod azure; diff --git a/packages/typespec-rust/test/spector/azure/example/basic/src/generated/clients/azure_example_client.rs b/packages/typespec-rust/test/spector/azure/example/basic/src/generated/clients/azure_example_client.rs index 329ff008e..19c2fd2dc 100644 --- a/packages/typespec-rust/test/spector/azure/example/basic/src/generated/clients/azure_example_client.rs +++ b/packages/typespec-rust/test/spector/azure/example/basic/src/generated/clients/azure_example_client.rs @@ -3,8 +3,9 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ - ActionRequest, ActionResponse, AzureExampleClientBasicActionOptions, +use crate::{ + _specs_::azure::example::basic::models::{ActionRequest, ActionResponse}, + generated::models::AzureExampleClientBasicActionOptions, }; use azure_core::{ error::CheckSuccessOptions, diff --git a/packages/typespec-rust/test/spector/azure/example/basic/src/generated/models/mod.rs b/packages/typespec-rust/test/spector/azure/example/basic/src/generated/models/mod.rs index b59467d7e..3e484b1ed 100644 --- a/packages/typespec-rust/test/spector/azure/example/basic/src/generated/models/mod.rs +++ b/packages/typespec-rust/test/spector/azure/example/basic/src/generated/models/mod.rs @@ -3,13 +3,5 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -mod enums; -mod enums_impl; -mod enums_serde; mod method_options; -#[allow(clippy::module_inception)] -mod models; -mod models_impl; -pub use enums::*; pub use method_options::*; -pub use models::*; diff --git a/packages/typespec-rust/test/spector/azure/example/basic/src/lib.rs b/packages/typespec-rust/test/spector/azure/example/basic/src/lib.rs index cc784e401..6df131f58 100644 --- a/packages/typespec-rust/test/spector/azure/example/basic/src/lib.rs +++ b/packages/typespec-rust/test/spector/azure/example/basic/src/lib.rs @@ -7,3 +7,4 @@ mod generated; pub use generated::*; +pub mod _specs_; diff --git a/packages/typespec-rust/test/spector/azure/example/basic/tests/azure_example_client.rs b/packages/typespec-rust/test/spector/azure/example/basic/tests/azure_example_client.rs index 37c087ecd..79cd64fcf 100644 --- a/packages/typespec-rust/test/spector/azure/example/basic/tests/azure_example_client.rs +++ b/packages/typespec-rust/test/spector/azure/example/basic/tests/azure_example_client.rs @@ -5,8 +5,8 @@ use std::collections::HashMap; use spector_azurebasic::{ - models::{ActionRequest, ActionResponse, Model}, AzureExampleClient, + _specs_::azure::example::basic::models::{ActionRequest, ActionResponse, Model}, }; #[tokio::test] @@ -15,7 +15,9 @@ async fn basic_action() { let body = ActionRequest { array_property: Some(vec!["item".to_string()]), model_property: Some(Model { - enum_property: Some(spector_azurebasic::models::Enum::EnumValue1), + enum_property: Some( + spector_azurebasic::_specs_::azure::example::basic::models::Enum::EnumValue1, + ), float32_property: Some(1.5), int32_property: Some(1), }), diff --git a/packages/typespec-rust/test/spector/azure/resource-manager/operation-templates/src/lib.rs b/packages/typespec-rust/test/spector/azure/resource-manager/operation-templates/src/lib.rs index 392ab368c..cc784e401 100644 --- a/packages/typespec-rust/test/spector/azure/resource-manager/operation-templates/src/lib.rs +++ b/packages/typespec-rust/test/spector/azure/resource-manager/operation-templates/src/lib.rs @@ -5,7 +5,5 @@ #![cfg_attr(docsrs, feature(doc_cfg))] -// TODO: LRO client has dead code, https://github.com/Azure/typespec-rust/issues/188 -#[allow(dead_code)] mod generated; pub use generated::*; diff --git a/packages/typespec-rust/test/spector/client/enum-conflict/src/first_namespace/generated/mod.rs b/packages/typespec-rust/test/spector/client/enum-conflict/src/first_namespace/generated/mod.rs new file mode 100644 index 000000000..4f2be13f2 --- /dev/null +++ b/packages/typespec-rust/test/spector/client/enum-conflict/src/first_namespace/generated/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/client/enum-conflict/src/first_namespace/generated/models/enums.rs b/packages/typespec-rust/test/spector/client/enum-conflict/src/first_namespace/generated/models/enums.rs new file mode 100644 index 000000000..677b0585d --- /dev/null +++ b/packages/typespec-rust/test/spector/client/enum-conflict/src/first_namespace/generated/models/enums.rs @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Status enum in first namespace +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub enum Status { + /// Active status + Active, + + /// Inactive status + Inactive, +} diff --git a/packages/typespec-rust/test/spector/client/enum-conflict/src/first_namespace/generated/models/enums_impl.rs b/packages/typespec-rust/test/spector/client/enum-conflict/src/first_namespace/generated/models/enums_impl.rs new file mode 100644 index 000000000..dfc5a9a52 --- /dev/null +++ b/packages/typespec-rust/test/spector/client/enum-conflict/src/first_namespace/generated/models/enums_impl.rs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use super::Status; +use azure_core::error::{Error, ErrorKind}; +use std::{ + convert::AsRef, + fmt::{Display, Formatter}, + str::FromStr, +}; + +impl FromStr for Status { + type Err = Error; + fn from_str(s: &str) -> ::core::result::Result::Err> { + Ok(match s { + "active" => Status::Active, + "inactive" => Status::Inactive, + _ => { + return Err(Error::with_message_fn(ErrorKind::DataConversion, || { + format!("unknown variant of Status found: \"{s}\"") + })) + } + }) + } +} + +impl AsRef for Status { + fn as_ref(&self) -> &str { + match self { + Status::Active => "active", + Status::Inactive => "inactive", + } + } +} + +impl Display for Status { + fn fmt(&self, f: &mut Formatter<'_>) -> ::std::fmt::Result { + match self { + Status::Active => Display::fmt("active", f), + Status::Inactive => Display::fmt("inactive", f), + } + } +} diff --git a/packages/typespec-rust/test/spector/client/enum-conflict/src/first_namespace/generated/models/enums_serde.rs b/packages/typespec-rust/test/spector/client/enum-conflict/src/first_namespace/generated/models/enums_serde.rs new file mode 100644 index 000000000..c0f420378 --- /dev/null +++ b/packages/typespec-rust/test/spector/client/enum-conflict/src/first_namespace/generated/models/enums_serde.rs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use super::Status; +use serde::{Deserialize, Deserializer, Serialize, Serializer}; + +impl<'de> Deserialize<'de> for Status { + fn deserialize(deserializer: D) -> ::core::result::Result + where + D: Deserializer<'de>, + { + let s = String::deserialize(deserializer)?; + s.parse().map_err(serde::de::Error::custom) + } +} + +impl Serialize for Status { + fn serialize(&self, s: S) -> ::core::result::Result + where + S: Serializer, + { + s.serialize_str(self.as_ref()) + } +} diff --git a/packages/typespec-rust/test/spector/client/enum-conflict/src/first_namespace/generated/models/mod.rs b/packages/typespec-rust/test/spector/client/enum-conflict/src/first_namespace/generated/models/mod.rs new file mode 100644 index 000000000..2700f3f29 --- /dev/null +++ b/packages/typespec-rust/test/spector/client/enum-conflict/src/first_namespace/generated/models/mod.rs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod enums; +mod enums_impl; +mod enums_serde; +#[allow(clippy::module_inception)] +mod models; +mod models_impl; +pub use enums::*; +pub use models::*; diff --git a/packages/typespec-rust/test/spector/client/enum-conflict/src/first_namespace/generated/models/models.rs b/packages/typespec-rust/test/spector/client/enum-conflict/src/first_namespace/generated/models/models.rs new file mode 100644 index 000000000..4c7205837 --- /dev/null +++ b/packages/typespec-rust/test/spector/client/enum-conflict/src/first_namespace/generated/models/models.rs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use super::Status; +use azure_core::fmt::SafeDebug; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] +pub struct FirstModel { + /// Name of the item + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + + /// Status from first namespace + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} diff --git a/packages/typespec-rust/test/spector/client/enum-conflict/src/first_namespace/generated/models/models_impl.rs b/packages/typespec-rust/test/spector/client/enum-conflict/src/first_namespace/generated/models/models_impl.rs new file mode 100644 index 000000000..86b5bc6b0 --- /dev/null +++ b/packages/typespec-rust/test/spector/client/enum-conflict/src/first_namespace/generated/models/models_impl.rs @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use super::FirstModel; +use azure_core::{http::RequestContent, json::to_json, Result}; + +impl TryFrom for RequestContent { + type Error = azure_core::Error; + fn try_from(value: FirstModel) -> Result { + Ok(to_json(&value)?.into()) + } +} diff --git a/packages/typespec-rust/test/spector/client/enum-conflict/src/first_namespace/mod.rs b/packages/typespec-rust/test/spector/client/enum-conflict/src/first_namespace/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/client/enum-conflict/src/first_namespace/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/client/enum-conflict/src/generated/clients/enum_conflict_first_operations_client.rs b/packages/typespec-rust/test/spector/client/enum-conflict/src/generated/clients/enum_conflict_first_operations_client.rs index a0eb2aa4e..7fddd5bcb 100644 --- a/packages/typespec-rust/test/spector/client/enum-conflict/src/generated/clients/enum_conflict_first_operations_client.rs +++ b/packages/typespec-rust/test/spector/client/enum-conflict/src/generated/clients/enum_conflict_first_operations_client.rs @@ -3,7 +3,10 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{EnumConflictFirstOperationsClientFirstOptions, FirstModel}; +use crate::{ + first_namespace::models::FirstModel, + generated::models::EnumConflictFirstOperationsClientFirstOptions, +}; use azure_core::{ error::CheckSuccessOptions, http::{Method, Pipeline, PipelineSendOptions, Request, RequestContent, Response, Url, UrlExt}, diff --git a/packages/typespec-rust/test/spector/client/enum-conflict/src/generated/clients/enum_conflict_second_operations_client.rs b/packages/typespec-rust/test/spector/client/enum-conflict/src/generated/clients/enum_conflict_second_operations_client.rs index 6755e426f..d5606e988 100644 --- a/packages/typespec-rust/test/spector/client/enum-conflict/src/generated/clients/enum_conflict_second_operations_client.rs +++ b/packages/typespec-rust/test/spector/client/enum-conflict/src/generated/clients/enum_conflict_second_operations_client.rs @@ -3,7 +3,10 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{EnumConflictSecondOperationsClientSecondOptions, SecondModel}; +use crate::{ + generated::models::EnumConflictSecondOperationsClientSecondOptions, + second_namespace::models::SecondModel, +}; use azure_core::{ error::CheckSuccessOptions, http::{Method, Pipeline, PipelineSendOptions, Request, RequestContent, Response, Url, UrlExt}, diff --git a/packages/typespec-rust/test/spector/client/enum-conflict/src/generated/models/mod.rs b/packages/typespec-rust/test/spector/client/enum-conflict/src/generated/models/mod.rs index b59467d7e..3e484b1ed 100644 --- a/packages/typespec-rust/test/spector/client/enum-conflict/src/generated/models/mod.rs +++ b/packages/typespec-rust/test/spector/client/enum-conflict/src/generated/models/mod.rs @@ -3,13 +3,5 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -mod enums; -mod enums_impl; -mod enums_serde; mod method_options; -#[allow(clippy::module_inception)] -mod models; -mod models_impl; -pub use enums::*; pub use method_options::*; -pub use models::*; diff --git a/packages/typespec-rust/test/spector/client/enum-conflict/src/lib.rs b/packages/typespec-rust/test/spector/client/enum-conflict/src/lib.rs index cc784e401..1c9aabb0f 100644 --- a/packages/typespec-rust/test/spector/client/enum-conflict/src/lib.rs +++ b/packages/typespec-rust/test/spector/client/enum-conflict/src/lib.rs @@ -7,3 +7,5 @@ mod generated; pub use generated::*; +pub mod first_namespace; +pub mod second_namespace; diff --git a/packages/typespec-rust/test/spector/client/enum-conflict/src/second_namespace/generated/mod.rs b/packages/typespec-rust/test/spector/client/enum-conflict/src/second_namespace/generated/mod.rs new file mode 100644 index 000000000..4f2be13f2 --- /dev/null +++ b/packages/typespec-rust/test/spector/client/enum-conflict/src/second_namespace/generated/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/client/enum-conflict/src/generated/models/enums.rs b/packages/typespec-rust/test/spector/client/enum-conflict/src/second_namespace/generated/models/enums.rs similarity index 66% rename from packages/typespec-rust/test/spector/client/enum-conflict/src/generated/models/enums.rs rename to packages/typespec-rust/test/spector/client/enum-conflict/src/second_namespace/generated/models/enums.rs index 6c0d2c831..81016d57e 100644 --- a/packages/typespec-rust/test/spector/client/enum-conflict/src/generated/models/enums.rs +++ b/packages/typespec-rust/test/spector/client/enum-conflict/src/second_namespace/generated/models/enums.rs @@ -12,13 +12,3 @@ pub enum SecondStatus { /// Stopped status Stopped, } - -/// Status enum in first namespace -#[derive(Clone, Copy, Debug, Eq, PartialEq)] -pub enum Status { - /// Active status - Active, - - /// Inactive status - Inactive, -} diff --git a/packages/typespec-rust/test/spector/client/enum-conflict/src/generated/models/enums_impl.rs b/packages/typespec-rust/test/spector/client/enum-conflict/src/second_namespace/generated/models/enums_impl.rs similarity index 57% rename from packages/typespec-rust/test/spector/client/enum-conflict/src/generated/models/enums_impl.rs rename to packages/typespec-rust/test/spector/client/enum-conflict/src/second_namespace/generated/models/enums_impl.rs index 07277bda9..6df2d9927 100644 --- a/packages/typespec-rust/test/spector/client/enum-conflict/src/generated/models/enums_impl.rs +++ b/packages/typespec-rust/test/spector/client/enum-conflict/src/second_namespace/generated/models/enums_impl.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use super::{SecondStatus, Status}; +use super::SecondStatus; use azure_core::error::{Error, ErrorKind}; use std::{ convert::AsRef, @@ -43,36 +43,3 @@ impl Display for SecondStatus { } } } - -impl FromStr for Status { - type Err = Error; - fn from_str(s: &str) -> ::core::result::Result::Err> { - Ok(match s { - "active" => Status::Active, - "inactive" => Status::Inactive, - _ => { - return Err(Error::with_message_fn(ErrorKind::DataConversion, || { - format!("unknown variant of Status found: \"{s}\"") - })) - } - }) - } -} - -impl AsRef for Status { - fn as_ref(&self) -> &str { - match self { - Status::Active => "active", - Status::Inactive => "inactive", - } - } -} - -impl Display for Status { - fn fmt(&self, f: &mut Formatter<'_>) -> ::std::fmt::Result { - match self { - Status::Active => Display::fmt("active", f), - Status::Inactive => Display::fmt("inactive", f), - } - } -} diff --git a/packages/typespec-rust/test/spector/client/enum-conflict/src/generated/models/enums_serde.rs b/packages/typespec-rust/test/spector/client/enum-conflict/src/second_namespace/generated/models/enums_serde.rs similarity index 58% rename from packages/typespec-rust/test/spector/client/enum-conflict/src/generated/models/enums_serde.rs rename to packages/typespec-rust/test/spector/client/enum-conflict/src/second_namespace/generated/models/enums_serde.rs index 657668dea..77745c5fa 100644 --- a/packages/typespec-rust/test/spector/client/enum-conflict/src/generated/models/enums_serde.rs +++ b/packages/typespec-rust/test/spector/client/enum-conflict/src/second_namespace/generated/models/enums_serde.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use super::{SecondStatus, Status}; +use super::SecondStatus; use serde::{Deserialize, Deserializer, Serialize, Serializer}; impl<'de> Deserialize<'de> for SecondStatus { @@ -24,22 +24,3 @@ impl Serialize for SecondStatus { s.serialize_str(self.as_ref()) } } - -impl<'de> Deserialize<'de> for Status { - fn deserialize(deserializer: D) -> ::core::result::Result - where - D: Deserializer<'de>, - { - let s = String::deserialize(deserializer)?; - s.parse().map_err(serde::de::Error::custom) - } -} - -impl Serialize for Status { - fn serialize(&self, s: S) -> ::core::result::Result - where - S: Serializer, - { - s.serialize_str(self.as_ref()) - } -} diff --git a/packages/typespec-rust/test/spector/client/enum-conflict/src/second_namespace/generated/models/mod.rs b/packages/typespec-rust/test/spector/client/enum-conflict/src/second_namespace/generated/models/mod.rs new file mode 100644 index 000000000..2700f3f29 --- /dev/null +++ b/packages/typespec-rust/test/spector/client/enum-conflict/src/second_namespace/generated/models/mod.rs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod enums; +mod enums_impl; +mod enums_serde; +#[allow(clippy::module_inception)] +mod models; +mod models_impl; +pub use enums::*; +pub use models::*; diff --git a/packages/typespec-rust/test/spector/client/enum-conflict/src/generated/models/models.rs b/packages/typespec-rust/test/spector/client/enum-conflict/src/second_namespace/generated/models/models.rs similarity index 62% rename from packages/typespec-rust/test/spector/client/enum-conflict/src/generated/models/models.rs rename to packages/typespec-rust/test/spector/client/enum-conflict/src/second_namespace/generated/models/models.rs index fa33a6e89..69f39dce8 100644 --- a/packages/typespec-rust/test/spector/client/enum-conflict/src/generated/models/models.rs +++ b/packages/typespec-rust/test/spector/client/enum-conflict/src/second_namespace/generated/models/models.rs @@ -3,21 +3,10 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use super::{SecondStatus, Status}; +use super::SecondStatus; use azure_core::fmt::SafeDebug; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] -pub struct FirstModel { - /// Name of the item - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - /// Status from first namespace - #[serde(skip_serializing_if = "Option::is_none")] - pub status: Option, -} - #[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] pub struct SecondModel { /// Description of the item diff --git a/packages/typespec-rust/test/spector/client/enum-conflict/src/generated/models/models_impl.rs b/packages/typespec-rust/test/spector/client/enum-conflict/src/second_namespace/generated/models/models_impl.rs similarity index 64% rename from packages/typespec-rust/test/spector/client/enum-conflict/src/generated/models/models_impl.rs rename to packages/typespec-rust/test/spector/client/enum-conflict/src/second_namespace/generated/models/models_impl.rs index 777fd0635..ad47dd7bb 100644 --- a/packages/typespec-rust/test/spector/client/enum-conflict/src/generated/models/models_impl.rs +++ b/packages/typespec-rust/test/spector/client/enum-conflict/src/second_namespace/generated/models/models_impl.rs @@ -3,16 +3,9 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use super::{FirstModel, SecondModel}; +use super::SecondModel; use azure_core::{http::RequestContent, json::to_json, Result}; -impl TryFrom for RequestContent { - type Error = azure_core::Error; - fn try_from(value: FirstModel) -> Result { - Ok(to_json(&value)?.into()) - } -} - impl TryFrom for RequestContent { type Error = azure_core::Error; fn try_from(value: SecondModel) -> Result { diff --git a/packages/typespec-rust/test/spector/client/enum-conflict/src/second_namespace/mod.rs b/packages/typespec-rust/test/spector/client/enum-conflict/src/second_namespace/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/client/enum-conflict/src/second_namespace/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/client/enum-conflict/tests/enum_conflict_first_operations_client.rs b/packages/typespec-rust/test/spector/client/enum-conflict/tests/enum_conflict_first_operations_client.rs index 7919f237a..4fc801b96 100644 --- a/packages/typespec-rust/test/spector/client/enum-conflict/tests/enum_conflict_first_operations_client.rs +++ b/packages/typespec-rust/test/spector/client/enum-conflict/tests/enum_conflict_first_operations_client.rs @@ -3,7 +3,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. use spector_enumconflict::{ - models::{FirstModel, Status}, + first_namespace::models::{FirstModel, Status}, EnumConflictClient, }; diff --git a/packages/typespec-rust/test/spector/client/enum-conflict/tests/enum_conflict_second_operations_client.rs b/packages/typespec-rust/test/spector/client/enum-conflict/tests/enum_conflict_second_operations_client.rs index 78a162d90..a46f9c7ce 100644 --- a/packages/typespec-rust/test/spector/client/enum-conflict/tests/enum_conflict_second_operations_client.rs +++ b/packages/typespec-rust/test/spector/client/enum-conflict/tests/enum_conflict_second_operations_client.rs @@ -3,7 +3,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. use spector_enumconflict::{ - models::{SecondModel, SecondStatus}, + second_namespace::models::{SecondModel, SecondStatus}, EnumConflictClient, }; diff --git a/packages/typespec-rust/test/spector/client/naming/src/generated/clients/mod.rs b/packages/typespec-rust/test/spector/client/naming/src/generated/clients/mod.rs index e438a76b5..ad5aaf1fe 100644 --- a/packages/typespec-rust/test/spector/client/naming/src/generated/clients/mod.rs +++ b/packages/typespec-rust/test/spector/client/naming/src/generated/clients/mod.rs @@ -3,9 +3,5 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -mod model_client; mod naming_client; -mod naming_union_enum_client; -pub use model_client::*; pub use naming_client::*; -pub use naming_union_enum_client::*; diff --git a/packages/typespec-rust/test/spector/client/naming/src/generated/clients/naming_client.rs b/packages/typespec-rust/test/spector/client/naming/src/generated/clients/naming_client.rs index fbd80734d..175c8e55a 100644 --- a/packages/typespec-rust/test/spector/client/naming/src/generated/clients/naming_client.rs +++ b/packages/typespec-rust/test/spector/client/naming/src/generated/clients/naming_client.rs @@ -3,15 +3,18 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::{ - clients::{ModelClient, NamingUnionEnumClient}, - models::{ - ClientNameAndJsonEncodedNameModel, ClientNameModel, LanguageClientNameModel, +use crate::{ + generated::models::{ NamingClientClientNameOptions, NamingClientClientOptions, NamingClientCompatibleWithEncodedNameOptions, NamingClientLanguageOptions, NamingClientParameterOptions, NamingClientRequestOptions, NamingClientResponseOptions, NamingClientResponseResult, }, + model::clients::ModelClient, + property::models::{ + ClientNameAndJsonEncodedNameModel, ClientNameModel, LanguageClientNameModel, + }, + union_enum::clients::NamingUnionEnumClient, }; use azure_core::{ error::CheckSuccessOptions, diff --git a/packages/typespec-rust/test/spector/client/naming/src/generated/models/method_options.rs b/packages/typespec-rust/test/spector/client/naming/src/generated/models/method_options.rs index 93da5b3c8..2481438a3 100644 --- a/packages/typespec-rust/test/spector/client/naming/src/generated/models/method_options.rs +++ b/packages/typespec-rust/test/spector/client/naming/src/generated/models/method_options.rs @@ -5,20 +5,6 @@ use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; -/// Options to be passed to [`ModelClient::client()`](crate::generated::clients::ModelClient::client()) -#[derive(Clone, Default, SafeDebug)] -pub struct ModelClientClientOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`ModelClient::language()`](crate::generated::clients::ModelClient::language()) -#[derive(Clone, Default, SafeDebug)] -pub struct ModelClientLanguageOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - /// Options to be passed to [`NamingClient::client()`](crate::generated::clients::NamingClient::client()) #[derive(Clone, Default, SafeDebug)] pub struct NamingClientClientOptions<'a> { @@ -67,17 +53,3 @@ pub struct NamingClientResponseOptions<'a> { /// Allows customization of the method call. pub method_options: ClientMethodOptions<'a>, } - -/// Options to be passed to [`NamingUnionEnumClient::union_enum_member_name()`](crate::generated::clients::NamingUnionEnumClient::union_enum_member_name()) -#[derive(Clone, Default, SafeDebug)] -pub struct NamingUnionEnumClientUnionEnumMemberNameOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`NamingUnionEnumClient::union_enum_name()`](crate::generated::clients::NamingUnionEnumClient::union_enum_name()) -#[derive(Clone, Default, SafeDebug)] -pub struct NamingUnionEnumClientUnionEnumNameOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} diff --git a/packages/typespec-rust/test/spector/client/naming/src/generated/models/mod.rs b/packages/typespec-rust/test/spector/client/naming/src/generated/models/mod.rs index 1bdb97c54..3262c5304 100644 --- a/packages/typespec-rust/test/spector/client/naming/src/generated/models/mod.rs +++ b/packages/typespec-rust/test/spector/client/naming/src/generated/models/mod.rs @@ -3,15 +3,10 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -mod enums; -mod enums_impl; -mod enums_serde; mod header_traits; mod method_options; #[allow(clippy::module_inception)] mod models; -mod models_impl; -pub use enums::*; pub use header_traits::*; pub use method_options::*; pub use models::*; diff --git a/packages/typespec-rust/test/spector/client/naming/src/generated/models/models.rs b/packages/typespec-rust/test/spector/client/naming/src/generated/models/models.rs index 03f6e8342..aa636ad79 100644 --- a/packages/typespec-rust/test/spector/client/naming/src/generated/models/models.rs +++ b/packages/typespec-rust/test/spector/client/naming/src/generated/models/models.rs @@ -4,43 +4,7 @@ // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. use azure_core::fmt::SafeDebug; -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] -pub struct ClientModel { - /// Pass in true - #[serde(rename = "defaultName", skip_serializing_if = "Option::is_none")] - pub default_name: Option, -} - -#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] -pub struct ClientNameAndJsonEncodedNameModel { - /// Pass in true - #[serde(rename = "wireName", skip_serializing_if = "Option::is_none")] - pub client_name: Option, -} - -#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] -pub struct ClientNameModel { - /// Pass in true - #[serde(rename = "defaultName", skip_serializing_if = "Option::is_none")] - pub client_name: Option, -} - -#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] -pub struct LanguageClientNameModel { - /// Pass in true - #[serde(rename = "defaultName", skip_serializing_if = "Option::is_none")] - pub rust_name: Option, -} /// Contains results for [`NamingClient::response()`](crate::generated::clients::NamingClient::response()) #[derive(SafeDebug)] pub struct NamingClientResponseResult; - -#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] -pub struct RustName { - /// Pass in true - #[serde(rename = "defaultName", skip_serializing_if = "Option::is_none")] - pub default_name: Option, -} diff --git a/packages/typespec-rust/test/spector/client/naming/src/lib.rs b/packages/typespec-rust/test/spector/client/naming/src/lib.rs index cc784e401..82a9376bd 100644 --- a/packages/typespec-rust/test/spector/client/naming/src/lib.rs +++ b/packages/typespec-rust/test/spector/client/naming/src/lib.rs @@ -7,3 +7,6 @@ mod generated; pub use generated::*; +pub mod model; +pub mod property; +pub mod union_enum; diff --git a/packages/typespec-rust/test/spector/client/naming/src/model/generated/clients/mod.rs b/packages/typespec-rust/test/spector/client/naming/src/model/generated/clients/mod.rs new file mode 100644 index 000000000..022970730 --- /dev/null +++ b/packages/typespec-rust/test/spector/client/naming/src/model/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod model_client; +pub use model_client::*; diff --git a/packages/typespec-rust/test/spector/client/naming/src/generated/clients/model_client.rs b/packages/typespec-rust/test/spector/client/naming/src/model/generated/clients/model_client.rs similarity index 98% rename from packages/typespec-rust/test/spector/client/naming/src/generated/clients/model_client.rs rename to packages/typespec-rust/test/spector/client/naming/src/model/generated/clients/model_client.rs index c1575dc09..8e5dd5830 100644 --- a/packages/typespec-rust/test/spector/client/naming/src/generated/clients/model_client.rs +++ b/packages/typespec-rust/test/spector/client/naming/src/model/generated/clients/model_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::model::generated::models::{ ClientModel, ModelClientClientOptions, ModelClientLanguageOptions, RustName, }; use azure_core::{ diff --git a/packages/typespec-rust/test/spector/client/naming/src/model/generated/mod.rs b/packages/typespec-rust/test/spector/client/naming/src/model/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/client/naming/src/model/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/service/multi-service/src/generated/models/method_options.rs b/packages/typespec-rust/test/spector/client/naming/src/model/generated/models/method_options.rs similarity index 61% rename from packages/typespec-rust/test/spector/service/multi-service/src/generated/models/method_options.rs rename to packages/typespec-rust/test/spector/client/naming/src/model/generated/models/method_options.rs index e591870fc..8ea4a5cbe 100644 --- a/packages/typespec-rust/test/spector/service/multi-service/src/generated/models/method_options.rs +++ b/packages/typespec-rust/test/spector/client/naming/src/model/generated/models/method_options.rs @@ -5,16 +5,16 @@ use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; -/// Options to be passed to [`CombinedBarClient::test()`](crate::generated::clients::CombinedBarClient::test()) +/// Options to be passed to [`ModelClient::client()`](crate::model::generated::clients::ModelClient::client()) #[derive(Clone, Default, SafeDebug)] -pub struct CombinedBarClientTestOptions<'a> { +pub struct ModelClientClientOptions<'a> { /// Allows customization of the method call. pub method_options: ClientMethodOptions<'a>, } -/// Options to be passed to [`CombinedFooClient::test()`](crate::generated::clients::CombinedFooClient::test()) +/// Options to be passed to [`ModelClient::language()`](crate::model::generated::clients::ModelClient::language()) #[derive(Clone, Default, SafeDebug)] -pub struct CombinedFooClientTestOptions<'a> { +pub struct ModelClientLanguageOptions<'a> { /// Allows customization of the method call. pub method_options: ClientMethodOptions<'a>, } diff --git a/packages/typespec-rust/test/spector/encode/numeric/src/generated/models/mod.rs b/packages/typespec-rust/test/spector/client/naming/src/model/generated/models/mod.rs similarity index 100% rename from packages/typespec-rust/test/spector/encode/numeric/src/generated/models/mod.rs rename to packages/typespec-rust/test/spector/client/naming/src/model/generated/models/mod.rs diff --git a/packages/typespec-rust/test/spector/client/naming/src/model/generated/models/models.rs b/packages/typespec-rust/test/spector/client/naming/src/model/generated/models/models.rs new file mode 100644 index 000000000..fcab72aed --- /dev/null +++ b/packages/typespec-rust/test/spector/client/naming/src/model/generated/models/models.rs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::fmt::SafeDebug; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] +pub struct ClientModel { + /// Pass in true + #[serde(rename = "defaultName", skip_serializing_if = "Option::is_none")] + pub default_name: Option, +} + +#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] +pub struct RustName { + /// Pass in true + #[serde(rename = "defaultName", skip_serializing_if = "Option::is_none")] + pub default_name: Option, +} diff --git a/packages/typespec-rust/test/spector/client/naming/src/model/generated/models/models_impl.rs b/packages/typespec-rust/test/spector/client/naming/src/model/generated/models/models_impl.rs new file mode 100644 index 000000000..bfc27a314 --- /dev/null +++ b/packages/typespec-rust/test/spector/client/naming/src/model/generated/models/models_impl.rs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use super::{ClientModel, RustName}; +use azure_core::{http::RequestContent, json::to_json, Result}; + +impl TryFrom for RequestContent { + type Error = azure_core::Error; + fn try_from(value: ClientModel) -> Result { + Ok(to_json(&value)?.into()) + } +} + +impl TryFrom for RequestContent { + type Error = azure_core::Error; + fn try_from(value: RustName) -> Result { + Ok(to_json(&value)?.into()) + } +} diff --git a/packages/typespec-rust/test/spector/client/naming/src/model/mod.rs b/packages/typespec-rust/test/spector/client/naming/src/model/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/client/naming/src/model/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/client/naming/src/property/generated/mod.rs b/packages/typespec-rust/test/spector/client/naming/src/property/generated/mod.rs new file mode 100644 index 000000000..4f2be13f2 --- /dev/null +++ b/packages/typespec-rust/test/spector/client/naming/src/property/generated/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/client/naming/src/property/generated/models/mod.rs b/packages/typespec-rust/test/spector/client/naming/src/property/generated/models/mod.rs new file mode 100644 index 000000000..1ce3980d9 --- /dev/null +++ b/packages/typespec-rust/test/spector/client/naming/src/property/generated/models/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +#[allow(clippy::module_inception)] +mod models; +mod models_impl; +pub use models::*; diff --git a/packages/typespec-rust/test/spector/client/naming/src/property/generated/models/models.rs b/packages/typespec-rust/test/spector/client/naming/src/property/generated/models/models.rs new file mode 100644 index 000000000..b6533f4cc --- /dev/null +++ b/packages/typespec-rust/test/spector/client/naming/src/property/generated/models/models.rs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::fmt::SafeDebug; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] +pub struct ClientNameAndJsonEncodedNameModel { + /// Pass in true + #[serde(rename = "wireName", skip_serializing_if = "Option::is_none")] + pub client_name: Option, +} + +#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] +pub struct ClientNameModel { + /// Pass in true + #[serde(rename = "defaultName", skip_serializing_if = "Option::is_none")] + pub client_name: Option, +} + +#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] +pub struct LanguageClientNameModel { + /// Pass in true + #[serde(rename = "defaultName", skip_serializing_if = "Option::is_none")] + pub rust_name: Option, +} diff --git a/packages/typespec-rust/test/spector/client/naming/src/generated/models/models_impl.rs b/packages/typespec-rust/test/spector/client/naming/src/property/generated/models/models_impl.rs similarity index 64% rename from packages/typespec-rust/test/spector/client/naming/src/generated/models/models_impl.rs rename to packages/typespec-rust/test/spector/client/naming/src/property/generated/models/models_impl.rs index 612cbfcae..f5b7f2425 100644 --- a/packages/typespec-rust/test/spector/client/naming/src/generated/models/models_impl.rs +++ b/packages/typespec-rust/test/spector/client/naming/src/property/generated/models/models_impl.rs @@ -3,19 +3,9 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use super::{ - ClientModel, ClientNameAndJsonEncodedNameModel, ClientNameModel, LanguageClientNameModel, - RustName, -}; +use super::{ClientNameAndJsonEncodedNameModel, ClientNameModel, LanguageClientNameModel}; use azure_core::{http::RequestContent, json::to_json, Result}; -impl TryFrom for RequestContent { - type Error = azure_core::Error; - fn try_from(value: ClientModel) -> Result { - Ok(to_json(&value)?.into()) - } -} - impl TryFrom for RequestContent { @@ -38,10 +28,3 @@ impl TryFrom for RequestContent for RequestContent { - type Error = azure_core::Error; - fn try_from(value: RustName) -> Result { - Ok(to_json(&value)?.into()) - } -} diff --git a/packages/typespec-rust/test/spector/client/naming/src/property/mod.rs b/packages/typespec-rust/test/spector/client/naming/src/property/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/client/naming/src/property/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/client/naming/src/union_enum/generated/clients/mod.rs b/packages/typespec-rust/test/spector/client/naming/src/union_enum/generated/clients/mod.rs new file mode 100644 index 000000000..22a48f830 --- /dev/null +++ b/packages/typespec-rust/test/spector/client/naming/src/union_enum/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod naming_union_enum_client; +pub use naming_union_enum_client::*; diff --git a/packages/typespec-rust/test/spector/client/naming/src/generated/clients/naming_union_enum_client.rs b/packages/typespec-rust/test/spector/client/naming/src/union_enum/generated/clients/naming_union_enum_client.rs similarity index 98% rename from packages/typespec-rust/test/spector/client/naming/src/generated/clients/naming_union_enum_client.rs rename to packages/typespec-rust/test/spector/client/naming/src/union_enum/generated/clients/naming_union_enum_client.rs index 38303580a..ef10ee89d 100644 --- a/packages/typespec-rust/test/spector/client/naming/src/generated/clients/naming_union_enum_client.rs +++ b/packages/typespec-rust/test/spector/client/naming/src/union_enum/generated/clients/naming_union_enum_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::union_enum::generated::models::{ ClientExtensibleEnum, ExtensibleEnum, NamingUnionEnumClientUnionEnumMemberNameOptions, NamingUnionEnumClientUnionEnumNameOptions, }; diff --git a/packages/typespec-rust/test/spector/client/naming/src/union_enum/generated/mod.rs b/packages/typespec-rust/test/spector/client/naming/src/union_enum/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/client/naming/src/union_enum/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/client/naming/src/generated/models/enums.rs b/packages/typespec-rust/test/spector/client/naming/src/union_enum/generated/models/enums.rs similarity index 100% rename from packages/typespec-rust/test/spector/client/naming/src/generated/models/enums.rs rename to packages/typespec-rust/test/spector/client/naming/src/union_enum/generated/models/enums.rs diff --git a/packages/typespec-rust/test/spector/client/naming/src/generated/models/enums_impl.rs b/packages/typespec-rust/test/spector/client/naming/src/union_enum/generated/models/enums_impl.rs similarity index 100% rename from packages/typespec-rust/test/spector/client/naming/src/generated/models/enums_impl.rs rename to packages/typespec-rust/test/spector/client/naming/src/union_enum/generated/models/enums_impl.rs diff --git a/packages/typespec-rust/test/spector/client/naming/src/generated/models/enums_serde.rs b/packages/typespec-rust/test/spector/client/naming/src/union_enum/generated/models/enums_serde.rs similarity index 100% rename from packages/typespec-rust/test/spector/client/naming/src/generated/models/enums_serde.rs rename to packages/typespec-rust/test/spector/client/naming/src/union_enum/generated/models/enums_serde.rs diff --git a/packages/typespec-rust/test/spector/client/naming/src/union_enum/generated/models/method_options.rs b/packages/typespec-rust/test/spector/client/naming/src/union_enum/generated/models/method_options.rs new file mode 100644 index 000000000..1078ebbb1 --- /dev/null +++ b/packages/typespec-rust/test/spector/client/naming/src/union_enum/generated/models/method_options.rs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`NamingUnionEnumClient::union_enum_member_name()`](crate::union_enum::generated::clients::NamingUnionEnumClient::union_enum_member_name()) +#[derive(Clone, Default, SafeDebug)] +pub struct NamingUnionEnumClientUnionEnumMemberNameOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`NamingUnionEnumClient::union_enum_name()`](crate::union_enum::generated::clients::NamingUnionEnumClient::union_enum_name()) +#[derive(Clone, Default, SafeDebug)] +pub struct NamingUnionEnumClientUnionEnumNameOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/client/naming/src/union_enum/generated/models/mod.rs b/packages/typespec-rust/test/spector/client/naming/src/union_enum/generated/models/mod.rs new file mode 100644 index 000000000..004f4c2d2 --- /dev/null +++ b/packages/typespec-rust/test/spector/client/naming/src/union_enum/generated/models/mod.rs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod enums; +mod enums_impl; +mod enums_serde; +mod method_options; +pub use enums::*; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/client/naming/src/union_enum/mod.rs b/packages/typespec-rust/test/spector/client/naming/src/union_enum/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/client/naming/src/union_enum/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/client/naming/tests/client_model_client.rs b/packages/typespec-rust/test/spector/client/naming/tests/client_model_client.rs index 461f72a14..441601a10 100644 --- a/packages/typespec-rust/test/spector/client/naming/tests/client_model_client.rs +++ b/packages/typespec-rust/test/spector/client/naming/tests/client_model_client.rs @@ -3,7 +3,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. use spector_naming::{ - models::{ClientModel, RustName}, + model::models::{ClientModel, RustName}, NamingClient, }; diff --git a/packages/typespec-rust/test/spector/client/naming/tests/naming_client.rs b/packages/typespec-rust/test/spector/client/naming/tests/naming_client.rs index f58fe8ad1..4ea9059bd 100644 --- a/packages/typespec-rust/test/spector/client/naming/tests/naming_client.rs +++ b/packages/typespec-rust/test/spector/client/naming/tests/naming_client.rs @@ -3,9 +3,9 @@ // Licensed under the MIT License. See License.txt in the project root for license information. use spector_naming::{ - models::{ + models::NamingClientResponseResultHeaders, + property::models::{ ClientNameAndJsonEncodedNameModel, ClientNameModel, LanguageClientNameModel, - NamingClientResponseResultHeaders, }, NamingClient, }; diff --git a/packages/typespec-rust/test/spector/client/naming/tests/naming_union_enum_client.rs b/packages/typespec-rust/test/spector/client/naming/tests/naming_union_enum_client.rs index c3ba3e610..5ab598cbe 100644 --- a/packages/typespec-rust/test/spector/client/naming/tests/naming_union_enum_client.rs +++ b/packages/typespec-rust/test/spector/client/naming/tests/naming_union_enum_client.rs @@ -3,7 +3,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. use spector_naming::{ - models::{ClientExtensibleEnum, ExtensibleEnum}, + union_enum::models::{ClientExtensibleEnum, ExtensibleEnum}, NamingClient, }; diff --git a/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/mod.rs b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/mod.rs new file mode 100644 index 000000000..3ca23df2f --- /dev/null +++ b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/mod.rs @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +pub mod structure; diff --git a/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/another_client_operation_group/generated/clients/mod.rs b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/another_client_operation_group/generated/clients/mod.rs new file mode 100644 index 000000000..01e6113f8 --- /dev/null +++ b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/another_client_operation_group/generated/clients/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod second_client; +mod second_group5_client; +pub use second_client::*; +pub use second_group5_client::*; diff --git a/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/generated/clients/second_client.rs b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/another_client_operation_group/generated/clients/second_client.rs similarity index 94% rename from packages/typespec-rust/test/spector/client/structure/client-operation-group/src/generated/clients/second_client.rs rename to packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/another_client_operation_group/generated/clients/second_client.rs index c1140f303..83d597e07 100644 --- a/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/generated/clients/second_client.rs +++ b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/another_client_operation_group/generated/clients/second_client.rs @@ -3,9 +3,11 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::{ - clients::SecondGroup5Client, - models::{ClientType, SecondClientFiveOptions}, +use crate::client::structure::{ + another_client_operation_group::generated::{ + clients::SecondGroup5Client, models::SecondClientFiveOptions, + }, + service::models::ClientType, }; use azure_core::{ error::CheckSuccessOptions, diff --git a/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/generated/clients/second_group5_client.rs b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/another_client_operation_group/generated/clients/second_group5_client.rs similarity index 93% rename from packages/typespec-rust/test/spector/client/structure/client-operation-group/src/generated/clients/second_group5_client.rs rename to packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/another_client_operation_group/generated/clients/second_group5_client.rs index 24dbb7f9f..d624539bb 100644 --- a/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/generated/clients/second_group5_client.rs +++ b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/another_client_operation_group/generated/clients/second_group5_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::SecondGroup5ClientSixOptions; +use crate::client::structure::another_client_operation_group::generated::models::SecondGroup5ClientSixOptions; use azure_core::{ error::CheckSuccessOptions, http::{Method, NoFormat, Pipeline, PipelineSendOptions, Request, Response, Url, UrlExt}, diff --git a/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/another_client_operation_group/generated/mod.rs b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/another_client_operation_group/generated/mod.rs new file mode 100644 index 000000000..29f46173a --- /dev/null +++ b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/another_client_operation_group/generated/mod.rs @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; +pub use clients::{SecondClient, SecondClientOptions}; diff --git a/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/another_client_operation_group/generated/models/method_options.rs b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/another_client_operation_group/generated/models/method_options.rs new file mode 100644 index 000000000..1066e15c9 --- /dev/null +++ b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/another_client_operation_group/generated/models/method_options.rs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`SecondClient::five()`](crate::client::structure::another_client_operation_group::generated::clients::SecondClient::five()) +#[derive(Clone, Default, SafeDebug)] +pub struct SecondClientFiveOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SecondGroup5Client::six()`](crate::client::structure::another_client_operation_group::generated::clients::SecondGroup5Client::six()) +#[derive(Clone, Default, SafeDebug)] +pub struct SecondGroup5ClientSixOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/parameters/collection-format/src/generated/models/mod.rs b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/another_client_operation_group/generated/models/mod.rs similarity index 100% rename from packages/typespec-rust/test/spector/parameters/collection-format/src/generated/models/mod.rs rename to packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/another_client_operation_group/generated/models/mod.rs diff --git a/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/another_client_operation_group/mod.rs b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/another_client_operation_group/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/another_client_operation_group/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/mod.rs b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/mod.rs new file mode 100644 index 000000000..2d76ae339 --- /dev/null +++ b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +pub mod another_client_operation_group; +pub mod service; diff --git a/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/service/generated/mod.rs b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/service/generated/mod.rs new file mode 100644 index 000000000..4f2be13f2 --- /dev/null +++ b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/service/generated/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/generated/models/enums.rs b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/service/generated/models/enums.rs similarity index 100% rename from packages/typespec-rust/test/spector/client/structure/client-operation-group/src/generated/models/enums.rs rename to packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/service/generated/models/enums.rs diff --git a/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/generated/models/enums_impl.rs b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/service/generated/models/enums_impl.rs similarity index 100% rename from packages/typespec-rust/test/spector/client/structure/client-operation-group/src/generated/models/enums_impl.rs rename to packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/service/generated/models/enums_impl.rs diff --git a/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/generated/models/enums_serde.rs b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/service/generated/models/enums_serde.rs similarity index 100% rename from packages/typespec-rust/test/spector/client/structure/client-operation-group/src/generated/models/enums_serde.rs rename to packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/service/generated/models/enums_serde.rs diff --git a/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/service/generated/models/mod.rs b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/service/generated/models/mod.rs new file mode 100644 index 000000000..f2c583f3a --- /dev/null +++ b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/service/generated/models/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod enums; +mod enums_impl; +mod enums_serde; +pub use enums::*; diff --git a/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/service/mod.rs b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/service/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/client/structure/service/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/generated/clients/first_client.rs b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/generated/clients/first_client.rs index d5c139c6b..dec48dd81 100644 --- a/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/generated/clients/first_client.rs +++ b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/generated/clients/first_client.rs @@ -3,9 +3,12 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::{ - clients::{FirstGroup3Client, FirstGroup4Client}, - models::{ClientType, FirstClientOneOptions}, +use crate::{ + client::structure::service::models::ClientType, + generated::{ + clients::{FirstGroup3Client, FirstGroup4Client}, + models::FirstClientOneOptions, + }, }; use azure_core::{ error::CheckSuccessOptions, diff --git a/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/generated/clients/mod.rs b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/generated/clients/mod.rs index 9fa687381..f88b70505 100644 --- a/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/generated/clients/mod.rs +++ b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/generated/clients/mod.rs @@ -6,10 +6,6 @@ mod first_client; mod first_group3_client; mod first_group4_client; -mod second_client; -mod second_group5_client; pub use first_client::*; pub use first_group3_client::*; pub use first_group4_client::*; -pub use second_client::*; -pub use second_group5_client::*; diff --git a/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/generated/mod.rs b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/generated/mod.rs index 3e6c4604b..1c68d8331 100644 --- a/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/generated/mod.rs +++ b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/generated/mod.rs @@ -7,4 +7,4 @@ pub mod clients; /// Contains all the data structures and types used by the client library. pub mod models; -pub use clients::{FirstClient, FirstClientOptions, SecondClient, SecondClientOptions}; +pub use clients::{FirstClient, FirstClientOptions}; diff --git a/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/generated/models/method_options.rs b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/generated/models/method_options.rs index 94430122f..96669971d 100644 --- a/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/generated/models/method_options.rs +++ b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/generated/models/method_options.rs @@ -32,17 +32,3 @@ pub struct FirstGroup4ClientFourOptions<'a> { /// Allows customization of the method call. pub method_options: ClientMethodOptions<'a>, } - -/// Options to be passed to [`SecondClient::five()`](crate::generated::clients::SecondClient::five()) -#[derive(Clone, Default, SafeDebug)] -pub struct SecondClientFiveOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SecondGroup5Client::six()`](crate::generated::clients::SecondGroup5Client::six()) -#[derive(Clone, Default, SafeDebug)] -pub struct SecondGroup5ClientSixOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} diff --git a/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/generated/models/mod.rs b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/generated/models/mod.rs index 004f4c2d2..3e484b1ed 100644 --- a/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/generated/models/mod.rs +++ b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/generated/models/mod.rs @@ -3,9 +3,5 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -mod enums; -mod enums_impl; -mod enums_serde; mod method_options; -pub use enums::*; pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/lib.rs b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/lib.rs index cc784e401..1afbcfc80 100644 --- a/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/lib.rs +++ b/packages/typespec-rust/test/spector/client/structure/client-operation-group/src/lib.rs @@ -7,3 +7,4 @@ mod generated; pub use generated::*; +pub mod client; diff --git a/packages/typespec-rust/test/spector/client/structure/client-operation-group/tests/first_client_test.rs b/packages/typespec-rust/test/spector/client/structure/client-operation-group/tests/first_client_test.rs index e1bb57dd9..cfefc5d42 100644 --- a/packages/typespec-rust/test/spector/client/structure/client-operation-group/tests/first_client_test.rs +++ b/packages/typespec-rust/test/spector/client/structure/client-operation-group/tests/first_client_test.rs @@ -2,7 +2,7 @@ // // Licensed under the MIT License. See License.txt in the project root for license information. -use spector_clientopgroup::{models::ClientType, FirstClient}; +use spector_clientopgroup::{client::structure::service::models::ClientType, FirstClient}; #[tokio::test] async fn one() { diff --git a/packages/typespec-rust/test/spector/client/structure/client-operation-group/tests/first_group3_client_test.rs b/packages/typespec-rust/test/spector/client/structure/client-operation-group/tests/first_group3_client_test.rs index ba09b19fc..78e9dfa96 100644 --- a/packages/typespec-rust/test/spector/client/structure/client-operation-group/tests/first_group3_client_test.rs +++ b/packages/typespec-rust/test/spector/client/structure/client-operation-group/tests/first_group3_client_test.rs @@ -2,7 +2,7 @@ // // Licensed under the MIT License. See License.txt in the project root for license information. -use spector_clientopgroup::{models::ClientType, FirstClient}; +use spector_clientopgroup::{client::structure::service::models::ClientType, FirstClient}; #[tokio::test] async fn three() { diff --git a/packages/typespec-rust/test/spector/client/structure/client-operation-group/tests/first_group4_client_test.rs b/packages/typespec-rust/test/spector/client/structure/client-operation-group/tests/first_group4_client_test.rs index d6c60efc9..7744eabce 100644 --- a/packages/typespec-rust/test/spector/client/structure/client-operation-group/tests/first_group4_client_test.rs +++ b/packages/typespec-rust/test/spector/client/structure/client-operation-group/tests/first_group4_client_test.rs @@ -2,7 +2,7 @@ // // Licensed under the MIT License. See License.txt in the project root for license information. -use spector_clientopgroup::{models::ClientType, FirstClient}; +use spector_clientopgroup::{client::structure::service::models::ClientType, FirstClient}; #[tokio::test] async fn four() { diff --git a/packages/typespec-rust/test/spector/client/structure/client-operation-group/tests/second_client_test.rs b/packages/typespec-rust/test/spector/client/structure/client-operation-group/tests/second_client_test.rs index 6b01ac551..74e9f68c7 100644 --- a/packages/typespec-rust/test/spector/client/structure/client-operation-group/tests/second_client_test.rs +++ b/packages/typespec-rust/test/spector/client/structure/client-operation-group/tests/second_client_test.rs @@ -2,7 +2,10 @@ // // Licensed under the MIT License. See License.txt in the project root for license information. -use spector_clientopgroup::{models::ClientType, SecondClient}; +use spector_clientopgroup::{ + client::structure::another_client_operation_group::SecondClient, + client::structure::service::models::ClientType, +}; #[tokio::test] async fn five() { diff --git a/packages/typespec-rust/test/spector/client/structure/client-operation-group/tests/second_group5_client_test.rs b/packages/typespec-rust/test/spector/client/structure/client-operation-group/tests/second_group5_client_test.rs index 596b39e4f..85e9208ea 100644 --- a/packages/typespec-rust/test/spector/client/structure/client-operation-group/tests/second_group5_client_test.rs +++ b/packages/typespec-rust/test/spector/client/structure/client-operation-group/tests/second_group5_client_test.rs @@ -2,7 +2,10 @@ // // Licensed under the MIT License. See License.txt in the project root for license information. -use spector_clientopgroup::{models::ClientType, SecondClient}; +use spector_clientopgroup::{ + client::structure::another_client_operation_group::SecondClient, + client::structure::service::models::ClientType, +}; #[tokio::test] async fn six() { diff --git a/packages/typespec-rust/test/spector/client/structure/default/src/baz/generated/clients/mod.rs b/packages/typespec-rust/test/spector/client/structure/default/src/baz/generated/clients/mod.rs new file mode 100644 index 000000000..21dc27bf6 --- /dev/null +++ b/packages/typespec-rust/test/spector/client/structure/default/src/baz/generated/clients/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod service_baz_client; +mod service_baz_foo_client; +pub use service_baz_client::*; +pub use service_baz_foo_client::*; diff --git a/packages/typespec-rust/test/spector/client/structure/default/src/generated/clients/service_baz_client.rs b/packages/typespec-rust/test/spector/client/structure/default/src/baz/generated/clients/service_baz_client.rs similarity index 93% rename from packages/typespec-rust/test/spector/client/structure/default/src/generated/clients/service_baz_client.rs rename to packages/typespec-rust/test/spector/client/structure/default/src/baz/generated/clients/service_baz_client.rs index 91436e979..f9761f289 100644 --- a/packages/typespec-rust/test/spector/client/structure/default/src/generated/clients/service_baz_client.rs +++ b/packages/typespec-rust/test/spector/client/structure/default/src/baz/generated/clients/service_baz_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::clients::ServiceBazFooClient; +use crate::baz::generated::clients::ServiceBazFooClient; use azure_core::{ http::{Pipeline, Url}, tracing, diff --git a/packages/typespec-rust/test/spector/client/structure/default/src/generated/clients/service_baz_foo_client.rs b/packages/typespec-rust/test/spector/client/structure/default/src/baz/generated/clients/service_baz_foo_client.rs similarity index 95% rename from packages/typespec-rust/test/spector/client/structure/default/src/generated/clients/service_baz_foo_client.rs rename to packages/typespec-rust/test/spector/client/structure/default/src/baz/generated/clients/service_baz_foo_client.rs index 2bc7a0443..bf9ef592b 100644 --- a/packages/typespec-rust/test/spector/client/structure/default/src/generated/clients/service_baz_foo_client.rs +++ b/packages/typespec-rust/test/spector/client/structure/default/src/baz/generated/clients/service_baz_foo_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::ServiceBazFooClientSevenOptions; +use crate::baz::generated::models::ServiceBazFooClientSevenOptions; use azure_core::{ error::CheckSuccessOptions, http::{Method, NoFormat, Pipeline, PipelineSendOptions, Request, Response, Url, UrlExt}, diff --git a/packages/typespec-rust/test/spector/client/structure/default/src/baz/generated/mod.rs b/packages/typespec-rust/test/spector/client/structure/default/src/baz/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/client/structure/default/src/baz/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/client/structure/default/src/baz/generated/models/method_options.rs b/packages/typespec-rust/test/spector/client/structure/default/src/baz/generated/models/method_options.rs new file mode 100644 index 000000000..66ad7ebcf --- /dev/null +++ b/packages/typespec-rust/test/spector/client/structure/default/src/baz/generated/models/method_options.rs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`ServiceBazFooClient::seven()`](crate::baz::generated::clients::ServiceBazFooClient::seven()) +#[derive(Clone, Default, SafeDebug)] +pub struct ServiceBazFooClientSevenOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/payload/media-type/src/generated/models/mod.rs b/packages/typespec-rust/test/spector/client/structure/default/src/baz/generated/models/mod.rs similarity index 100% rename from packages/typespec-rust/test/spector/payload/media-type/src/generated/models/mod.rs rename to packages/typespec-rust/test/spector/client/structure/default/src/baz/generated/models/mod.rs diff --git a/packages/typespec-rust/test/spector/client/structure/default/src/baz/mod.rs b/packages/typespec-rust/test/spector/client/structure/default/src/baz/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/client/structure/default/src/baz/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/client/structure/default/src/generated/clients/mod.rs b/packages/typespec-rust/test/spector/client/structure/default/src/generated/clients/mod.rs index 8836573f1..fb67acb88 100644 --- a/packages/typespec-rust/test/spector/client/structure/default/src/generated/clients/mod.rs +++ b/packages/typespec-rust/test/spector/client/structure/default/src/generated/clients/mod.rs @@ -4,16 +4,8 @@ // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. mod service_bar_client; -mod service_baz_client; -mod service_baz_foo_client; mod service_client; mod service_foo_client; -mod service_qux_bar_client; -mod service_qux_client; pub use service_bar_client::*; -pub use service_baz_client::*; -pub use service_baz_foo_client::*; pub use service_client::*; pub use service_foo_client::*; -pub use service_qux_bar_client::*; -pub use service_qux_client::*; diff --git a/packages/typespec-rust/test/spector/client/structure/default/src/generated/clients/service_client.rs b/packages/typespec-rust/test/spector/client/structure/default/src/generated/clients/service_client.rs index 26c6418dd..7d2c80f85 100644 --- a/packages/typespec-rust/test/spector/client/structure/default/src/generated/clients/service_client.rs +++ b/packages/typespec-rust/test/spector/client/structure/default/src/generated/clients/service_client.rs @@ -3,9 +3,13 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::{ - clients::{ServiceBarClient, ServiceBazClient, ServiceFooClient, ServiceQuxClient}, - models::{ClientType, ServiceClientOneOptions, ServiceClientTwoOptions}, +use crate::{ + baz::clients::ServiceBazClient, + generated::{ + clients::{ServiceBarClient, ServiceFooClient}, + models::{ClientType, ServiceClientOneOptions, ServiceClientTwoOptions}, + }, + qux::clients::ServiceQuxClient, }; use azure_core::{ error::CheckSuccessOptions, diff --git a/packages/typespec-rust/test/spector/client/structure/default/src/generated/models/method_options.rs b/packages/typespec-rust/test/spector/client/structure/default/src/generated/models/method_options.rs index a7b63716f..fe05aade3 100644 --- a/packages/typespec-rust/test/spector/client/structure/default/src/generated/models/method_options.rs +++ b/packages/typespec-rust/test/spector/client/structure/default/src/generated/models/method_options.rs @@ -19,13 +19,6 @@ pub struct ServiceBarClientSixOptions<'a> { pub method_options: ClientMethodOptions<'a>, } -/// Options to be passed to [`ServiceBazFooClient::seven()`](crate::generated::clients::ServiceBazFooClient::seven()) -#[derive(Clone, Default, SafeDebug)] -pub struct ServiceBazFooClientSevenOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - /// Options to be passed to [`ServiceClient::one()`](crate::generated::clients::ServiceClient::one()) #[derive(Clone, Default, SafeDebug)] pub struct ServiceClientOneOptions<'a> { @@ -53,17 +46,3 @@ pub struct ServiceFooClientThreeOptions<'a> { /// Allows customization of the method call. pub method_options: ClientMethodOptions<'a>, } - -/// Options to be passed to [`ServiceQuxBarClient::nine()`](crate::generated::clients::ServiceQuxBarClient::nine()) -#[derive(Clone, Default, SafeDebug)] -pub struct ServiceQuxBarClientNineOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`ServiceQuxClient::eight()`](crate::generated::clients::ServiceQuxClient::eight()) -#[derive(Clone, Default, SafeDebug)] -pub struct ServiceQuxClientEightOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} diff --git a/packages/typespec-rust/test/spector/client/structure/default/src/lib.rs b/packages/typespec-rust/test/spector/client/structure/default/src/lib.rs index cc784e401..5e3ea0338 100644 --- a/packages/typespec-rust/test/spector/client/structure/default/src/lib.rs +++ b/packages/typespec-rust/test/spector/client/structure/default/src/lib.rs @@ -7,3 +7,5 @@ mod generated; pub use generated::*; +pub mod baz; +pub mod qux; diff --git a/packages/typespec-rust/test/spector/client/structure/default/src/qux/generated/clients/mod.rs b/packages/typespec-rust/test/spector/client/structure/default/src/qux/generated/clients/mod.rs new file mode 100644 index 000000000..aa6492424 --- /dev/null +++ b/packages/typespec-rust/test/spector/client/structure/default/src/qux/generated/clients/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod service_qux_bar_client; +mod service_qux_client; +pub use service_qux_bar_client::*; +pub use service_qux_client::*; diff --git a/packages/typespec-rust/test/spector/client/structure/default/src/generated/clients/service_qux_bar_client.rs b/packages/typespec-rust/test/spector/client/structure/default/src/qux/generated/clients/service_qux_bar_client.rs similarity index 95% rename from packages/typespec-rust/test/spector/client/structure/default/src/generated/clients/service_qux_bar_client.rs rename to packages/typespec-rust/test/spector/client/structure/default/src/qux/generated/clients/service_qux_bar_client.rs index 9f18eae8f..78ceab45d 100644 --- a/packages/typespec-rust/test/spector/client/structure/default/src/generated/clients/service_qux_bar_client.rs +++ b/packages/typespec-rust/test/spector/client/structure/default/src/qux/generated/clients/service_qux_bar_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::ServiceQuxBarClientNineOptions; +use crate::qux::generated::models::ServiceQuxBarClientNineOptions; use azure_core::{ error::CheckSuccessOptions, http::{Method, NoFormat, Pipeline, PipelineSendOptions, Request, Response, Url, UrlExt}, diff --git a/packages/typespec-rust/test/spector/client/structure/default/src/generated/clients/service_qux_client.rs b/packages/typespec-rust/test/spector/client/structure/default/src/qux/generated/clients/service_qux_client.rs similarity index 95% rename from packages/typespec-rust/test/spector/client/structure/default/src/generated/clients/service_qux_client.rs rename to packages/typespec-rust/test/spector/client/structure/default/src/qux/generated/clients/service_qux_client.rs index b7387b238..28b05eaaf 100644 --- a/packages/typespec-rust/test/spector/client/structure/default/src/generated/clients/service_qux_client.rs +++ b/packages/typespec-rust/test/spector/client/structure/default/src/qux/generated/clients/service_qux_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::{clients::ServiceQuxBarClient, models::ServiceQuxClientEightOptions}; +use crate::qux::generated::{clients::ServiceQuxBarClient, models::ServiceQuxClientEightOptions}; use azure_core::{ error::CheckSuccessOptions, http::{Method, NoFormat, Pipeline, PipelineSendOptions, Request, Response, Url, UrlExt}, diff --git a/packages/typespec-rust/test/spector/client/structure/default/src/qux/generated/mod.rs b/packages/typespec-rust/test/spector/client/structure/default/src/qux/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/client/structure/default/src/qux/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/parameters/basic/src/generated/models/method_options.rs b/packages/typespec-rust/test/spector/client/structure/default/src/qux/generated/models/method_options.rs similarity index 58% rename from packages/typespec-rust/test/spector/parameters/basic/src/generated/models/method_options.rs rename to packages/typespec-rust/test/spector/client/structure/default/src/qux/generated/models/method_options.rs index 44e80e4c2..7320f81ac 100644 --- a/packages/typespec-rust/test/spector/parameters/basic/src/generated/models/method_options.rs +++ b/packages/typespec-rust/test/spector/client/structure/default/src/qux/generated/models/method_options.rs @@ -5,16 +5,16 @@ use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; -/// Options to be passed to [`BasicExplicitBodyClient::simple()`](crate::generated::clients::BasicExplicitBodyClient::simple()) +/// Options to be passed to [`ServiceQuxBarClient::nine()`](crate::qux::generated::clients::ServiceQuxBarClient::nine()) #[derive(Clone, Default, SafeDebug)] -pub struct BasicExplicitBodyClientSimpleOptions<'a> { +pub struct ServiceQuxBarClientNineOptions<'a> { /// Allows customization of the method call. pub method_options: ClientMethodOptions<'a>, } -/// Options to be passed to [`BasicImplicitBodyClient::simple()`](crate::generated::clients::BasicImplicitBodyClient::simple()) +/// Options to be passed to [`ServiceQuxClient::eight()`](crate::qux::generated::clients::ServiceQuxClient::eight()) #[derive(Clone, Default, SafeDebug)] -pub struct BasicImplicitBodyClientSimpleOptions<'a> { +pub struct ServiceQuxClientEightOptions<'a> { /// Allows customization of the method call. pub method_options: ClientMethodOptions<'a>, } diff --git a/packages/typespec-rust/test/spector/service/multi-service/src/generated/models/mod.rs b/packages/typespec-rust/test/spector/client/structure/default/src/qux/generated/models/mod.rs similarity index 100% rename from packages/typespec-rust/test/spector/service/multi-service/src/generated/models/mod.rs rename to packages/typespec-rust/test/spector/client/structure/default/src/qux/generated/models/mod.rs diff --git a/packages/typespec-rust/test/spector/client/structure/default/src/qux/mod.rs b/packages/typespec-rust/test/spector/client/structure/default/src/qux/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/client/structure/default/src/qux/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/client/structure/multi-client/src/client/mod.rs b/packages/typespec-rust/test/spector/client/structure/multi-client/src/client/mod.rs new file mode 100644 index 000000000..3ca23df2f --- /dev/null +++ b/packages/typespec-rust/test/spector/client/structure/multi-client/src/client/mod.rs @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +pub mod structure; diff --git a/packages/typespec-rust/test/spector/client/structure/multi-client/src/client/structure/mod.rs b/packages/typespec-rust/test/spector/client/structure/multi-client/src/client/structure/mod.rs new file mode 100644 index 000000000..d20b202b5 --- /dev/null +++ b/packages/typespec-rust/test/spector/client/structure/multi-client/src/client/structure/mod.rs @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +pub mod service; diff --git a/packages/typespec-rust/test/spector/client/structure/multi-client/src/client/structure/service/generated/mod.rs b/packages/typespec-rust/test/spector/client/structure/multi-client/src/client/structure/service/generated/mod.rs new file mode 100644 index 000000000..4f2be13f2 --- /dev/null +++ b/packages/typespec-rust/test/spector/client/structure/multi-client/src/client/structure/service/generated/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/client/structure/multi-client/src/generated/models/enums.rs b/packages/typespec-rust/test/spector/client/structure/multi-client/src/client/structure/service/generated/models/enums.rs similarity index 100% rename from packages/typespec-rust/test/spector/client/structure/multi-client/src/generated/models/enums.rs rename to packages/typespec-rust/test/spector/client/structure/multi-client/src/client/structure/service/generated/models/enums.rs diff --git a/packages/typespec-rust/test/spector/client/structure/multi-client/src/generated/models/enums_impl.rs b/packages/typespec-rust/test/spector/client/structure/multi-client/src/client/structure/service/generated/models/enums_impl.rs similarity index 100% rename from packages/typespec-rust/test/spector/client/structure/multi-client/src/generated/models/enums_impl.rs rename to packages/typespec-rust/test/spector/client/structure/multi-client/src/client/structure/service/generated/models/enums_impl.rs diff --git a/packages/typespec-rust/test/spector/client/structure/multi-client/src/generated/models/enums_serde.rs b/packages/typespec-rust/test/spector/client/structure/multi-client/src/client/structure/service/generated/models/enums_serde.rs similarity index 100% rename from packages/typespec-rust/test/spector/client/structure/multi-client/src/generated/models/enums_serde.rs rename to packages/typespec-rust/test/spector/client/structure/multi-client/src/client/structure/service/generated/models/enums_serde.rs diff --git a/packages/typespec-rust/test/spector/client/structure/multi-client/src/client/structure/service/generated/models/mod.rs b/packages/typespec-rust/test/spector/client/structure/multi-client/src/client/structure/service/generated/models/mod.rs new file mode 100644 index 000000000..f2c583f3a --- /dev/null +++ b/packages/typespec-rust/test/spector/client/structure/multi-client/src/client/structure/service/generated/models/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod enums; +mod enums_impl; +mod enums_serde; +pub use enums::*; diff --git a/packages/typespec-rust/test/spector/client/structure/multi-client/src/client/structure/service/mod.rs b/packages/typespec-rust/test/spector/client/structure/multi-client/src/client/structure/service/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/client/structure/multi-client/src/client/structure/service/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/client/structure/multi-client/src/generated/clients/client_a_client.rs b/packages/typespec-rust/test/spector/client/structure/multi-client/src/generated/clients/client_a_client.rs index 9ec531122..3a6216054 100644 --- a/packages/typespec-rust/test/spector/client/structure/multi-client/src/generated/clients/client_a_client.rs +++ b/packages/typespec-rust/test/spector/client/structure/multi-client/src/generated/clients/client_a_client.rs @@ -3,9 +3,12 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ - ClientAClientRenamedFiveOptions, ClientAClientRenamedOneOptions, - ClientAClientRenamedThreeOptions, ClientType, +use crate::{ + client::structure::service::models::ClientType, + generated::models::{ + ClientAClientRenamedFiveOptions, ClientAClientRenamedOneOptions, + ClientAClientRenamedThreeOptions, + }, }; use azure_core::{ error::CheckSuccessOptions, diff --git a/packages/typespec-rust/test/spector/client/structure/multi-client/src/generated/clients/client_b_client.rs b/packages/typespec-rust/test/spector/client/structure/multi-client/src/generated/clients/client_b_client.rs index c027cbf58..c043c1459 100644 --- a/packages/typespec-rust/test/spector/client/structure/multi-client/src/generated/clients/client_b_client.rs +++ b/packages/typespec-rust/test/spector/client/structure/multi-client/src/generated/clients/client_b_client.rs @@ -3,9 +3,12 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ - ClientBClientRenamedFourOptions, ClientBClientRenamedSixOptions, - ClientBClientRenamedTwoOptions, ClientType, +use crate::{ + client::structure::service::models::ClientType, + generated::models::{ + ClientBClientRenamedFourOptions, ClientBClientRenamedSixOptions, + ClientBClientRenamedTwoOptions, + }, }; use azure_core::{ error::CheckSuccessOptions, diff --git a/packages/typespec-rust/test/spector/client/structure/multi-client/src/generated/models/mod.rs b/packages/typespec-rust/test/spector/client/structure/multi-client/src/generated/models/mod.rs index 004f4c2d2..3e484b1ed 100644 --- a/packages/typespec-rust/test/spector/client/structure/multi-client/src/generated/models/mod.rs +++ b/packages/typespec-rust/test/spector/client/structure/multi-client/src/generated/models/mod.rs @@ -3,9 +3,5 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -mod enums; -mod enums_impl; -mod enums_serde; mod method_options; -pub use enums::*; pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/client/structure/multi-client/src/lib.rs b/packages/typespec-rust/test/spector/client/structure/multi-client/src/lib.rs index cc784e401..1afbcfc80 100644 --- a/packages/typespec-rust/test/spector/client/structure/multi-client/src/lib.rs +++ b/packages/typespec-rust/test/spector/client/structure/multi-client/src/lib.rs @@ -7,3 +7,4 @@ mod generated; pub use generated::*; +pub mod client; diff --git a/packages/typespec-rust/test/spector/client/structure/multi-client/tests/client_a_client_test.rs b/packages/typespec-rust/test/spector/client/structure/multi-client/tests/client_a_client_test.rs index 96bba6636..76b312ead 100644 --- a/packages/typespec-rust/test/spector/client/structure/multi-client/tests/client_a_client_test.rs +++ b/packages/typespec-rust/test/spector/client/structure/multi-client/tests/client_a_client_test.rs @@ -2,7 +2,7 @@ // // Licensed under the MIT License. See License.txt in the project root for license information. -use spector_multiclient::{models::ClientType, ClientAClient}; +use spector_multiclient::{client::structure::service::models::ClientType, ClientAClient}; #[tokio::test] async fn renamed_five() { diff --git a/packages/typespec-rust/test/spector/client/structure/multi-client/tests/client_b_client_test.rs b/packages/typespec-rust/test/spector/client/structure/multi-client/tests/client_b_client_test.rs index cad68e0bb..bc69f7cf9 100644 --- a/packages/typespec-rust/test/spector/client/structure/multi-client/tests/client_b_client_test.rs +++ b/packages/typespec-rust/test/spector/client/structure/multi-client/tests/client_b_client_test.rs @@ -2,7 +2,7 @@ // // Licensed under the MIT License. See License.txt in the project root for license information. -use spector_multiclient::{models::ClientType, ClientBClient}; +use spector_multiclient::{client::structure::service::models::ClientType, ClientBClient}; #[tokio::test] async fn renamed_four() { diff --git a/packages/typespec-rust/test/spector/client/structure/renamed-operation/src/client/mod.rs b/packages/typespec-rust/test/spector/client/structure/renamed-operation/src/client/mod.rs new file mode 100644 index 000000000..3ca23df2f --- /dev/null +++ b/packages/typespec-rust/test/spector/client/structure/renamed-operation/src/client/mod.rs @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +pub mod structure; diff --git a/packages/typespec-rust/test/spector/client/structure/renamed-operation/src/client/structure/mod.rs b/packages/typespec-rust/test/spector/client/structure/renamed-operation/src/client/structure/mod.rs new file mode 100644 index 000000000..d20b202b5 --- /dev/null +++ b/packages/typespec-rust/test/spector/client/structure/renamed-operation/src/client/structure/mod.rs @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +pub mod service; diff --git a/packages/typespec-rust/test/spector/client/structure/renamed-operation/src/client/structure/service/generated/mod.rs b/packages/typespec-rust/test/spector/client/structure/renamed-operation/src/client/structure/service/generated/mod.rs new file mode 100644 index 000000000..4f2be13f2 --- /dev/null +++ b/packages/typespec-rust/test/spector/client/structure/renamed-operation/src/client/structure/service/generated/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/client/structure/renamed-operation/src/generated/models/enums.rs b/packages/typespec-rust/test/spector/client/structure/renamed-operation/src/client/structure/service/generated/models/enums.rs similarity index 100% rename from packages/typespec-rust/test/spector/client/structure/renamed-operation/src/generated/models/enums.rs rename to packages/typespec-rust/test/spector/client/structure/renamed-operation/src/client/structure/service/generated/models/enums.rs diff --git a/packages/typespec-rust/test/spector/client/structure/renamed-operation/src/generated/models/enums_impl.rs b/packages/typespec-rust/test/spector/client/structure/renamed-operation/src/client/structure/service/generated/models/enums_impl.rs similarity index 100% rename from packages/typespec-rust/test/spector/client/structure/renamed-operation/src/generated/models/enums_impl.rs rename to packages/typespec-rust/test/spector/client/structure/renamed-operation/src/client/structure/service/generated/models/enums_impl.rs diff --git a/packages/typespec-rust/test/spector/client/structure/renamed-operation/src/generated/models/enums_serde.rs b/packages/typespec-rust/test/spector/client/structure/renamed-operation/src/client/structure/service/generated/models/enums_serde.rs similarity index 100% rename from packages/typespec-rust/test/spector/client/structure/renamed-operation/src/generated/models/enums_serde.rs rename to packages/typespec-rust/test/spector/client/structure/renamed-operation/src/client/structure/service/generated/models/enums_serde.rs diff --git a/packages/typespec-rust/test/spector/client/structure/renamed-operation/src/client/structure/service/generated/models/mod.rs b/packages/typespec-rust/test/spector/client/structure/renamed-operation/src/client/structure/service/generated/models/mod.rs new file mode 100644 index 000000000..f2c583f3a --- /dev/null +++ b/packages/typespec-rust/test/spector/client/structure/renamed-operation/src/client/structure/service/generated/models/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod enums; +mod enums_impl; +mod enums_serde; +pub use enums::*; diff --git a/packages/typespec-rust/test/spector/client/structure/renamed-operation/src/client/structure/service/mod.rs b/packages/typespec-rust/test/spector/client/structure/renamed-operation/src/client/structure/service/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/client/structure/renamed-operation/src/client/structure/service/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/client/structure/renamed-operation/src/generated/clients/renamed_operation_client.rs b/packages/typespec-rust/test/spector/client/structure/renamed-operation/src/generated/clients/renamed_operation_client.rs index 0628ec90a..97e29245c 100644 --- a/packages/typespec-rust/test/spector/client/structure/renamed-operation/src/generated/clients/renamed_operation_client.rs +++ b/packages/typespec-rust/test/spector/client/structure/renamed-operation/src/generated/clients/renamed_operation_client.rs @@ -3,11 +3,14 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::{ - clients::RenamedOperationGroupClient, - models::{ - ClientType, RenamedOperationClientRenamedFiveOptions, - RenamedOperationClientRenamedOneOptions, RenamedOperationClientRenamedThreeOptions, +use crate::{ + client::structure::service::models::ClientType, + generated::{ + clients::RenamedOperationGroupClient, + models::{ + RenamedOperationClientRenamedFiveOptions, RenamedOperationClientRenamedOneOptions, + RenamedOperationClientRenamedThreeOptions, + }, }, }; use azure_core::{ diff --git a/packages/typespec-rust/test/spector/client/structure/renamed-operation/src/generated/models/mod.rs b/packages/typespec-rust/test/spector/client/structure/renamed-operation/src/generated/models/mod.rs index 004f4c2d2..3e484b1ed 100644 --- a/packages/typespec-rust/test/spector/client/structure/renamed-operation/src/generated/models/mod.rs +++ b/packages/typespec-rust/test/spector/client/structure/renamed-operation/src/generated/models/mod.rs @@ -3,9 +3,5 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -mod enums; -mod enums_impl; -mod enums_serde; mod method_options; -pub use enums::*; pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/client/structure/renamed-operation/src/lib.rs b/packages/typespec-rust/test/spector/client/structure/renamed-operation/src/lib.rs index cc784e401..1afbcfc80 100644 --- a/packages/typespec-rust/test/spector/client/structure/renamed-operation/src/lib.rs +++ b/packages/typespec-rust/test/spector/client/structure/renamed-operation/src/lib.rs @@ -7,3 +7,4 @@ mod generated; pub use generated::*; +pub mod client; diff --git a/packages/typespec-rust/test/spector/client/structure/renamed-operation/tests/renamed_operation_client_test.rs b/packages/typespec-rust/test/spector/client/structure/renamed-operation/tests/renamed_operation_client_test.rs index dcf214d92..513490058 100644 --- a/packages/typespec-rust/test/spector/client/structure/renamed-operation/tests/renamed_operation_client_test.rs +++ b/packages/typespec-rust/test/spector/client/structure/renamed-operation/tests/renamed_operation_client_test.rs @@ -2,7 +2,7 @@ // // Licensed under the MIT License. See License.txt in the project root for license information. -use spector_renamedop::{models::ClientType, RenamedOperationClient}; +use spector_renamedop::{client::structure::service::models::ClientType, RenamedOperationClient}; #[tokio::test] async fn renamed_five() { diff --git a/packages/typespec-rust/test/spector/client/structure/renamed-operation/tests/renamed_operation_group_client_test.rs b/packages/typespec-rust/test/spector/client/structure/renamed-operation/tests/renamed_operation_group_client_test.rs index 39b15a6dc..4387b4ca8 100644 --- a/packages/typespec-rust/test/spector/client/structure/renamed-operation/tests/renamed_operation_group_client_test.rs +++ b/packages/typespec-rust/test/spector/client/structure/renamed-operation/tests/renamed_operation_group_client_test.rs @@ -2,7 +2,7 @@ // // Licensed under the MIT License. See License.txt in the project root for license information. -use spector_renamedop::{models::ClientType, RenamedOperationClient}; +use spector_renamedop::{client::structure::service::models::ClientType, RenamedOperationClient}; #[tokio::test] async fn renamed_four() { diff --git a/packages/typespec-rust/test/spector/client/structure/two-operation-group/src/client/mod.rs b/packages/typespec-rust/test/spector/client/structure/two-operation-group/src/client/mod.rs new file mode 100644 index 000000000..3ca23df2f --- /dev/null +++ b/packages/typespec-rust/test/spector/client/structure/two-operation-group/src/client/mod.rs @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +pub mod structure; diff --git a/packages/typespec-rust/test/spector/client/structure/two-operation-group/src/client/structure/mod.rs b/packages/typespec-rust/test/spector/client/structure/two-operation-group/src/client/structure/mod.rs new file mode 100644 index 000000000..d20b202b5 --- /dev/null +++ b/packages/typespec-rust/test/spector/client/structure/two-operation-group/src/client/structure/mod.rs @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +pub mod service; diff --git a/packages/typespec-rust/test/spector/client/structure/two-operation-group/src/client/structure/service/generated/mod.rs b/packages/typespec-rust/test/spector/client/structure/two-operation-group/src/client/structure/service/generated/mod.rs new file mode 100644 index 000000000..4f2be13f2 --- /dev/null +++ b/packages/typespec-rust/test/spector/client/structure/two-operation-group/src/client/structure/service/generated/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/client/structure/two-operation-group/src/generated/models/enums.rs b/packages/typespec-rust/test/spector/client/structure/two-operation-group/src/client/structure/service/generated/models/enums.rs similarity index 100% rename from packages/typespec-rust/test/spector/client/structure/two-operation-group/src/generated/models/enums.rs rename to packages/typespec-rust/test/spector/client/structure/two-operation-group/src/client/structure/service/generated/models/enums.rs diff --git a/packages/typespec-rust/test/spector/client/structure/two-operation-group/src/generated/models/enums_impl.rs b/packages/typespec-rust/test/spector/client/structure/two-operation-group/src/client/structure/service/generated/models/enums_impl.rs similarity index 100% rename from packages/typespec-rust/test/spector/client/structure/two-operation-group/src/generated/models/enums_impl.rs rename to packages/typespec-rust/test/spector/client/structure/two-operation-group/src/client/structure/service/generated/models/enums_impl.rs diff --git a/packages/typespec-rust/test/spector/client/structure/two-operation-group/src/generated/models/enums_serde.rs b/packages/typespec-rust/test/spector/client/structure/two-operation-group/src/client/structure/service/generated/models/enums_serde.rs similarity index 100% rename from packages/typespec-rust/test/spector/client/structure/two-operation-group/src/generated/models/enums_serde.rs rename to packages/typespec-rust/test/spector/client/structure/two-operation-group/src/client/structure/service/generated/models/enums_serde.rs diff --git a/packages/typespec-rust/test/spector/client/structure/two-operation-group/src/client/structure/service/generated/models/mod.rs b/packages/typespec-rust/test/spector/client/structure/two-operation-group/src/client/structure/service/generated/models/mod.rs new file mode 100644 index 000000000..f2c583f3a --- /dev/null +++ b/packages/typespec-rust/test/spector/client/structure/two-operation-group/src/client/structure/service/generated/models/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod enums; +mod enums_impl; +mod enums_serde; +pub use enums::*; diff --git a/packages/typespec-rust/test/spector/client/structure/two-operation-group/src/client/structure/service/mod.rs b/packages/typespec-rust/test/spector/client/structure/two-operation-group/src/client/structure/service/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/client/structure/two-operation-group/src/client/structure/service/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/client/structure/two-operation-group/src/generated/clients/two_operation_group_client.rs b/packages/typespec-rust/test/spector/client/structure/two-operation-group/src/generated/clients/two_operation_group_client.rs index b5fee7438..5a5249937 100644 --- a/packages/typespec-rust/test/spector/client/structure/two-operation-group/src/generated/clients/two_operation_group_client.rs +++ b/packages/typespec-rust/test/spector/client/structure/two-operation-group/src/generated/clients/two_operation_group_client.rs @@ -3,9 +3,9 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::{ - clients::{TwoOperationGroupGroup1Client, TwoOperationGroupGroup2Client}, - models::ClientType, +use crate::{ + client::structure::service::models::ClientType, + generated::clients::{TwoOperationGroupGroup1Client, TwoOperationGroupGroup2Client}, }; use azure_core::{ fmt::SafeDebug, diff --git a/packages/typespec-rust/test/spector/client/structure/two-operation-group/src/generated/models/mod.rs b/packages/typespec-rust/test/spector/client/structure/two-operation-group/src/generated/models/mod.rs index 004f4c2d2..3e484b1ed 100644 --- a/packages/typespec-rust/test/spector/client/structure/two-operation-group/src/generated/models/mod.rs +++ b/packages/typespec-rust/test/spector/client/structure/two-operation-group/src/generated/models/mod.rs @@ -3,9 +3,5 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -mod enums; -mod enums_impl; -mod enums_serde; mod method_options; -pub use enums::*; pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/client/structure/two-operation-group/src/lib.rs b/packages/typespec-rust/test/spector/client/structure/two-operation-group/src/lib.rs index cc784e401..1afbcfc80 100644 --- a/packages/typespec-rust/test/spector/client/structure/two-operation-group/src/lib.rs +++ b/packages/typespec-rust/test/spector/client/structure/two-operation-group/src/lib.rs @@ -7,3 +7,4 @@ mod generated; pub use generated::*; +pub mod client; diff --git a/packages/typespec-rust/test/spector/client/structure/two-operation-group/tests/two_operation_group_group1_client_test.rs b/packages/typespec-rust/test/spector/client/structure/two-operation-group/tests/two_operation_group_group1_client_test.rs index af564a66d..c0e53d0cf 100644 --- a/packages/typespec-rust/test/spector/client/structure/two-operation-group/tests/two_operation_group_group1_client_test.rs +++ b/packages/typespec-rust/test/spector/client/structure/two-operation-group/tests/two_operation_group_group1_client_test.rs @@ -2,7 +2,7 @@ // // Licensed under the MIT License. See License.txt in the project root for license information. -use spector_twoop::{models::ClientType, TwoOperationGroupClient}; +use spector_twoop::{client::structure::service::models::ClientType, TwoOperationGroupClient}; #[tokio::test] async fn four() { diff --git a/packages/typespec-rust/test/spector/client/structure/two-operation-group/tests/two_operation_group_group2_client_test.rs b/packages/typespec-rust/test/spector/client/structure/two-operation-group/tests/two_operation_group_group2_client_test.rs index a34a57575..a26f1efb6 100644 --- a/packages/typespec-rust/test/spector/client/structure/two-operation-group/tests/two_operation_group_group2_client_test.rs +++ b/packages/typespec-rust/test/spector/client/structure/two-operation-group/tests/two_operation_group_group2_client_test.rs @@ -2,7 +2,7 @@ // // Licensed under the MIT License. See License.txt in the project root for license information. -use spector_twoop::{models::ClientType, TwoOperationGroupClient}; +use spector_twoop::{client::structure::service::models::ClientType, TwoOperationGroupClient}; #[tokio::test] async fn five() { diff --git a/packages/typespec-rust/test/spector/encode/bytes/src/generated/clients/bytes_client.rs b/packages/typespec-rust/test/spector/encode/bytes/src/generated/clients/bytes_client.rs index a0e29bc27..4fd6facab 100644 --- a/packages/typespec-rust/test/spector/encode/bytes/src/generated/clients/bytes_client.rs +++ b/packages/typespec-rust/test/spector/encode/bytes/src/generated/clients/bytes_client.rs @@ -3,9 +3,10 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::clients::{ - BytesHeaderClient, BytesPropertyClient, BytesQueryClient, BytesRequestBodyClient, - BytesResponseBodyClient, +use crate::{ + header::clients::BytesHeaderClient, property::clients::BytesPropertyClient, + query::clients::BytesQueryClient, request_body::clients::BytesRequestBodyClient, + response_body::clients::BytesResponseBodyClient, }; use azure_core::{ fmt::SafeDebug, diff --git a/packages/typespec-rust/test/spector/encode/bytes/src/generated/clients/mod.rs b/packages/typespec-rust/test/spector/encode/bytes/src/generated/clients/mod.rs index 5e2f0334a..a73efc478 100644 --- a/packages/typespec-rust/test/spector/encode/bytes/src/generated/clients/mod.rs +++ b/packages/typespec-rust/test/spector/encode/bytes/src/generated/clients/mod.rs @@ -4,14 +4,4 @@ // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. mod bytes_client; -mod bytes_header_client; -mod bytes_property_client; -mod bytes_query_client; -mod bytes_request_body_client; -mod bytes_response_body_client; pub use bytes_client::*; -pub use bytes_header_client::*; -pub use bytes_property_client::*; -pub use bytes_query_client::*; -pub use bytes_request_body_client::*; -pub use bytes_response_body_client::*; diff --git a/packages/typespec-rust/test/spector/encode/bytes/src/generated/models/method_options.rs b/packages/typespec-rust/test/spector/encode/bytes/src/generated/models/method_options.rs deleted file mode 100644 index 08a739f52..000000000 --- a/packages/typespec-rust/test/spector/encode/bytes/src/generated/models/method_options.rs +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// -// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. - -use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; - -/// Options to be passed to [`BytesHeaderClient::base64()`](crate::generated::clients::BytesHeaderClient::base64()) -#[derive(Clone, Default, SafeDebug)] -pub struct BytesHeaderClientBase64Options<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`BytesHeaderClient::base64_url()`](crate::generated::clients::BytesHeaderClient::base64_url()) -#[derive(Clone, Default, SafeDebug)] -pub struct BytesHeaderClientBase64UrlOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`BytesHeaderClient::base64_url_array()`](crate::generated::clients::BytesHeaderClient::base64_url_array()) -#[derive(Clone, Default, SafeDebug)] -pub struct BytesHeaderClientBase64UrlArrayOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`BytesHeaderClient::default()`](crate::generated::clients::BytesHeaderClient::default()) -#[derive(Clone, Default, SafeDebug)] -pub struct BytesHeaderClientDefaultOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`BytesPropertyClient::base64()`](crate::generated::clients::BytesPropertyClient::base64()) -#[derive(Clone, Default, SafeDebug)] -pub struct BytesPropertyClientBase64Options<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`BytesPropertyClient::base64_url()`](crate::generated::clients::BytesPropertyClient::base64_url()) -#[derive(Clone, Default, SafeDebug)] -pub struct BytesPropertyClientBase64UrlOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`BytesPropertyClient::base64_url_array()`](crate::generated::clients::BytesPropertyClient::base64_url_array()) -#[derive(Clone, Default, SafeDebug)] -pub struct BytesPropertyClientBase64UrlArrayOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`BytesPropertyClient::default()`](crate::generated::clients::BytesPropertyClient::default()) -#[derive(Clone, Default, SafeDebug)] -pub struct BytesPropertyClientDefaultOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`BytesQueryClient::base64()`](crate::generated::clients::BytesQueryClient::base64()) -#[derive(Clone, Default, SafeDebug)] -pub struct BytesQueryClientBase64Options<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`BytesQueryClient::base64_url()`](crate::generated::clients::BytesQueryClient::base64_url()) -#[derive(Clone, Default, SafeDebug)] -pub struct BytesQueryClientBase64UrlOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`BytesQueryClient::base64_url_array()`](crate::generated::clients::BytesQueryClient::base64_url_array()) -#[derive(Clone, Default, SafeDebug)] -pub struct BytesQueryClientBase64UrlArrayOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`BytesQueryClient::default()`](crate::generated::clients::BytesQueryClient::default()) -#[derive(Clone, Default, SafeDebug)] -pub struct BytesQueryClientDefaultOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`BytesRequestBodyClient::base64()`](crate::generated::clients::BytesRequestBodyClient::base64()) -#[derive(Clone, Default, SafeDebug)] -pub struct BytesRequestBodyClientBase64Options<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`BytesRequestBodyClient::base64_url()`](crate::generated::clients::BytesRequestBodyClient::base64_url()) -#[derive(Clone, Default, SafeDebug)] -pub struct BytesRequestBodyClientBase64UrlOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`BytesRequestBodyClient::custom_content_type()`](crate::generated::clients::BytesRequestBodyClient::custom_content_type()) -#[derive(Clone, Default, SafeDebug)] -pub struct BytesRequestBodyClientCustomContentTypeOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`BytesRequestBodyClient::default()`](crate::generated::clients::BytesRequestBodyClient::default()) -#[derive(Clone, Default, SafeDebug)] -pub struct BytesRequestBodyClientDefaultOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`BytesRequestBodyClient::octet_stream()`](crate::generated::clients::BytesRequestBodyClient::octet_stream()) -#[derive(Clone, Default, SafeDebug)] -pub struct BytesRequestBodyClientOctetStreamOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`BytesResponseBodyClient::base64()`](crate::generated::clients::BytesResponseBodyClient::base64()) -#[derive(Clone, Default, SafeDebug)] -pub struct BytesResponseBodyClientBase64Options<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`BytesResponseBodyClient::base64_url()`](crate::generated::clients::BytesResponseBodyClient::base64_url()) -#[derive(Clone, Default, SafeDebug)] -pub struct BytesResponseBodyClientBase64UrlOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`BytesResponseBodyClient::custom_content_type()`](crate::generated::clients::BytesResponseBodyClient::custom_content_type()) -#[derive(Clone, Default, SafeDebug)] -pub struct BytesResponseBodyClientCustomContentTypeOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`BytesResponseBodyClient::default()`](crate::generated::clients::BytesResponseBodyClient::default()) -#[derive(Clone, Default, SafeDebug)] -pub struct BytesResponseBodyClientDefaultOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`BytesResponseBodyClient::octet_stream()`](crate::generated::clients::BytesResponseBodyClient::octet_stream()) -#[derive(Clone, Default, SafeDebug)] -pub struct BytesResponseBodyClientOctetStreamOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} diff --git a/packages/typespec-rust/test/spector/encode/bytes/src/generated/models/mod.rs b/packages/typespec-rust/test/spector/encode/bytes/src/generated/models/mod.rs index 383b0e962..8db5f198b 100644 --- a/packages/typespec-rust/test/spector/encode/bytes/src/generated/models/mod.rs +++ b/packages/typespec-rust/test/spector/encode/bytes/src/generated/models/mod.rs @@ -3,10 +3,8 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -mod method_options; #[allow(clippy::module_inception)] mod models; mod models_impl; mod models_serde; -pub use method_options::*; pub use models::*; diff --git a/packages/typespec-rust/test/spector/encode/bytes/src/generated/clients/bytes_header_client.rs b/packages/typespec-rust/test/spector/encode/bytes/src/header/generated/clients/bytes_header_client.rs similarity index 99% rename from packages/typespec-rust/test/spector/encode/bytes/src/generated/clients/bytes_header_client.rs rename to packages/typespec-rust/test/spector/encode/bytes/src/header/generated/clients/bytes_header_client.rs index eb3308c34..0e2df9f74 100644 --- a/packages/typespec-rust/test/spector/encode/bytes/src/generated/clients/bytes_header_client.rs +++ b/packages/typespec-rust/test/spector/encode/bytes/src/header/generated/clients/bytes_header_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::header::generated::models::{ BytesHeaderClientBase64Options, BytesHeaderClientBase64UrlArrayOptions, BytesHeaderClientBase64UrlOptions, BytesHeaderClientDefaultOptions, }; diff --git a/packages/typespec-rust/test/spector/encode/bytes/src/header/generated/clients/mod.rs b/packages/typespec-rust/test/spector/encode/bytes/src/header/generated/clients/mod.rs new file mode 100644 index 000000000..783688bef --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/bytes/src/header/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod bytes_header_client; +pub use bytes_header_client::*; diff --git a/packages/typespec-rust/test/spector/encode/bytes/src/header/generated/mod.rs b/packages/typespec-rust/test/spector/encode/bytes/src/header/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/bytes/src/header/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/encode/bytes/src/header/generated/models/method_options.rs b/packages/typespec-rust/test/spector/encode/bytes/src/header/generated/models/method_options.rs new file mode 100644 index 000000000..2f1578514 --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/bytes/src/header/generated/models/method_options.rs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`BytesHeaderClient::base64()`](crate::header::generated::clients::BytesHeaderClient::base64()) +#[derive(Clone, Default, SafeDebug)] +pub struct BytesHeaderClientBase64Options<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`BytesHeaderClient::base64_url()`](crate::header::generated::clients::BytesHeaderClient::base64_url()) +#[derive(Clone, Default, SafeDebug)] +pub struct BytesHeaderClientBase64UrlOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`BytesHeaderClient::base64_url_array()`](crate::header::generated::clients::BytesHeaderClient::base64_url_array()) +#[derive(Clone, Default, SafeDebug)] +pub struct BytesHeaderClientBase64UrlArrayOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`BytesHeaderClient::default()`](crate::header::generated::clients::BytesHeaderClient::default()) +#[derive(Clone, Default, SafeDebug)] +pub struct BytesHeaderClientDefaultOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/encode/bytes/src/header/generated/models/mod.rs b/packages/typespec-rust/test/spector/encode/bytes/src/header/generated/models/mod.rs new file mode 100644 index 000000000..3e484b1ed --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/bytes/src/header/generated/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/encode/bytes/src/header/mod.rs b/packages/typespec-rust/test/spector/encode/bytes/src/header/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/bytes/src/header/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/encode/bytes/src/lib.rs b/packages/typespec-rust/test/spector/encode/bytes/src/lib.rs index cc784e401..38562fa5a 100644 --- a/packages/typespec-rust/test/spector/encode/bytes/src/lib.rs +++ b/packages/typespec-rust/test/spector/encode/bytes/src/lib.rs @@ -7,3 +7,8 @@ mod generated; pub use generated::*; +pub mod header; +pub mod property; +pub mod query; +pub mod request_body; +pub mod response_body; diff --git a/packages/typespec-rust/test/spector/encode/bytes/src/generated/clients/bytes_property_client.rs b/packages/typespec-rust/test/spector/encode/bytes/src/property/generated/clients/bytes_property_client.rs similarity index 93% rename from packages/typespec-rust/test/spector/encode/bytes/src/generated/clients/bytes_property_client.rs rename to packages/typespec-rust/test/spector/encode/bytes/src/property/generated/clients/bytes_property_client.rs index bdc36a475..ab9ea50d2 100644 --- a/packages/typespec-rust/test/spector/encode/bytes/src/generated/clients/bytes_property_client.rs +++ b/packages/typespec-rust/test/spector/encode/bytes/src/property/generated/clients/bytes_property_client.rs @@ -3,10 +3,15 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ - Base64BytesProperty, Base64urlArrayBytesProperty, Base64urlBytesProperty, - BytesPropertyClientBase64Options, BytesPropertyClientBase64UrlArrayOptions, - BytesPropertyClientBase64UrlOptions, BytesPropertyClientDefaultOptions, DefaultBytesProperty, +use crate::{ + models::{ + Base64BytesProperty, Base64urlArrayBytesProperty, Base64urlBytesProperty, + DefaultBytesProperty, + }, + property::generated::models::{ + BytesPropertyClientBase64Options, BytesPropertyClientBase64UrlArrayOptions, + BytesPropertyClientBase64UrlOptions, BytesPropertyClientDefaultOptions, + }, }; use azure_core::{ error::CheckSuccessOptions, diff --git a/packages/typespec-rust/test/spector/encode/bytes/src/property/generated/clients/mod.rs b/packages/typespec-rust/test/spector/encode/bytes/src/property/generated/clients/mod.rs new file mode 100644 index 000000000..df29b6c81 --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/bytes/src/property/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod bytes_property_client; +pub use bytes_property_client::*; diff --git a/packages/typespec-rust/test/spector/encode/bytes/src/property/generated/mod.rs b/packages/typespec-rust/test/spector/encode/bytes/src/property/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/bytes/src/property/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/encode/bytes/src/property/generated/models/method_options.rs b/packages/typespec-rust/test/spector/encode/bytes/src/property/generated/models/method_options.rs new file mode 100644 index 000000000..ce354e949 --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/bytes/src/property/generated/models/method_options.rs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`BytesPropertyClient::base64()`](crate::property::generated::clients::BytesPropertyClient::base64()) +#[derive(Clone, Default, SafeDebug)] +pub struct BytesPropertyClientBase64Options<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`BytesPropertyClient::base64_url()`](crate::property::generated::clients::BytesPropertyClient::base64_url()) +#[derive(Clone, Default, SafeDebug)] +pub struct BytesPropertyClientBase64UrlOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`BytesPropertyClient::base64_url_array()`](crate::property::generated::clients::BytesPropertyClient::base64_url_array()) +#[derive(Clone, Default, SafeDebug)] +pub struct BytesPropertyClientBase64UrlArrayOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`BytesPropertyClient::default()`](crate::property::generated::clients::BytesPropertyClient::default()) +#[derive(Clone, Default, SafeDebug)] +pub struct BytesPropertyClientDefaultOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/encode/bytes/src/property/generated/models/mod.rs b/packages/typespec-rust/test/spector/encode/bytes/src/property/generated/models/mod.rs new file mode 100644 index 000000000..3e484b1ed --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/bytes/src/property/generated/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/encode/bytes/src/property/mod.rs b/packages/typespec-rust/test/spector/encode/bytes/src/property/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/bytes/src/property/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/encode/bytes/src/generated/clients/bytes_query_client.rs b/packages/typespec-rust/test/spector/encode/bytes/src/query/generated/clients/bytes_query_client.rs similarity index 99% rename from packages/typespec-rust/test/spector/encode/bytes/src/generated/clients/bytes_query_client.rs rename to packages/typespec-rust/test/spector/encode/bytes/src/query/generated/clients/bytes_query_client.rs index 085d2d836..4cdf8cb94 100644 --- a/packages/typespec-rust/test/spector/encode/bytes/src/generated/clients/bytes_query_client.rs +++ b/packages/typespec-rust/test/spector/encode/bytes/src/query/generated/clients/bytes_query_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::query::generated::models::{ BytesQueryClientBase64Options, BytesQueryClientBase64UrlArrayOptions, BytesQueryClientBase64UrlOptions, BytesQueryClientDefaultOptions, }; diff --git a/packages/typespec-rust/test/spector/encode/bytes/src/query/generated/clients/mod.rs b/packages/typespec-rust/test/spector/encode/bytes/src/query/generated/clients/mod.rs new file mode 100644 index 000000000..0a8c19031 --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/bytes/src/query/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod bytes_query_client; +pub use bytes_query_client::*; diff --git a/packages/typespec-rust/test/spector/encode/bytes/src/query/generated/mod.rs b/packages/typespec-rust/test/spector/encode/bytes/src/query/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/bytes/src/query/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/encode/bytes/src/query/generated/models/method_options.rs b/packages/typespec-rust/test/spector/encode/bytes/src/query/generated/models/method_options.rs new file mode 100644 index 000000000..a4448f384 --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/bytes/src/query/generated/models/method_options.rs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`BytesQueryClient::base64()`](crate::query::generated::clients::BytesQueryClient::base64()) +#[derive(Clone, Default, SafeDebug)] +pub struct BytesQueryClientBase64Options<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`BytesQueryClient::base64_url()`](crate::query::generated::clients::BytesQueryClient::base64_url()) +#[derive(Clone, Default, SafeDebug)] +pub struct BytesQueryClientBase64UrlOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`BytesQueryClient::base64_url_array()`](crate::query::generated::clients::BytesQueryClient::base64_url_array()) +#[derive(Clone, Default, SafeDebug)] +pub struct BytesQueryClientBase64UrlArrayOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`BytesQueryClient::default()`](crate::query::generated::clients::BytesQueryClient::default()) +#[derive(Clone, Default, SafeDebug)] +pub struct BytesQueryClientDefaultOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/encode/bytes/src/query/generated/models/mod.rs b/packages/typespec-rust/test/spector/encode/bytes/src/query/generated/models/mod.rs new file mode 100644 index 000000000..3e484b1ed --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/bytes/src/query/generated/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/encode/bytes/src/query/mod.rs b/packages/typespec-rust/test/spector/encode/bytes/src/query/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/bytes/src/query/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/encode/bytes/src/generated/clients/bytes_request_body_client.rs b/packages/typespec-rust/test/spector/encode/bytes/src/request_body/generated/clients/bytes_request_body_client.rs similarity index 99% rename from packages/typespec-rust/test/spector/encode/bytes/src/generated/clients/bytes_request_body_client.rs rename to packages/typespec-rust/test/spector/encode/bytes/src/request_body/generated/clients/bytes_request_body_client.rs index 266ea3cc7..1c2e5badb 100644 --- a/packages/typespec-rust/test/spector/encode/bytes/src/generated/clients/bytes_request_body_client.rs +++ b/packages/typespec-rust/test/spector/encode/bytes/src/request_body/generated/clients/bytes_request_body_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::request_body::generated::models::{ BytesRequestBodyClientBase64Options, BytesRequestBodyClientBase64UrlOptions, BytesRequestBodyClientCustomContentTypeOptions, BytesRequestBodyClientDefaultOptions, BytesRequestBodyClientOctetStreamOptions, diff --git a/packages/typespec-rust/test/spector/encode/bytes/src/request_body/generated/clients/mod.rs b/packages/typespec-rust/test/spector/encode/bytes/src/request_body/generated/clients/mod.rs new file mode 100644 index 000000000..f33b8440d --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/bytes/src/request_body/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod bytes_request_body_client; +pub use bytes_request_body_client::*; diff --git a/packages/typespec-rust/test/spector/encode/bytes/src/request_body/generated/mod.rs b/packages/typespec-rust/test/spector/encode/bytes/src/request_body/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/bytes/src/request_body/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/encode/bytes/src/request_body/generated/models/method_options.rs b/packages/typespec-rust/test/spector/encode/bytes/src/request_body/generated/models/method_options.rs new file mode 100644 index 000000000..330b545d6 --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/bytes/src/request_body/generated/models/method_options.rs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`BytesRequestBodyClient::base64()`](crate::request_body::generated::clients::BytesRequestBodyClient::base64()) +#[derive(Clone, Default, SafeDebug)] +pub struct BytesRequestBodyClientBase64Options<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`BytesRequestBodyClient::base64_url()`](crate::request_body::generated::clients::BytesRequestBodyClient::base64_url()) +#[derive(Clone, Default, SafeDebug)] +pub struct BytesRequestBodyClientBase64UrlOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`BytesRequestBodyClient::custom_content_type()`](crate::request_body::generated::clients::BytesRequestBodyClient::custom_content_type()) +#[derive(Clone, Default, SafeDebug)] +pub struct BytesRequestBodyClientCustomContentTypeOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`BytesRequestBodyClient::default()`](crate::request_body::generated::clients::BytesRequestBodyClient::default()) +#[derive(Clone, Default, SafeDebug)] +pub struct BytesRequestBodyClientDefaultOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`BytesRequestBodyClient::octet_stream()`](crate::request_body::generated::clients::BytesRequestBodyClient::octet_stream()) +#[derive(Clone, Default, SafeDebug)] +pub struct BytesRequestBodyClientOctetStreamOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/encode/bytes/src/request_body/generated/models/mod.rs b/packages/typespec-rust/test/spector/encode/bytes/src/request_body/generated/models/mod.rs new file mode 100644 index 000000000..3e484b1ed --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/bytes/src/request_body/generated/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/encode/bytes/src/request_body/mod.rs b/packages/typespec-rust/test/spector/encode/bytes/src/request_body/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/bytes/src/request_body/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/encode/bytes/src/generated/clients/bytes_response_body_client.rs b/packages/typespec-rust/test/spector/encode/bytes/src/response_body/generated/clients/bytes_response_body_client.rs similarity index 99% rename from packages/typespec-rust/test/spector/encode/bytes/src/generated/clients/bytes_response_body_client.rs rename to packages/typespec-rust/test/spector/encode/bytes/src/response_body/generated/clients/bytes_response_body_client.rs index 2c3551451..14030439b 100644 --- a/packages/typespec-rust/test/spector/encode/bytes/src/generated/clients/bytes_response_body_client.rs +++ b/packages/typespec-rust/test/spector/encode/bytes/src/response_body/generated/clients/bytes_response_body_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::response_body::generated::models::{ BytesResponseBodyClientBase64Options, BytesResponseBodyClientBase64UrlOptions, BytesResponseBodyClientCustomContentTypeOptions, BytesResponseBodyClientDefaultOptions, BytesResponseBodyClientOctetStreamOptions, diff --git a/packages/typespec-rust/test/spector/encode/bytes/src/response_body/generated/clients/mod.rs b/packages/typespec-rust/test/spector/encode/bytes/src/response_body/generated/clients/mod.rs new file mode 100644 index 000000000..9698d9832 --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/bytes/src/response_body/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod bytes_response_body_client; +pub use bytes_response_body_client::*; diff --git a/packages/typespec-rust/test/spector/encode/bytes/src/response_body/generated/mod.rs b/packages/typespec-rust/test/spector/encode/bytes/src/response_body/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/bytes/src/response_body/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/encode/bytes/src/response_body/generated/models/method_options.rs b/packages/typespec-rust/test/spector/encode/bytes/src/response_body/generated/models/method_options.rs new file mode 100644 index 000000000..cdc9a8a53 --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/bytes/src/response_body/generated/models/method_options.rs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`BytesResponseBodyClient::base64()`](crate::response_body::generated::clients::BytesResponseBodyClient::base64()) +#[derive(Clone, Default, SafeDebug)] +pub struct BytesResponseBodyClientBase64Options<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`BytesResponseBodyClient::base64_url()`](crate::response_body::generated::clients::BytesResponseBodyClient::base64_url()) +#[derive(Clone, Default, SafeDebug)] +pub struct BytesResponseBodyClientBase64UrlOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`BytesResponseBodyClient::custom_content_type()`](crate::response_body::generated::clients::BytesResponseBodyClient::custom_content_type()) +#[derive(Clone, Default, SafeDebug)] +pub struct BytesResponseBodyClientCustomContentTypeOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`BytesResponseBodyClient::default()`](crate::response_body::generated::clients::BytesResponseBodyClient::default()) +#[derive(Clone, Default, SafeDebug)] +pub struct BytesResponseBodyClientDefaultOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`BytesResponseBodyClient::octet_stream()`](crate::response_body::generated::clients::BytesResponseBodyClient::octet_stream()) +#[derive(Clone, Default, SafeDebug)] +pub struct BytesResponseBodyClientOctetStreamOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/encode/bytes/src/response_body/generated/models/mod.rs b/packages/typespec-rust/test/spector/encode/bytes/src/response_body/generated/models/mod.rs new file mode 100644 index 000000000..3e484b1ed --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/bytes/src/response_body/generated/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/encode/bytes/src/response_body/mod.rs b/packages/typespec-rust/test/spector/encode/bytes/src/response_body/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/bytes/src/response_body/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/encode/datetime/src/generated/clients/datetime_client.rs b/packages/typespec-rust/test/spector/encode/datetime/src/generated/clients/datetime_client.rs index 44f6d4753..d98926d4f 100644 --- a/packages/typespec-rust/test/spector/encode/datetime/src/generated/clients/datetime_client.rs +++ b/packages/typespec-rust/test/spector/encode/datetime/src/generated/clients/datetime_client.rs @@ -3,8 +3,9 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::clients::{ - DatetimeHeaderClient, DatetimePropertyClient, DatetimeQueryClient, DatetimeResponseHeaderClient, +use crate::{ + header::clients::DatetimeHeaderClient, property::clients::DatetimePropertyClient, + query::clients::DatetimeQueryClient, response_header::clients::DatetimeResponseHeaderClient, }; use azure_core::{ fmt::SafeDebug, diff --git a/packages/typespec-rust/test/spector/encode/datetime/src/generated/clients/mod.rs b/packages/typespec-rust/test/spector/encode/datetime/src/generated/clients/mod.rs index eab83900b..8c02dbd0e 100644 --- a/packages/typespec-rust/test/spector/encode/datetime/src/generated/clients/mod.rs +++ b/packages/typespec-rust/test/spector/encode/datetime/src/generated/clients/mod.rs @@ -4,12 +4,4 @@ // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. mod datetime_client; -mod datetime_header_client; -mod datetime_property_client; -mod datetime_query_client; -mod datetime_response_header_client; pub use datetime_client::*; -pub use datetime_header_client::*; -pub use datetime_property_client::*; -pub use datetime_query_client::*; -pub use datetime_response_header_client::*; diff --git a/packages/typespec-rust/test/spector/encode/datetime/src/generated/models/method_options.rs b/packages/typespec-rust/test/spector/encode/datetime/src/generated/models/method_options.rs deleted file mode 100644 index dfe986830..000000000 --- a/packages/typespec-rust/test/spector/encode/datetime/src/generated/models/method_options.rs +++ /dev/null @@ -1,139 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// -// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. - -use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; - -/// Options to be passed to [`DatetimeHeaderClient::default()`](crate::generated::clients::DatetimeHeaderClient::default()) -#[derive(Clone, Default, SafeDebug)] -pub struct DatetimeHeaderClientDefaultOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DatetimeHeaderClient::rfc3339()`](crate::generated::clients::DatetimeHeaderClient::rfc3339()) -#[derive(Clone, Default, SafeDebug)] -pub struct DatetimeHeaderClientRfc3339Options<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DatetimeHeaderClient::rfc7231()`](crate::generated::clients::DatetimeHeaderClient::rfc7231()) -#[derive(Clone, Default, SafeDebug)] -pub struct DatetimeHeaderClientRfc7231Options<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DatetimeHeaderClient::unix_timestamp()`](crate::generated::clients::DatetimeHeaderClient::unix_timestamp()) -#[derive(Clone, Default, SafeDebug)] -pub struct DatetimeHeaderClientUnixTimestampOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DatetimeHeaderClient::unix_timestamp_array()`](crate::generated::clients::DatetimeHeaderClient::unix_timestamp_array()) -#[derive(Clone, Default, SafeDebug)] -pub struct DatetimeHeaderClientUnixTimestampArrayOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DatetimePropertyClient::default()`](crate::generated::clients::DatetimePropertyClient::default()) -#[derive(Clone, Default, SafeDebug)] -pub struct DatetimePropertyClientDefaultOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DatetimePropertyClient::rfc3339()`](crate::generated::clients::DatetimePropertyClient::rfc3339()) -#[derive(Clone, Default, SafeDebug)] -pub struct DatetimePropertyClientRfc3339Options<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DatetimePropertyClient::rfc7231()`](crate::generated::clients::DatetimePropertyClient::rfc7231()) -#[derive(Clone, Default, SafeDebug)] -pub struct DatetimePropertyClientRfc7231Options<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DatetimePropertyClient::unix_timestamp()`](crate::generated::clients::DatetimePropertyClient::unix_timestamp()) -#[derive(Clone, Default, SafeDebug)] -pub struct DatetimePropertyClientUnixTimestampOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DatetimePropertyClient::unix_timestamp_array()`](crate::generated::clients::DatetimePropertyClient::unix_timestamp_array()) -#[derive(Clone, Default, SafeDebug)] -pub struct DatetimePropertyClientUnixTimestampArrayOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DatetimeQueryClient::default()`](crate::generated::clients::DatetimeQueryClient::default()) -#[derive(Clone, Default, SafeDebug)] -pub struct DatetimeQueryClientDefaultOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DatetimeQueryClient::rfc3339()`](crate::generated::clients::DatetimeQueryClient::rfc3339()) -#[derive(Clone, Default, SafeDebug)] -pub struct DatetimeQueryClientRfc3339Options<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DatetimeQueryClient::rfc7231()`](crate::generated::clients::DatetimeQueryClient::rfc7231()) -#[derive(Clone, Default, SafeDebug)] -pub struct DatetimeQueryClientRfc7231Options<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DatetimeQueryClient::unix_timestamp()`](crate::generated::clients::DatetimeQueryClient::unix_timestamp()) -#[derive(Clone, Default, SafeDebug)] -pub struct DatetimeQueryClientUnixTimestampOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DatetimeQueryClient::unix_timestamp_array()`](crate::generated::clients::DatetimeQueryClient::unix_timestamp_array()) -#[derive(Clone, Default, SafeDebug)] -pub struct DatetimeQueryClientUnixTimestampArrayOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DatetimeResponseHeaderClient::default()`](crate::generated::clients::DatetimeResponseHeaderClient::default()) -#[derive(Clone, Default, SafeDebug)] -pub struct DatetimeResponseHeaderClientDefaultOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DatetimeResponseHeaderClient::rfc3339()`](crate::generated::clients::DatetimeResponseHeaderClient::rfc3339()) -#[derive(Clone, Default, SafeDebug)] -pub struct DatetimeResponseHeaderClientRfc3339Options<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DatetimeResponseHeaderClient::rfc7231()`](crate::generated::clients::DatetimeResponseHeaderClient::rfc7231()) -#[derive(Clone, Default, SafeDebug)] -pub struct DatetimeResponseHeaderClientRfc7231Options<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DatetimeResponseHeaderClient::unix_timestamp()`](crate::generated::clients::DatetimeResponseHeaderClient::unix_timestamp()) -#[derive(Clone, Default, SafeDebug)] -pub struct DatetimeResponseHeaderClientUnixTimestampOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} diff --git a/packages/typespec-rust/test/spector/encode/datetime/src/generated/models/mod.rs b/packages/typespec-rust/test/spector/encode/datetime/src/generated/models/mod.rs index 304e44867..8db5f198b 100644 --- a/packages/typespec-rust/test/spector/encode/datetime/src/generated/models/mod.rs +++ b/packages/typespec-rust/test/spector/encode/datetime/src/generated/models/mod.rs @@ -3,12 +3,8 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -mod header_traits; -mod method_options; #[allow(clippy::module_inception)] mod models; mod models_impl; mod models_serde; -pub use header_traits::*; -pub use method_options::*; pub use models::*; diff --git a/packages/typespec-rust/test/spector/encode/datetime/src/generated/models/models.rs b/packages/typespec-rust/test/spector/encode/datetime/src/generated/models/models.rs index 10c78e789..2b25dc85d 100644 --- a/packages/typespec-rust/test/spector/encode/datetime/src/generated/models/models.rs +++ b/packages/typespec-rust/test/spector/encode/datetime/src/generated/models/models.rs @@ -7,22 +7,6 @@ use super::models_serde; use azure_core::{fmt::SafeDebug, time::OffsetDateTime}; use serde::{Deserialize, Serialize}; -/// Contains results for [`DatetimeResponseHeaderClient::default()`](crate::generated::clients::DatetimeResponseHeaderClient::default()) -#[derive(SafeDebug)] -pub struct DatetimeResponseHeaderClientDefaultResult; - -/// Contains results for [`DatetimeResponseHeaderClient::rfc3339()`](crate::generated::clients::DatetimeResponseHeaderClient::rfc3339()) -#[derive(SafeDebug)] -pub struct DatetimeResponseHeaderClientRfc3339Result; - -/// Contains results for [`DatetimeResponseHeaderClient::rfc7231()`](crate::generated::clients::DatetimeResponseHeaderClient::rfc7231()) -#[derive(SafeDebug)] -pub struct DatetimeResponseHeaderClientRfc7231Result; - -/// Contains results for [`DatetimeResponseHeaderClient::unix_timestamp()`](crate::generated::clients::DatetimeResponseHeaderClient::unix_timestamp()) -#[derive(SafeDebug)] -pub struct DatetimeResponseHeaderClientUnixTimestampResult; - #[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] pub struct DefaultDatetimeProperty { #[serde( diff --git a/packages/typespec-rust/test/spector/encode/datetime/src/generated/clients/datetime_header_client.rs b/packages/typespec-rust/test/spector/encode/datetime/src/header/generated/clients/datetime_header_client.rs similarity index 99% rename from packages/typespec-rust/test/spector/encode/datetime/src/generated/clients/datetime_header_client.rs rename to packages/typespec-rust/test/spector/encode/datetime/src/header/generated/clients/datetime_header_client.rs index e78c97f8d..ced7cc840 100644 --- a/packages/typespec-rust/test/spector/encode/datetime/src/generated/clients/datetime_header_client.rs +++ b/packages/typespec-rust/test/spector/encode/datetime/src/header/generated/clients/datetime_header_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::header::generated::models::{ DatetimeHeaderClientDefaultOptions, DatetimeHeaderClientRfc3339Options, DatetimeHeaderClientRfc7231Options, DatetimeHeaderClientUnixTimestampArrayOptions, DatetimeHeaderClientUnixTimestampOptions, diff --git a/packages/typespec-rust/test/spector/encode/datetime/src/header/generated/clients/mod.rs b/packages/typespec-rust/test/spector/encode/datetime/src/header/generated/clients/mod.rs new file mode 100644 index 000000000..cedfc87a6 --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/datetime/src/header/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod datetime_header_client; +pub use datetime_header_client::*; diff --git a/packages/typespec-rust/test/spector/encode/datetime/src/header/generated/mod.rs b/packages/typespec-rust/test/spector/encode/datetime/src/header/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/datetime/src/header/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/encode/datetime/src/header/generated/models/method_options.rs b/packages/typespec-rust/test/spector/encode/datetime/src/header/generated/models/method_options.rs new file mode 100644 index 000000000..7c0beeb47 --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/datetime/src/header/generated/models/method_options.rs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`DatetimeHeaderClient::default()`](crate::header::generated::clients::DatetimeHeaderClient::default()) +#[derive(Clone, Default, SafeDebug)] +pub struct DatetimeHeaderClientDefaultOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DatetimeHeaderClient::rfc3339()`](crate::header::generated::clients::DatetimeHeaderClient::rfc3339()) +#[derive(Clone, Default, SafeDebug)] +pub struct DatetimeHeaderClientRfc3339Options<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DatetimeHeaderClient::rfc7231()`](crate::header::generated::clients::DatetimeHeaderClient::rfc7231()) +#[derive(Clone, Default, SafeDebug)] +pub struct DatetimeHeaderClientRfc7231Options<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DatetimeHeaderClient::unix_timestamp()`](crate::header::generated::clients::DatetimeHeaderClient::unix_timestamp()) +#[derive(Clone, Default, SafeDebug)] +pub struct DatetimeHeaderClientUnixTimestampOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DatetimeHeaderClient::unix_timestamp_array()`](crate::header::generated::clients::DatetimeHeaderClient::unix_timestamp_array()) +#[derive(Clone, Default, SafeDebug)] +pub struct DatetimeHeaderClientUnixTimestampArrayOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/encode/datetime/src/header/generated/models/mod.rs b/packages/typespec-rust/test/spector/encode/datetime/src/header/generated/models/mod.rs new file mode 100644 index 000000000..3e484b1ed --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/datetime/src/header/generated/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/encode/datetime/src/header/mod.rs b/packages/typespec-rust/test/spector/encode/datetime/src/header/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/datetime/src/header/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/encode/datetime/src/lib.rs b/packages/typespec-rust/test/spector/encode/datetime/src/lib.rs index cc784e401..7b6ca9a4e 100644 --- a/packages/typespec-rust/test/spector/encode/datetime/src/lib.rs +++ b/packages/typespec-rust/test/spector/encode/datetime/src/lib.rs @@ -7,3 +7,7 @@ mod generated; pub use generated::*; +pub mod header; +pub mod property; +pub mod query; +pub mod response_header; diff --git a/packages/typespec-rust/test/spector/encode/datetime/src/generated/clients/datetime_property_client.rs b/packages/typespec-rust/test/spector/encode/datetime/src/property/generated/clients/datetime_property_client.rs similarity index 93% rename from packages/typespec-rust/test/spector/encode/datetime/src/generated/clients/datetime_property_client.rs rename to packages/typespec-rust/test/spector/encode/datetime/src/property/generated/clients/datetime_property_client.rs index e146a392f..82c560558 100644 --- a/packages/typespec-rust/test/spector/encode/datetime/src/generated/clients/datetime_property_client.rs +++ b/packages/typespec-rust/test/spector/encode/datetime/src/property/generated/clients/datetime_property_client.rs @@ -3,11 +3,16 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ - DatetimePropertyClientDefaultOptions, DatetimePropertyClientRfc3339Options, - DatetimePropertyClientRfc7231Options, DatetimePropertyClientUnixTimestampArrayOptions, - DatetimePropertyClientUnixTimestampOptions, DefaultDatetimeProperty, Rfc3339DatetimeProperty, - Rfc7231DatetimeProperty, UnixTimestampArrayDatetimeProperty, UnixTimestampDatetimeProperty, +use crate::{ + models::{ + DefaultDatetimeProperty, Rfc3339DatetimeProperty, Rfc7231DatetimeProperty, + UnixTimestampArrayDatetimeProperty, UnixTimestampDatetimeProperty, + }, + property::generated::models::{ + DatetimePropertyClientDefaultOptions, DatetimePropertyClientRfc3339Options, + DatetimePropertyClientRfc7231Options, DatetimePropertyClientUnixTimestampArrayOptions, + DatetimePropertyClientUnixTimestampOptions, + }, }; use azure_core::{ error::CheckSuccessOptions, diff --git a/packages/typespec-rust/test/spector/encode/datetime/src/property/generated/clients/mod.rs b/packages/typespec-rust/test/spector/encode/datetime/src/property/generated/clients/mod.rs new file mode 100644 index 000000000..172a66a3a --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/datetime/src/property/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod datetime_property_client; +pub use datetime_property_client::*; diff --git a/packages/typespec-rust/test/spector/encode/datetime/src/property/generated/mod.rs b/packages/typespec-rust/test/spector/encode/datetime/src/property/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/datetime/src/property/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/encode/datetime/src/property/generated/models/method_options.rs b/packages/typespec-rust/test/spector/encode/datetime/src/property/generated/models/method_options.rs new file mode 100644 index 000000000..9281d664c --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/datetime/src/property/generated/models/method_options.rs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`DatetimePropertyClient::default()`](crate::property::generated::clients::DatetimePropertyClient::default()) +#[derive(Clone, Default, SafeDebug)] +pub struct DatetimePropertyClientDefaultOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DatetimePropertyClient::rfc3339()`](crate::property::generated::clients::DatetimePropertyClient::rfc3339()) +#[derive(Clone, Default, SafeDebug)] +pub struct DatetimePropertyClientRfc3339Options<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DatetimePropertyClient::rfc7231()`](crate::property::generated::clients::DatetimePropertyClient::rfc7231()) +#[derive(Clone, Default, SafeDebug)] +pub struct DatetimePropertyClientRfc7231Options<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DatetimePropertyClient::unix_timestamp()`](crate::property::generated::clients::DatetimePropertyClient::unix_timestamp()) +#[derive(Clone, Default, SafeDebug)] +pub struct DatetimePropertyClientUnixTimestampOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DatetimePropertyClient::unix_timestamp_array()`](crate::property::generated::clients::DatetimePropertyClient::unix_timestamp_array()) +#[derive(Clone, Default, SafeDebug)] +pub struct DatetimePropertyClientUnixTimestampArrayOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/encode/datetime/src/property/generated/models/mod.rs b/packages/typespec-rust/test/spector/encode/datetime/src/property/generated/models/mod.rs new file mode 100644 index 000000000..3e484b1ed --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/datetime/src/property/generated/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/encode/datetime/src/property/mod.rs b/packages/typespec-rust/test/spector/encode/datetime/src/property/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/datetime/src/property/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/encode/datetime/src/generated/clients/datetime_query_client.rs b/packages/typespec-rust/test/spector/encode/datetime/src/query/generated/clients/datetime_query_client.rs similarity index 99% rename from packages/typespec-rust/test/spector/encode/datetime/src/generated/clients/datetime_query_client.rs rename to packages/typespec-rust/test/spector/encode/datetime/src/query/generated/clients/datetime_query_client.rs index 2c7c35512..0e0c5c99a 100644 --- a/packages/typespec-rust/test/spector/encode/datetime/src/generated/clients/datetime_query_client.rs +++ b/packages/typespec-rust/test/spector/encode/datetime/src/query/generated/clients/datetime_query_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::query::generated::models::{ DatetimeQueryClientDefaultOptions, DatetimeQueryClientRfc3339Options, DatetimeQueryClientRfc7231Options, DatetimeQueryClientUnixTimestampArrayOptions, DatetimeQueryClientUnixTimestampOptions, diff --git a/packages/typespec-rust/test/spector/encode/datetime/src/query/generated/clients/mod.rs b/packages/typespec-rust/test/spector/encode/datetime/src/query/generated/clients/mod.rs new file mode 100644 index 000000000..fa803a08c --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/datetime/src/query/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod datetime_query_client; +pub use datetime_query_client::*; diff --git a/packages/typespec-rust/test/spector/encode/datetime/src/query/generated/mod.rs b/packages/typespec-rust/test/spector/encode/datetime/src/query/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/datetime/src/query/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/encode/datetime/src/query/generated/models/method_options.rs b/packages/typespec-rust/test/spector/encode/datetime/src/query/generated/models/method_options.rs new file mode 100644 index 000000000..a0beff738 --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/datetime/src/query/generated/models/method_options.rs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`DatetimeQueryClient::default()`](crate::query::generated::clients::DatetimeQueryClient::default()) +#[derive(Clone, Default, SafeDebug)] +pub struct DatetimeQueryClientDefaultOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DatetimeQueryClient::rfc3339()`](crate::query::generated::clients::DatetimeQueryClient::rfc3339()) +#[derive(Clone, Default, SafeDebug)] +pub struct DatetimeQueryClientRfc3339Options<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DatetimeQueryClient::rfc7231()`](crate::query::generated::clients::DatetimeQueryClient::rfc7231()) +#[derive(Clone, Default, SafeDebug)] +pub struct DatetimeQueryClientRfc7231Options<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DatetimeQueryClient::unix_timestamp()`](crate::query::generated::clients::DatetimeQueryClient::unix_timestamp()) +#[derive(Clone, Default, SafeDebug)] +pub struct DatetimeQueryClientUnixTimestampOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DatetimeQueryClient::unix_timestamp_array()`](crate::query::generated::clients::DatetimeQueryClient::unix_timestamp_array()) +#[derive(Clone, Default, SafeDebug)] +pub struct DatetimeQueryClientUnixTimestampArrayOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/encode/datetime/src/query/generated/models/mod.rs b/packages/typespec-rust/test/spector/encode/datetime/src/query/generated/models/mod.rs new file mode 100644 index 000000000..3e484b1ed --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/datetime/src/query/generated/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/encode/datetime/src/query/mod.rs b/packages/typespec-rust/test/spector/encode/datetime/src/query/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/datetime/src/query/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/encode/datetime/src/generated/clients/datetime_response_header_client.rs b/packages/typespec-rust/test/spector/encode/datetime/src/response_header/generated/clients/datetime_response_header_client.rs similarity index 93% rename from packages/typespec-rust/test/spector/encode/datetime/src/generated/clients/datetime_response_header_client.rs rename to packages/typespec-rust/test/spector/encode/datetime/src/response_header/generated/clients/datetime_response_header_client.rs index 1bc465da3..8dfd8657d 100644 --- a/packages/typespec-rust/test/spector/encode/datetime/src/generated/clients/datetime_response_header_client.rs +++ b/packages/typespec-rust/test/spector/encode/datetime/src/response_header/generated/clients/datetime_response_header_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::response_header::generated::models::{ DatetimeResponseHeaderClientDefaultOptions, DatetimeResponseHeaderClientDefaultResult, DatetimeResponseHeaderClientRfc3339Options, DatetimeResponseHeaderClientRfc3339Result, DatetimeResponseHeaderClientRfc7231Options, DatetimeResponseHeaderClientRfc7231Result, @@ -40,7 +40,7 @@ impl DatetimeResponseHeaderClient { /// /// ```no_run /// use azure_core::{Result, http::{Response, NoFormat}}; - /// use spector_datetime::models::{DatetimeResponseHeaderClientDefaultResult, DatetimeResponseHeaderClientDefaultResultHeaders}; + /// use spector_datetime::response_header::models::{DatetimeResponseHeaderClientDefaultResult, DatetimeResponseHeaderClientDefaultResultHeaders}; /// async fn example() -> Result<()> { /// let response: Response = unimplemented!(); /// // Access response headers @@ -93,7 +93,7 @@ impl DatetimeResponseHeaderClient { /// /// ```no_run /// use azure_core::{Result, http::{Response, NoFormat}}; - /// use spector_datetime::models::{DatetimeResponseHeaderClientRfc3339Result, DatetimeResponseHeaderClientRfc3339ResultHeaders}; + /// use spector_datetime::response_header::models::{DatetimeResponseHeaderClientRfc3339Result, DatetimeResponseHeaderClientRfc3339ResultHeaders}; /// async fn example() -> Result<()> { /// let response: Response = unimplemented!(); /// // Access response headers @@ -146,7 +146,7 @@ impl DatetimeResponseHeaderClient { /// /// ```no_run /// use azure_core::{Result, http::{Response, NoFormat}}; - /// use spector_datetime::models::{DatetimeResponseHeaderClientRfc7231Result, DatetimeResponseHeaderClientRfc7231ResultHeaders}; + /// use spector_datetime::response_header::models::{DatetimeResponseHeaderClientRfc7231Result, DatetimeResponseHeaderClientRfc7231ResultHeaders}; /// async fn example() -> Result<()> { /// let response: Response = unimplemented!(); /// // Access response headers @@ -199,7 +199,7 @@ impl DatetimeResponseHeaderClient { /// /// ```no_run /// use azure_core::{Result, http::{Response, NoFormat}}; - /// use spector_datetime::models::{DatetimeResponseHeaderClientUnixTimestampResult, DatetimeResponseHeaderClientUnixTimestampResultHeaders}; + /// use spector_datetime::response_header::models::{DatetimeResponseHeaderClientUnixTimestampResult, DatetimeResponseHeaderClientUnixTimestampResultHeaders}; /// async fn example() -> Result<()> { /// let response: Response = unimplemented!(); /// // Access response headers diff --git a/packages/typespec-rust/test/spector/encode/datetime/src/response_header/generated/clients/mod.rs b/packages/typespec-rust/test/spector/encode/datetime/src/response_header/generated/clients/mod.rs new file mode 100644 index 000000000..d472c65be --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/datetime/src/response_header/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod datetime_response_header_client; +pub use datetime_response_header_client::*; diff --git a/packages/typespec-rust/test/spector/encode/datetime/src/response_header/generated/mod.rs b/packages/typespec-rust/test/spector/encode/datetime/src/response_header/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/datetime/src/response_header/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/encode/datetime/src/generated/models/header_traits.rs b/packages/typespec-rust/test/spector/encode/datetime/src/response_header/generated/models/header_traits.rs similarity index 89% rename from packages/typespec-rust/test/spector/encode/datetime/src/generated/models/header_traits.rs rename to packages/typespec-rust/test/spector/encode/datetime/src/response_header/generated/models/header_traits.rs index e5ecd7a17..bf69f5ea3 100644 --- a/packages/typespec-rust/test/spector/encode/datetime/src/generated/models/header_traits.rs +++ b/packages/typespec-rust/test/spector/encode/datetime/src/response_header/generated/models/header_traits.rs @@ -24,7 +24,7 @@ const VALUE: HeaderName = HeaderName::from_static("value"); /// /// ```no_run /// use azure_core::{Result, http::{Response, NoFormat}}; -/// use spector_datetime::models::{DatetimeResponseHeaderClientDefaultResult, DatetimeResponseHeaderClientDefaultResultHeaders}; +/// use spector_datetime::response_header::models::{DatetimeResponseHeaderClientDefaultResult, DatetimeResponseHeaderClientDefaultResultHeaders}; /// async fn example() -> Result<()> { /// let response: Response = unimplemented!(); /// // Access response headers @@ -52,7 +52,7 @@ impl DatetimeResponseHeaderClientDefaultResultHeaders /// /// ```no_run /// use azure_core::{Result, http::{Response, NoFormat}}; -/// use spector_datetime::models::{DatetimeResponseHeaderClientRfc3339Result, DatetimeResponseHeaderClientRfc3339ResultHeaders}; +/// use spector_datetime::response_header::models::{DatetimeResponseHeaderClientRfc3339Result, DatetimeResponseHeaderClientRfc3339ResultHeaders}; /// async fn example() -> Result<()> { /// let response: Response = unimplemented!(); /// // Access response headers @@ -80,7 +80,7 @@ impl DatetimeResponseHeaderClientRfc3339ResultHeaders /// /// ```no_run /// use azure_core::{Result, http::{Response, NoFormat}}; -/// use spector_datetime::models::{DatetimeResponseHeaderClientRfc7231Result, DatetimeResponseHeaderClientRfc7231ResultHeaders}; +/// use spector_datetime::response_header::models::{DatetimeResponseHeaderClientRfc7231Result, DatetimeResponseHeaderClientRfc7231ResultHeaders}; /// async fn example() -> Result<()> { /// let response: Response = unimplemented!(); /// // Access response headers @@ -108,7 +108,7 @@ impl DatetimeResponseHeaderClientRfc7231ResultHeaders /// /// ```no_run /// use azure_core::{Result, http::{Response, NoFormat}}; -/// use spector_datetime::models::{DatetimeResponseHeaderClientUnixTimestampResult, DatetimeResponseHeaderClientUnixTimestampResultHeaders}; +/// use spector_datetime::response_header::models::{DatetimeResponseHeaderClientUnixTimestampResult, DatetimeResponseHeaderClientUnixTimestampResultHeaders}; /// async fn example() -> Result<()> { /// let response: Response = unimplemented!(); /// // Access response headers diff --git a/packages/typespec-rust/test/spector/encode/datetime/src/response_header/generated/models/method_options.rs b/packages/typespec-rust/test/spector/encode/datetime/src/response_header/generated/models/method_options.rs new file mode 100644 index 000000000..d4cc5a264 --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/datetime/src/response_header/generated/models/method_options.rs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`DatetimeResponseHeaderClient::default()`](crate::response_header::generated::clients::DatetimeResponseHeaderClient::default()) +#[derive(Clone, Default, SafeDebug)] +pub struct DatetimeResponseHeaderClientDefaultOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DatetimeResponseHeaderClient::rfc3339()`](crate::response_header::generated::clients::DatetimeResponseHeaderClient::rfc3339()) +#[derive(Clone, Default, SafeDebug)] +pub struct DatetimeResponseHeaderClientRfc3339Options<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DatetimeResponseHeaderClient::rfc7231()`](crate::response_header::generated::clients::DatetimeResponseHeaderClient::rfc7231()) +#[derive(Clone, Default, SafeDebug)] +pub struct DatetimeResponseHeaderClientRfc7231Options<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DatetimeResponseHeaderClient::unix_timestamp()`](crate::response_header::generated::clients::DatetimeResponseHeaderClient::unix_timestamp()) +#[derive(Clone, Default, SafeDebug)] +pub struct DatetimeResponseHeaderClientUnixTimestampOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/encode/datetime/src/response_header/generated/models/mod.rs b/packages/typespec-rust/test/spector/encode/datetime/src/response_header/generated/models/mod.rs new file mode 100644 index 000000000..3262c5304 --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/datetime/src/response_header/generated/models/mod.rs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod header_traits; +mod method_options; +#[allow(clippy::module_inception)] +mod models; +pub use header_traits::*; +pub use method_options::*; +pub use models::*; diff --git a/packages/typespec-rust/test/spector/encode/datetime/src/response_header/generated/models/models.rs b/packages/typespec-rust/test/spector/encode/datetime/src/response_header/generated/models/models.rs new file mode 100644 index 000000000..eb8471d01 --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/datetime/src/response_header/generated/models/models.rs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::fmt::SafeDebug; + +/// Contains results for [`DatetimeResponseHeaderClient::default()`](crate::generated::clients::DatetimeResponseHeaderClient::default()) +#[derive(SafeDebug)] +pub struct DatetimeResponseHeaderClientDefaultResult; + +/// Contains results for [`DatetimeResponseHeaderClient::rfc3339()`](crate::generated::clients::DatetimeResponseHeaderClient::rfc3339()) +#[derive(SafeDebug)] +pub struct DatetimeResponseHeaderClientRfc3339Result; + +/// Contains results for [`DatetimeResponseHeaderClient::rfc7231()`](crate::generated::clients::DatetimeResponseHeaderClient::rfc7231()) +#[derive(SafeDebug)] +pub struct DatetimeResponseHeaderClientRfc7231Result; + +/// Contains results for [`DatetimeResponseHeaderClient::unix_timestamp()`](crate::generated::clients::DatetimeResponseHeaderClient::unix_timestamp()) +#[derive(SafeDebug)] +pub struct DatetimeResponseHeaderClientUnixTimestampResult; diff --git a/packages/typespec-rust/test/spector/encode/datetime/src/response_header/mod.rs b/packages/typespec-rust/test/spector/encode/datetime/src/response_header/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/datetime/src/response_header/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/encode/datetime/tests/datetime_response_header_client_test.rs b/packages/typespec-rust/test/spector/encode/datetime/tests/datetime_response_header_client_test.rs index 07f375aa0..5b7137965 100644 --- a/packages/typespec-rust/test/spector/encode/datetime/tests/datetime_response_header_client_test.rs +++ b/packages/typespec-rust/test/spector/encode/datetime/tests/datetime_response_header_client_test.rs @@ -4,7 +4,7 @@ use azure_core::time::OffsetDateTime; use spector_datetime::{ - models::{ + response_header::models::{ DatetimeResponseHeaderClientDefaultResultHeaders, DatetimeResponseHeaderClientRfc3339ResultHeaders, DatetimeResponseHeaderClientRfc7231ResultHeaders, diff --git a/packages/typespec-rust/test/spector/encode/duration/src/generated/clients/duration_client.rs b/packages/typespec-rust/test/spector/encode/duration/src/generated/clients/duration_client.rs index e37b76344..8c4ad99c5 100644 --- a/packages/typespec-rust/test/spector/encode/duration/src/generated/clients/duration_client.rs +++ b/packages/typespec-rust/test/spector/encode/duration/src/generated/clients/duration_client.rs @@ -3,8 +3,9 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::clients::{ - DurationHeaderClient, DurationPropertyClient, DurationQueryClient, +use crate::{ + header::clients::DurationHeaderClient, property::clients::DurationPropertyClient, + query::clients::DurationQueryClient, }; use azure_core::{ fmt::SafeDebug, diff --git a/packages/typespec-rust/test/spector/encode/duration/src/generated/clients/mod.rs b/packages/typespec-rust/test/spector/encode/duration/src/generated/clients/mod.rs index c21b9dc4b..b0a3438c8 100644 --- a/packages/typespec-rust/test/spector/encode/duration/src/generated/clients/mod.rs +++ b/packages/typespec-rust/test/spector/encode/duration/src/generated/clients/mod.rs @@ -4,10 +4,4 @@ // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. mod duration_client; -mod duration_header_client; -mod duration_property_client; -mod duration_query_client; pub use duration_client::*; -pub use duration_header_client::*; -pub use duration_property_client::*; -pub use duration_query_client::*; diff --git a/packages/typespec-rust/test/spector/encode/duration/src/generated/mod.rs b/packages/typespec-rust/test/spector/encode/duration/src/generated/mod.rs index 320f1aafb..3d38f4d78 100644 --- a/packages/typespec-rust/test/spector/encode/duration/src/generated/mod.rs +++ b/packages/typespec-rust/test/spector/encode/duration/src/generated/mod.rs @@ -5,6 +5,4 @@ /// Clients used to communicate with the service. pub mod clients; -/// Contains all the data structures and types used by the client library. -pub mod models; pub use clients::{DurationClient, DurationClientOptions}; diff --git a/packages/typespec-rust/test/spector/encode/duration/src/generated/models/method_options.rs b/packages/typespec-rust/test/spector/encode/duration/src/generated/models/method_options.rs deleted file mode 100644 index 216cd1a1f..000000000 --- a/packages/typespec-rust/test/spector/encode/duration/src/generated/models/method_options.rs +++ /dev/null @@ -1,300 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// -// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. - -use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; - -/// Options to be passed to [`DurationHeaderClient::default()`](crate::generated::clients::DurationHeaderClient::default()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationHeaderClientDefaultOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationHeaderClient::float64_milliseconds()`](crate::generated::clients::DurationHeaderClient::float64_milliseconds()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationHeaderClientFloat64MillisecondsOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationHeaderClient::float64_seconds()`](crate::generated::clients::DurationHeaderClient::float64_seconds()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationHeaderClientFloat64SecondsOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationHeaderClient::float_milliseconds()`](crate::generated::clients::DurationHeaderClient::float_milliseconds()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationHeaderClientFloatMillisecondsOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationHeaderClient::float_milliseconds_larger_unit()`](crate::generated::clients::DurationHeaderClient::float_milliseconds_larger_unit()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationHeaderClientFloatMillisecondsLargerUnitOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationHeaderClient::float_seconds()`](crate::generated::clients::DurationHeaderClient::float_seconds()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationHeaderClientFloatSecondsOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationHeaderClient::float_seconds_larger_unit()`](crate::generated::clients::DurationHeaderClient::float_seconds_larger_unit()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationHeaderClientFloatSecondsLargerUnitOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationHeaderClient::int32_milliseconds()`](crate::generated::clients::DurationHeaderClient::int32_milliseconds()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationHeaderClientInt32MillisecondsOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationHeaderClient::int32_milliseconds_array()`](crate::generated::clients::DurationHeaderClient::int32_milliseconds_array()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationHeaderClientInt32MillisecondsArrayOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationHeaderClient::int32_milliseconds_larger_unit()`](crate::generated::clients::DurationHeaderClient::int32_milliseconds_larger_unit()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationHeaderClientInt32MillisecondsLargerUnitOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationHeaderClient::int32_seconds()`](crate::generated::clients::DurationHeaderClient::int32_seconds()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationHeaderClientInt32SecondsOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationHeaderClient::int32_seconds_larger_unit()`](crate::generated::clients::DurationHeaderClient::int32_seconds_larger_unit()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationHeaderClientInt32SecondsLargerUnitOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationHeaderClient::iso8601()`](crate::generated::clients::DurationHeaderClient::iso8601()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationHeaderClientIso8601Options<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationHeaderClient::iso8601_array()`](crate::generated::clients::DurationHeaderClient::iso8601_array()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationHeaderClientIso8601ArrayOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationPropertyClient::default()`](crate::generated::clients::DurationPropertyClient::default()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationPropertyClientDefaultOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationPropertyClient::float64_milliseconds()`](crate::generated::clients::DurationPropertyClient::float64_milliseconds()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationPropertyClientFloat64MillisecondsOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationPropertyClient::float64_seconds()`](crate::generated::clients::DurationPropertyClient::float64_seconds()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationPropertyClientFloat64SecondsOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationPropertyClient::float_milliseconds()`](crate::generated::clients::DurationPropertyClient::float_milliseconds()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationPropertyClientFloatMillisecondsOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationPropertyClient::float_milliseconds_array()`](crate::generated::clients::DurationPropertyClient::float_milliseconds_array()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationPropertyClientFloatMillisecondsArrayOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationPropertyClient::float_milliseconds_larger_unit()`](crate::generated::clients::DurationPropertyClient::float_milliseconds_larger_unit()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationPropertyClientFloatMillisecondsLargerUnitOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationPropertyClient::float_seconds()`](crate::generated::clients::DurationPropertyClient::float_seconds()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationPropertyClientFloatSecondsOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationPropertyClient::float_seconds_array()`](crate::generated::clients::DurationPropertyClient::float_seconds_array()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationPropertyClientFloatSecondsArrayOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationPropertyClient::float_seconds_larger_unit()`](crate::generated::clients::DurationPropertyClient::float_seconds_larger_unit()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationPropertyClientFloatSecondsLargerUnitOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationPropertyClient::int32_milliseconds()`](crate::generated::clients::DurationPropertyClient::int32_milliseconds()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationPropertyClientInt32MillisecondsOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationPropertyClient::int32_milliseconds_larger_unit()`](crate::generated::clients::DurationPropertyClient::int32_milliseconds_larger_unit()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationPropertyClientInt32MillisecondsLargerUnitOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationPropertyClient::int32_seconds()`](crate::generated::clients::DurationPropertyClient::int32_seconds()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationPropertyClientInt32SecondsOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationPropertyClient::int32_seconds_larger_unit()`](crate::generated::clients::DurationPropertyClient::int32_seconds_larger_unit()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationPropertyClientInt32SecondsLargerUnitOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationPropertyClient::iso8601()`](crate::generated::clients::DurationPropertyClient::iso8601()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationPropertyClientIso8601Options<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationQueryClient::default()`](crate::generated::clients::DurationQueryClient::default()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationQueryClientDefaultOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationQueryClient::float64_milliseconds()`](crate::generated::clients::DurationQueryClient::float64_milliseconds()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationQueryClientFloat64MillisecondsOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationQueryClient::float64_seconds()`](crate::generated::clients::DurationQueryClient::float64_seconds()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationQueryClientFloat64SecondsOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationQueryClient::float_milliseconds()`](crate::generated::clients::DurationQueryClient::float_milliseconds()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationQueryClientFloatMillisecondsOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationQueryClient::float_milliseconds_larger_unit()`](crate::generated::clients::DurationQueryClient::float_milliseconds_larger_unit()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationQueryClientFloatMillisecondsLargerUnitOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationQueryClient::float_seconds()`](crate::generated::clients::DurationQueryClient::float_seconds()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationQueryClientFloatSecondsOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationQueryClient::float_seconds_larger_unit()`](crate::generated::clients::DurationQueryClient::float_seconds_larger_unit()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationQueryClientFloatSecondsLargerUnitOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationQueryClient::int32_milliseconds()`](crate::generated::clients::DurationQueryClient::int32_milliseconds()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationQueryClientInt32MillisecondsOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationQueryClient::int32_milliseconds_array()`](crate::generated::clients::DurationQueryClient::int32_milliseconds_array()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationQueryClientInt32MillisecondsArrayOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationQueryClient::int32_milliseconds_larger_unit()`](crate::generated::clients::DurationQueryClient::int32_milliseconds_larger_unit()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationQueryClientInt32MillisecondsLargerUnitOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationQueryClient::int32_seconds()`](crate::generated::clients::DurationQueryClient::int32_seconds()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationQueryClientInt32SecondsOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationQueryClient::int32_seconds_array()`](crate::generated::clients::DurationQueryClient::int32_seconds_array()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationQueryClientInt32SecondsArrayOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationQueryClient::int32_seconds_larger_unit()`](crate::generated::clients::DurationQueryClient::int32_seconds_larger_unit()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationQueryClientInt32SecondsLargerUnitOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DurationQueryClient::iso8601()`](crate::generated::clients::DurationQueryClient::iso8601()) -#[derive(Clone, Default, SafeDebug)] -pub struct DurationQueryClientIso8601Options<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} diff --git a/packages/typespec-rust/test/spector/encode/duration/src/generated/clients/duration_header_client.rs b/packages/typespec-rust/test/spector/encode/duration/src/header/generated/clients/duration_header_client.rs similarity index 99% rename from packages/typespec-rust/test/spector/encode/duration/src/generated/clients/duration_header_client.rs rename to packages/typespec-rust/test/spector/encode/duration/src/header/generated/clients/duration_header_client.rs index 5362ccda3..21de1f808 100644 --- a/packages/typespec-rust/test/spector/encode/duration/src/generated/clients/duration_header_client.rs +++ b/packages/typespec-rust/test/spector/encode/duration/src/header/generated/clients/duration_header_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::header::generated::models::{ DurationHeaderClientDefaultOptions, DurationHeaderClientFloat64MillisecondsOptions, DurationHeaderClientFloat64SecondsOptions, DurationHeaderClientFloatMillisecondsLargerUnitOptions, diff --git a/packages/typespec-rust/test/spector/encode/duration/src/header/generated/clients/mod.rs b/packages/typespec-rust/test/spector/encode/duration/src/header/generated/clients/mod.rs new file mode 100644 index 000000000..b75632b39 --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/duration/src/header/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod duration_header_client; +pub use duration_header_client::*; diff --git a/packages/typespec-rust/test/spector/encode/duration/src/header/generated/mod.rs b/packages/typespec-rust/test/spector/encode/duration/src/header/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/duration/src/header/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/encode/duration/src/header/generated/models/method_options.rs b/packages/typespec-rust/test/spector/encode/duration/src/header/generated/models/method_options.rs new file mode 100644 index 000000000..87575b0c0 --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/duration/src/header/generated/models/method_options.rs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`DurationHeaderClient::default()`](crate::header::generated::clients::DurationHeaderClient::default()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationHeaderClientDefaultOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationHeaderClient::float64_milliseconds()`](crate::header::generated::clients::DurationHeaderClient::float64_milliseconds()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationHeaderClientFloat64MillisecondsOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationHeaderClient::float64_seconds()`](crate::header::generated::clients::DurationHeaderClient::float64_seconds()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationHeaderClientFloat64SecondsOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationHeaderClient::float_milliseconds()`](crate::header::generated::clients::DurationHeaderClient::float_milliseconds()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationHeaderClientFloatMillisecondsOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationHeaderClient::float_milliseconds_larger_unit()`](crate::header::generated::clients::DurationHeaderClient::float_milliseconds_larger_unit()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationHeaderClientFloatMillisecondsLargerUnitOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationHeaderClient::float_seconds()`](crate::header::generated::clients::DurationHeaderClient::float_seconds()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationHeaderClientFloatSecondsOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationHeaderClient::float_seconds_larger_unit()`](crate::header::generated::clients::DurationHeaderClient::float_seconds_larger_unit()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationHeaderClientFloatSecondsLargerUnitOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationHeaderClient::int32_milliseconds()`](crate::header::generated::clients::DurationHeaderClient::int32_milliseconds()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationHeaderClientInt32MillisecondsOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationHeaderClient::int32_milliseconds_array()`](crate::header::generated::clients::DurationHeaderClient::int32_milliseconds_array()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationHeaderClientInt32MillisecondsArrayOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationHeaderClient::int32_milliseconds_larger_unit()`](crate::header::generated::clients::DurationHeaderClient::int32_milliseconds_larger_unit()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationHeaderClientInt32MillisecondsLargerUnitOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationHeaderClient::int32_seconds()`](crate::header::generated::clients::DurationHeaderClient::int32_seconds()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationHeaderClientInt32SecondsOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationHeaderClient::int32_seconds_larger_unit()`](crate::header::generated::clients::DurationHeaderClient::int32_seconds_larger_unit()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationHeaderClientInt32SecondsLargerUnitOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationHeaderClient::iso8601()`](crate::header::generated::clients::DurationHeaderClient::iso8601()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationHeaderClientIso8601Options<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationHeaderClient::iso8601_array()`](crate::header::generated::clients::DurationHeaderClient::iso8601_array()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationHeaderClientIso8601ArrayOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/encode/duration/src/header/generated/models/mod.rs b/packages/typespec-rust/test/spector/encode/duration/src/header/generated/models/mod.rs new file mode 100644 index 000000000..3e484b1ed --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/duration/src/header/generated/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/encode/duration/src/header/mod.rs b/packages/typespec-rust/test/spector/encode/duration/src/header/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/duration/src/header/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/encode/duration/src/lib.rs b/packages/typespec-rust/test/spector/encode/duration/src/lib.rs index cc784e401..848a59a95 100644 --- a/packages/typespec-rust/test/spector/encode/duration/src/lib.rs +++ b/packages/typespec-rust/test/spector/encode/duration/src/lib.rs @@ -7,3 +7,6 @@ mod generated; pub use generated::*; +pub mod header; +pub mod property; +pub mod query; diff --git a/packages/typespec-rust/test/spector/encode/duration/src/generated/clients/duration_property_client.rs b/packages/typespec-rust/test/spector/encode/duration/src/property/generated/clients/duration_property_client.rs similarity index 99% rename from packages/typespec-rust/test/spector/encode/duration/src/generated/clients/duration_property_client.rs rename to packages/typespec-rust/test/spector/encode/duration/src/property/generated/clients/duration_property_client.rs index c32bb2c5c..c83d066a9 100644 --- a/packages/typespec-rust/test/spector/encode/duration/src/generated/clients/duration_property_client.rs +++ b/packages/typespec-rust/test/spector/encode/duration/src/property/generated/clients/duration_property_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::property::generated::models::{ DefaultDurationProperty, DurationPropertyClientDefaultOptions, DurationPropertyClientFloat64MillisecondsOptions, DurationPropertyClientFloat64SecondsOptions, DurationPropertyClientFloatMillisecondsArrayOptions, diff --git a/packages/typespec-rust/test/spector/encode/duration/src/property/generated/clients/mod.rs b/packages/typespec-rust/test/spector/encode/duration/src/property/generated/clients/mod.rs new file mode 100644 index 000000000..6b32e486d --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/duration/src/property/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod duration_property_client; +pub use duration_property_client::*; diff --git a/packages/typespec-rust/test/spector/encode/duration/src/property/generated/mod.rs b/packages/typespec-rust/test/spector/encode/duration/src/property/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/duration/src/property/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/encode/duration/src/property/generated/models/method_options.rs b/packages/typespec-rust/test/spector/encode/duration/src/property/generated/models/method_options.rs new file mode 100644 index 000000000..7f4452795 --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/duration/src/property/generated/models/method_options.rs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`DurationPropertyClient::default()`](crate::property::generated::clients::DurationPropertyClient::default()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationPropertyClientDefaultOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationPropertyClient::float64_milliseconds()`](crate::property::generated::clients::DurationPropertyClient::float64_milliseconds()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationPropertyClientFloat64MillisecondsOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationPropertyClient::float64_seconds()`](crate::property::generated::clients::DurationPropertyClient::float64_seconds()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationPropertyClientFloat64SecondsOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationPropertyClient::float_milliseconds()`](crate::property::generated::clients::DurationPropertyClient::float_milliseconds()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationPropertyClientFloatMillisecondsOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationPropertyClient::float_milliseconds_array()`](crate::property::generated::clients::DurationPropertyClient::float_milliseconds_array()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationPropertyClientFloatMillisecondsArrayOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationPropertyClient::float_milliseconds_larger_unit()`](crate::property::generated::clients::DurationPropertyClient::float_milliseconds_larger_unit()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationPropertyClientFloatMillisecondsLargerUnitOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationPropertyClient::float_seconds()`](crate::property::generated::clients::DurationPropertyClient::float_seconds()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationPropertyClientFloatSecondsOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationPropertyClient::float_seconds_array()`](crate::property::generated::clients::DurationPropertyClient::float_seconds_array()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationPropertyClientFloatSecondsArrayOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationPropertyClient::float_seconds_larger_unit()`](crate::property::generated::clients::DurationPropertyClient::float_seconds_larger_unit()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationPropertyClientFloatSecondsLargerUnitOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationPropertyClient::int32_milliseconds()`](crate::property::generated::clients::DurationPropertyClient::int32_milliseconds()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationPropertyClientInt32MillisecondsOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationPropertyClient::int32_milliseconds_larger_unit()`](crate::property::generated::clients::DurationPropertyClient::int32_milliseconds_larger_unit()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationPropertyClientInt32MillisecondsLargerUnitOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationPropertyClient::int32_seconds()`](crate::property::generated::clients::DurationPropertyClient::int32_seconds()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationPropertyClientInt32SecondsOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationPropertyClient::int32_seconds_larger_unit()`](crate::property::generated::clients::DurationPropertyClient::int32_seconds_larger_unit()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationPropertyClientInt32SecondsLargerUnitOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationPropertyClient::iso8601()`](crate::property::generated::clients::DurationPropertyClient::iso8601()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationPropertyClientIso8601Options<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/parameters/basic/src/generated/models/mod.rs b/packages/typespec-rust/test/spector/encode/duration/src/property/generated/models/mod.rs similarity index 100% rename from packages/typespec-rust/test/spector/parameters/basic/src/generated/models/mod.rs rename to packages/typespec-rust/test/spector/encode/duration/src/property/generated/models/mod.rs diff --git a/packages/typespec-rust/test/spector/encode/duration/src/generated/models/models.rs b/packages/typespec-rust/test/spector/encode/duration/src/property/generated/models/models.rs similarity index 100% rename from packages/typespec-rust/test/spector/encode/duration/src/generated/models/models.rs rename to packages/typespec-rust/test/spector/encode/duration/src/property/generated/models/models.rs diff --git a/packages/typespec-rust/test/spector/encode/duration/src/generated/models/models_impl.rs b/packages/typespec-rust/test/spector/encode/duration/src/property/generated/models/models_impl.rs similarity index 100% rename from packages/typespec-rust/test/spector/encode/duration/src/generated/models/models_impl.rs rename to packages/typespec-rust/test/spector/encode/duration/src/property/generated/models/models_impl.rs diff --git a/packages/typespec-rust/test/spector/encode/duration/src/property/mod.rs b/packages/typespec-rust/test/spector/encode/duration/src/property/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/duration/src/property/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/encode/duration/src/generated/clients/duration_query_client.rs b/packages/typespec-rust/test/spector/encode/duration/src/query/generated/clients/duration_query_client.rs similarity index 99% rename from packages/typespec-rust/test/spector/encode/duration/src/generated/clients/duration_query_client.rs rename to packages/typespec-rust/test/spector/encode/duration/src/query/generated/clients/duration_query_client.rs index f16ccb8b9..3ce07e525 100644 --- a/packages/typespec-rust/test/spector/encode/duration/src/generated/clients/duration_query_client.rs +++ b/packages/typespec-rust/test/spector/encode/duration/src/query/generated/clients/duration_query_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::query::generated::models::{ DurationQueryClientDefaultOptions, DurationQueryClientFloat64MillisecondsOptions, DurationQueryClientFloat64SecondsOptions, DurationQueryClientFloatMillisecondsLargerUnitOptions, diff --git a/packages/typespec-rust/test/spector/encode/duration/src/query/generated/clients/mod.rs b/packages/typespec-rust/test/spector/encode/duration/src/query/generated/clients/mod.rs new file mode 100644 index 000000000..1c74af9c9 --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/duration/src/query/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod duration_query_client; +pub use duration_query_client::*; diff --git a/packages/typespec-rust/test/spector/encode/duration/src/query/generated/mod.rs b/packages/typespec-rust/test/spector/encode/duration/src/query/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/duration/src/query/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/encode/duration/src/query/generated/models/method_options.rs b/packages/typespec-rust/test/spector/encode/duration/src/query/generated/models/method_options.rs new file mode 100644 index 000000000..4e67d8d35 --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/duration/src/query/generated/models/method_options.rs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`DurationQueryClient::default()`](crate::query::generated::clients::DurationQueryClient::default()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationQueryClientDefaultOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationQueryClient::float64_milliseconds()`](crate::query::generated::clients::DurationQueryClient::float64_milliseconds()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationQueryClientFloat64MillisecondsOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationQueryClient::float64_seconds()`](crate::query::generated::clients::DurationQueryClient::float64_seconds()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationQueryClientFloat64SecondsOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationQueryClient::float_milliseconds()`](crate::query::generated::clients::DurationQueryClient::float_milliseconds()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationQueryClientFloatMillisecondsOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationQueryClient::float_milliseconds_larger_unit()`](crate::query::generated::clients::DurationQueryClient::float_milliseconds_larger_unit()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationQueryClientFloatMillisecondsLargerUnitOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationQueryClient::float_seconds()`](crate::query::generated::clients::DurationQueryClient::float_seconds()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationQueryClientFloatSecondsOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationQueryClient::float_seconds_larger_unit()`](crate::query::generated::clients::DurationQueryClient::float_seconds_larger_unit()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationQueryClientFloatSecondsLargerUnitOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationQueryClient::int32_milliseconds()`](crate::query::generated::clients::DurationQueryClient::int32_milliseconds()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationQueryClientInt32MillisecondsOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationQueryClient::int32_milliseconds_array()`](crate::query::generated::clients::DurationQueryClient::int32_milliseconds_array()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationQueryClientInt32MillisecondsArrayOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationQueryClient::int32_milliseconds_larger_unit()`](crate::query::generated::clients::DurationQueryClient::int32_milliseconds_larger_unit()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationQueryClientInt32MillisecondsLargerUnitOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationQueryClient::int32_seconds()`](crate::query::generated::clients::DurationQueryClient::int32_seconds()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationQueryClientInt32SecondsOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationQueryClient::int32_seconds_array()`](crate::query::generated::clients::DurationQueryClient::int32_seconds_array()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationQueryClientInt32SecondsArrayOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationQueryClient::int32_seconds_larger_unit()`](crate::query::generated::clients::DurationQueryClient::int32_seconds_larger_unit()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationQueryClientInt32SecondsLargerUnitOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DurationQueryClient::iso8601()`](crate::query::generated::clients::DurationQueryClient::iso8601()) +#[derive(Clone, Default, SafeDebug)] +pub struct DurationQueryClientIso8601Options<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/encode/duration/src/query/generated/models/mod.rs b/packages/typespec-rust/test/spector/encode/duration/src/query/generated/models/mod.rs new file mode 100644 index 000000000..3e484b1ed --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/duration/src/query/generated/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/encode/duration/src/query/mod.rs b/packages/typespec-rust/test/spector/encode/duration/src/query/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/duration/src/query/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/encode/duration/tests/duration_property_client_test.rs b/packages/typespec-rust/test/spector/encode/duration/tests/duration_property_client_test.rs index a6eef14e8..f49cdc0d0 100644 --- a/packages/typespec-rust/test/spector/encode/duration/tests/duration_property_client_test.rs +++ b/packages/typespec-rust/test/spector/encode/duration/tests/duration_property_client_test.rs @@ -3,7 +3,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. use spector_duration::{ - models::{ + property::models::{ DefaultDurationProperty, Float64MillisecondsDurationProperty, Float64SecondsDurationProperty, FloatMillisecondsDurationArrayProperty, FloatMillisecondsDurationProperty, FloatMillisecondsLargerUnitDurationProperty, diff --git a/packages/typespec-rust/test/spector/encode/numeric/src/generated/clients/mod.rs b/packages/typespec-rust/test/spector/encode/numeric/src/generated/clients/mod.rs index 9067bc8eb..c22ff080a 100644 --- a/packages/typespec-rust/test/spector/encode/numeric/src/generated/clients/mod.rs +++ b/packages/typespec-rust/test/spector/encode/numeric/src/generated/clients/mod.rs @@ -4,6 +4,4 @@ // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. mod numeric_client; -mod numeric_property_client; pub use numeric_client::*; -pub use numeric_property_client::*; diff --git a/packages/typespec-rust/test/spector/encode/numeric/src/generated/clients/numeric_client.rs b/packages/typespec-rust/test/spector/encode/numeric/src/generated/clients/numeric_client.rs index d9031af11..acde2a510 100644 --- a/packages/typespec-rust/test/spector/encode/numeric/src/generated/clients/numeric_client.rs +++ b/packages/typespec-rust/test/spector/encode/numeric/src/generated/clients/numeric_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::clients::NumericPropertyClient; +use crate::property::clients::NumericPropertyClient; use azure_core::{ fmt::SafeDebug, http::{ClientOptions, Pipeline, Url}, diff --git a/packages/typespec-rust/test/spector/encode/numeric/src/generated/mod.rs b/packages/typespec-rust/test/spector/encode/numeric/src/generated/mod.rs index 5dba4b85d..e146631d4 100644 --- a/packages/typespec-rust/test/spector/encode/numeric/src/generated/mod.rs +++ b/packages/typespec-rust/test/spector/encode/numeric/src/generated/mod.rs @@ -5,6 +5,4 @@ /// Clients used to communicate with the service. pub mod clients; -/// Contains all the data structures and types used by the client library. -pub mod models; pub use clients::{NumericClient, NumericClientOptions}; diff --git a/packages/typespec-rust/test/spector/encode/numeric/src/lib.rs b/packages/typespec-rust/test/spector/encode/numeric/src/lib.rs index cc784e401..4e24cb1eb 100644 --- a/packages/typespec-rust/test/spector/encode/numeric/src/lib.rs +++ b/packages/typespec-rust/test/spector/encode/numeric/src/lib.rs @@ -7,3 +7,4 @@ mod generated; pub use generated::*; +pub mod property; diff --git a/packages/typespec-rust/test/spector/encode/numeric/src/property/generated/clients/mod.rs b/packages/typespec-rust/test/spector/encode/numeric/src/property/generated/clients/mod.rs new file mode 100644 index 000000000..6fe940a2a --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/numeric/src/property/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod numeric_property_client; +pub use numeric_property_client::*; diff --git a/packages/typespec-rust/test/spector/encode/numeric/src/generated/clients/numeric_property_client.rs b/packages/typespec-rust/test/spector/encode/numeric/src/property/generated/clients/numeric_property_client.rs similarity index 99% rename from packages/typespec-rust/test/spector/encode/numeric/src/generated/clients/numeric_property_client.rs rename to packages/typespec-rust/test/spector/encode/numeric/src/property/generated/clients/numeric_property_client.rs index d8206680b..f7122523d 100644 --- a/packages/typespec-rust/test/spector/encode/numeric/src/generated/clients/numeric_property_client.rs +++ b/packages/typespec-rust/test/spector/encode/numeric/src/property/generated/clients/numeric_property_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::property::generated::models::{ NumericPropertyClientSafeintAsStringOptions, NumericPropertyClientUint32AsStringOptionalOptions, NumericPropertyClientUint8AsStringOptions, SafeintAsStringProperty, Uint32AsStringProperty, Uint8AsStringProperty, diff --git a/packages/typespec-rust/test/spector/encode/numeric/src/property/generated/mod.rs b/packages/typespec-rust/test/spector/encode/numeric/src/property/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/numeric/src/property/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/encode/numeric/src/generated/models/method_options.rs b/packages/typespec-rust/test/spector/encode/numeric/src/property/generated/models/method_options.rs similarity index 78% rename from packages/typespec-rust/test/spector/encode/numeric/src/generated/models/method_options.rs rename to packages/typespec-rust/test/spector/encode/numeric/src/property/generated/models/method_options.rs index ff03132fb..7f38985ee 100644 --- a/packages/typespec-rust/test/spector/encode/numeric/src/generated/models/method_options.rs +++ b/packages/typespec-rust/test/spector/encode/numeric/src/property/generated/models/method_options.rs @@ -5,21 +5,21 @@ use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; -/// Options to be passed to [`NumericPropertyClient::safeint_as_string()`](crate::generated::clients::NumericPropertyClient::safeint_as_string()) +/// Options to be passed to [`NumericPropertyClient::safeint_as_string()`](crate::property::generated::clients::NumericPropertyClient::safeint_as_string()) #[derive(Clone, Default, SafeDebug)] pub struct NumericPropertyClientSafeintAsStringOptions<'a> { /// Allows customization of the method call. pub method_options: ClientMethodOptions<'a>, } -/// Options to be passed to [`NumericPropertyClient::uint32_as_string_optional()`](crate::generated::clients::NumericPropertyClient::uint32_as_string_optional()) +/// Options to be passed to [`NumericPropertyClient::uint32_as_string_optional()`](crate::property::generated::clients::NumericPropertyClient::uint32_as_string_optional()) #[derive(Clone, Default, SafeDebug)] pub struct NumericPropertyClientUint32AsStringOptionalOptions<'a> { /// Allows customization of the method call. pub method_options: ClientMethodOptions<'a>, } -/// Options to be passed to [`NumericPropertyClient::uint8_as_string()`](crate::generated::clients::NumericPropertyClient::uint8_as_string()) +/// Options to be passed to [`NumericPropertyClient::uint8_as_string()`](crate::property::generated::clients::NumericPropertyClient::uint8_as_string()) #[derive(Clone, Default, SafeDebug)] pub struct NumericPropertyClientUint8AsStringOptions<'a> { /// Allows customization of the method call. diff --git a/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/generated/models/mod.rs b/packages/typespec-rust/test/spector/encode/numeric/src/property/generated/models/mod.rs similarity index 100% rename from packages/typespec-rust/test/spector/serialization/encoded-name/json/src/generated/models/mod.rs rename to packages/typespec-rust/test/spector/encode/numeric/src/property/generated/models/mod.rs diff --git a/packages/typespec-rust/test/spector/encode/numeric/src/generated/models/models.rs b/packages/typespec-rust/test/spector/encode/numeric/src/property/generated/models/models.rs similarity index 100% rename from packages/typespec-rust/test/spector/encode/numeric/src/generated/models/models.rs rename to packages/typespec-rust/test/spector/encode/numeric/src/property/generated/models/models.rs diff --git a/packages/typespec-rust/test/spector/encode/numeric/src/generated/models/models_impl.rs b/packages/typespec-rust/test/spector/encode/numeric/src/property/generated/models/models_impl.rs similarity index 100% rename from packages/typespec-rust/test/spector/encode/numeric/src/generated/models/models_impl.rs rename to packages/typespec-rust/test/spector/encode/numeric/src/property/generated/models/models_impl.rs diff --git a/packages/typespec-rust/test/spector/encode/numeric/src/property/mod.rs b/packages/typespec-rust/test/spector/encode/numeric/src/property/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/encode/numeric/src/property/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/encode/numeric/tests/numeric_property_client_tests.rs b/packages/typespec-rust/test/spector/encode/numeric/tests/numeric_property_client_tests.rs index 0f014dfdb..f1fef5d87 100644 --- a/packages/typespec-rust/test/spector/encode/numeric/tests/numeric_property_client_tests.rs +++ b/packages/typespec-rust/test/spector/encode/numeric/tests/numeric_property_client_tests.rs @@ -4,7 +4,7 @@ use serde_json::Number; use spector_numeric::{ - models::{SafeintAsStringProperty, Uint32AsStringProperty, Uint8AsStringProperty}, + property::models::{SafeintAsStringProperty, Uint32AsStringProperty, Uint8AsStringProperty}, NumericClient, }; diff --git a/packages/typespec-rust/test/spector/parameters/basic/src/generated/clients/basic_explicit_body_client.rs b/packages/typespec-rust/test/spector/parameters/basic/src/explicit_body/generated/clients/basic_explicit_body_client.rs similarity index 95% rename from packages/typespec-rust/test/spector/parameters/basic/src/generated/clients/basic_explicit_body_client.rs rename to packages/typespec-rust/test/spector/parameters/basic/src/explicit_body/generated/clients/basic_explicit_body_client.rs index 30380eec8..047b6ee02 100644 --- a/packages/typespec-rust/test/spector/parameters/basic/src/generated/clients/basic_explicit_body_client.rs +++ b/packages/typespec-rust/test/spector/parameters/basic/src/explicit_body/generated/clients/basic_explicit_body_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{BasicExplicitBodyClientSimpleOptions, User}; +use crate::explicit_body::generated::models::{BasicExplicitBodyClientSimpleOptions, User}; use azure_core::{ error::CheckSuccessOptions, http::{ diff --git a/packages/typespec-rust/test/spector/parameters/basic/src/explicit_body/generated/clients/mod.rs b/packages/typespec-rust/test/spector/parameters/basic/src/explicit_body/generated/clients/mod.rs new file mode 100644 index 000000000..c96f0a8ca --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/basic/src/explicit_body/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod basic_explicit_body_client; +pub use basic_explicit_body_client::*; diff --git a/packages/typespec-rust/test/spector/parameters/basic/src/explicit_body/generated/mod.rs b/packages/typespec-rust/test/spector/parameters/basic/src/explicit_body/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/basic/src/explicit_body/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/parameters/basic/src/explicit_body/generated/models/method_options.rs b/packages/typespec-rust/test/spector/parameters/basic/src/explicit_body/generated/models/method_options.rs new file mode 100644 index 000000000..2ee6e9bfd --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/basic/src/explicit_body/generated/models/method_options.rs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`BasicExplicitBodyClient::simple()`](crate::explicit_body::generated::clients::BasicExplicitBodyClient::simple()) +#[derive(Clone, Default, SafeDebug)] +pub struct BasicExplicitBodyClientSimpleOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/parameters/basic/src/explicit_body/generated/models/mod.rs b/packages/typespec-rust/test/spector/parameters/basic/src/explicit_body/generated/models/mod.rs new file mode 100644 index 000000000..5dfb21b69 --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/basic/src/explicit_body/generated/models/mod.rs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +#[allow(clippy::module_inception)] +mod models; +mod models_impl; +pub use method_options::*; +pub use models::*; diff --git a/packages/typespec-rust/test/spector/parameters/basic/src/generated/models/models.rs b/packages/typespec-rust/test/spector/parameters/basic/src/explicit_body/generated/models/models.rs similarity index 78% rename from packages/typespec-rust/test/spector/parameters/basic/src/generated/models/models.rs rename to packages/typespec-rust/test/spector/parameters/basic/src/explicit_body/generated/models/models.rs index 57b0da49a..28f37912f 100644 --- a/packages/typespec-rust/test/spector/parameters/basic/src/generated/models/models.rs +++ b/packages/typespec-rust/test/spector/parameters/basic/src/explicit_body/generated/models/models.rs @@ -6,11 +6,6 @@ use azure_core::fmt::SafeDebug; use serde::{Deserialize, Serialize}; -#[derive(Clone, Deserialize, SafeDebug, Serialize)] -pub(crate) struct SimpleRequest { - pub(crate) name: String, -} - /// This is a simple model. #[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] pub struct User { diff --git a/packages/typespec-rust/test/spector/parameters/basic/src/explicit_body/generated/models/models_impl.rs b/packages/typespec-rust/test/spector/parameters/basic/src/explicit_body/generated/models/models_impl.rs new file mode 100644 index 000000000..7d48b70bc --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/basic/src/explicit_body/generated/models/models_impl.rs @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use super::User; +use azure_core::{http::RequestContent, json::to_json, Result}; + +impl TryFrom for RequestContent { + type Error = azure_core::Error; + fn try_from(value: User) -> Result { + Ok(to_json(&value)?.into()) + } +} diff --git a/packages/typespec-rust/test/spector/parameters/basic/src/explicit_body/mod.rs b/packages/typespec-rust/test/spector/parameters/basic/src/explicit_body/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/basic/src/explicit_body/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/parameters/basic/src/generated/clients/basic_client.rs b/packages/typespec-rust/test/spector/parameters/basic/src/generated/clients/basic_client.rs index d7c5ab181..a3507c583 100644 --- a/packages/typespec-rust/test/spector/parameters/basic/src/generated/clients/basic_client.rs +++ b/packages/typespec-rust/test/spector/parameters/basic/src/generated/clients/basic_client.rs @@ -3,7 +3,10 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::clients::{BasicExplicitBodyClient, BasicImplicitBodyClient}; +use crate::{ + explicit_body::clients::BasicExplicitBodyClient, + implicit_body::clients::BasicImplicitBodyClient, +}; use azure_core::{ fmt::SafeDebug, http::{ClientOptions, Pipeline, Url}, diff --git a/packages/typespec-rust/test/spector/parameters/basic/src/generated/clients/mod.rs b/packages/typespec-rust/test/spector/parameters/basic/src/generated/clients/mod.rs index da445f68e..e07b8579d 100644 --- a/packages/typespec-rust/test/spector/parameters/basic/src/generated/clients/mod.rs +++ b/packages/typespec-rust/test/spector/parameters/basic/src/generated/clients/mod.rs @@ -4,8 +4,4 @@ // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. mod basic_client; -mod basic_explicit_body_client; -mod basic_implicit_body_client; pub use basic_client::*; -pub use basic_explicit_body_client::*; -pub use basic_implicit_body_client::*; diff --git a/packages/typespec-rust/test/spector/parameters/basic/src/generated/mod.rs b/packages/typespec-rust/test/spector/parameters/basic/src/generated/mod.rs index 16d47cfdd..585ccc1ec 100644 --- a/packages/typespec-rust/test/spector/parameters/basic/src/generated/mod.rs +++ b/packages/typespec-rust/test/spector/parameters/basic/src/generated/mod.rs @@ -5,6 +5,4 @@ /// Clients used to communicate with the service. pub mod clients; -/// Contains all the data structures and types used by the client library. -pub mod models; pub use clients::{BasicClient, BasicClientOptions}; diff --git a/packages/typespec-rust/test/spector/parameters/basic/src/generated/clients/basic_implicit_body_client.rs b/packages/typespec-rust/test/spector/parameters/basic/src/implicit_body/generated/clients/basic_implicit_body_client.rs similarity index 94% rename from packages/typespec-rust/test/spector/parameters/basic/src/generated/clients/basic_implicit_body_client.rs rename to packages/typespec-rust/test/spector/parameters/basic/src/implicit_body/generated/clients/basic_implicit_body_client.rs index d4ec0098c..145b48a9b 100644 --- a/packages/typespec-rust/test/spector/parameters/basic/src/generated/clients/basic_implicit_body_client.rs +++ b/packages/typespec-rust/test/spector/parameters/basic/src/implicit_body/generated/clients/basic_implicit_body_client.rs @@ -3,7 +3,9 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{BasicImplicitBodyClientSimpleOptions, SimpleRequest}; +use crate::implicit_body::generated::models::{ + BasicImplicitBodyClientSimpleOptions, SimpleRequest, +}; use azure_core::{ error::CheckSuccessOptions, http::{ diff --git a/packages/typespec-rust/test/spector/parameters/basic/src/implicit_body/generated/clients/mod.rs b/packages/typespec-rust/test/spector/parameters/basic/src/implicit_body/generated/clients/mod.rs new file mode 100644 index 000000000..8b445866b --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/basic/src/implicit_body/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod basic_implicit_body_client; +pub use basic_implicit_body_client::*; diff --git a/packages/typespec-rust/test/spector/parameters/basic/src/implicit_body/generated/mod.rs b/packages/typespec-rust/test/spector/parameters/basic/src/implicit_body/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/basic/src/implicit_body/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/parameters/basic/src/implicit_body/generated/models/method_options.rs b/packages/typespec-rust/test/spector/parameters/basic/src/implicit_body/generated/models/method_options.rs new file mode 100644 index 000000000..1ad1912de --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/basic/src/implicit_body/generated/models/method_options.rs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`BasicImplicitBodyClient::simple()`](crate::implicit_body::generated::clients::BasicImplicitBodyClient::simple()) +#[derive(Clone, Default, SafeDebug)] +pub struct BasicImplicitBodyClientSimpleOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/parameters/basic/src/implicit_body/generated/models/mod.rs b/packages/typespec-rust/test/spector/parameters/basic/src/implicit_body/generated/models/mod.rs new file mode 100644 index 000000000..b498cd366 --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/basic/src/implicit_body/generated/models/mod.rs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +mod models_impl; +pub use method_options::*; +#[allow(clippy::module_inception)] +pub(crate) mod models; +pub(crate) use models::*; diff --git a/packages/typespec-rust/test/spector/parameters/basic/src/implicit_body/generated/models/models.rs b/packages/typespec-rust/test/spector/parameters/basic/src/implicit_body/generated/models/models.rs new file mode 100644 index 000000000..2adc8b3f4 --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/basic/src/implicit_body/generated/models/models.rs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::fmt::SafeDebug; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Deserialize, SafeDebug, Serialize)] +pub(crate) struct SimpleRequest { + pub(crate) name: String, +} diff --git a/packages/typespec-rust/test/spector/parameters/basic/src/generated/models/models_impl.rs b/packages/typespec-rust/test/spector/parameters/basic/src/implicit_body/generated/models/models_impl.rs similarity index 67% rename from packages/typespec-rust/test/spector/parameters/basic/src/generated/models/models_impl.rs rename to packages/typespec-rust/test/spector/parameters/basic/src/implicit_body/generated/models/models_impl.rs index ad961a240..f74e70323 100644 --- a/packages/typespec-rust/test/spector/parameters/basic/src/generated/models/models_impl.rs +++ b/packages/typespec-rust/test/spector/parameters/basic/src/implicit_body/generated/models/models_impl.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use super::{SimpleRequest, User}; +use super::SimpleRequest; use azure_core::{http::RequestContent, json::to_json, Result}; impl TryFrom for RequestContent { @@ -12,10 +12,3 @@ impl TryFrom for RequestContent { Ok(to_json(&value)?.into()) } } - -impl TryFrom for RequestContent { - type Error = azure_core::Error; - fn try_from(value: User) -> Result { - Ok(to_json(&value)?.into()) - } -} diff --git a/packages/typespec-rust/test/spector/parameters/basic/src/implicit_body/mod.rs b/packages/typespec-rust/test/spector/parameters/basic/src/implicit_body/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/basic/src/implicit_body/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/parameters/basic/src/lib.rs b/packages/typespec-rust/test/spector/parameters/basic/src/lib.rs index cc784e401..fbbec8392 100644 --- a/packages/typespec-rust/test/spector/parameters/basic/src/lib.rs +++ b/packages/typespec-rust/test/spector/parameters/basic/src/lib.rs @@ -7,3 +7,5 @@ mod generated; pub use generated::*; +pub mod explicit_body; +pub mod implicit_body; diff --git a/packages/typespec-rust/test/spector/parameters/basic/tests/basic_explicit_body_client_test.rs b/packages/typespec-rust/test/spector/parameters/basic/tests/basic_explicit_body_client_test.rs index 0cd7c362d..adc39c91c 100644 --- a/packages/typespec-rust/test/spector/parameters/basic/tests/basic_explicit_body_client_test.rs +++ b/packages/typespec-rust/test/spector/parameters/basic/tests/basic_explicit_body_client_test.rs @@ -2,7 +2,7 @@ // // Licensed under the MIT License. See License.txt in the project root for license information. -use spector_basicparams::{models::User, BasicClient}; +use spector_basicparams::{explicit_body::models::User, BasicClient}; #[tokio::test] async fn simple() { diff --git a/packages/typespec-rust/test/spector/parameters/body-optionality/src/generated/clients/body_optionality_client.rs b/packages/typespec-rust/test/spector/parameters/body-optionality/src/generated/clients/body_optionality_client.rs index ab88bf52f..2a2c49d4b 100644 --- a/packages/typespec-rust/test/spector/parameters/body-optionality/src/generated/clients/body_optionality_client.rs +++ b/packages/typespec-rust/test/spector/parameters/body-optionality/src/generated/clients/body_optionality_client.rs @@ -3,12 +3,12 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::{ - clients::BodyOptionalityOptionalExplicitClient, - models::{ +use crate::{ + generated::models::{ BodyModel, BodyOptionalityClientRequiredExplicitOptions, BodyOptionalityClientRequiredImplicitOptions, }, + optional_explicit::clients::BodyOptionalityOptionalExplicitClient, }; use azure_core::{ error::CheckSuccessOptions, diff --git a/packages/typespec-rust/test/spector/parameters/body-optionality/src/generated/clients/mod.rs b/packages/typespec-rust/test/spector/parameters/body-optionality/src/generated/clients/mod.rs index b072506eb..a4896f690 100644 --- a/packages/typespec-rust/test/spector/parameters/body-optionality/src/generated/clients/mod.rs +++ b/packages/typespec-rust/test/spector/parameters/body-optionality/src/generated/clients/mod.rs @@ -4,6 +4,4 @@ // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. mod body_optionality_client; -mod body_optionality_optional_explicit_client; pub use body_optionality_client::*; -pub use body_optionality_optional_explicit_client::*; diff --git a/packages/typespec-rust/test/spector/parameters/body-optionality/src/generated/models/method_options.rs b/packages/typespec-rust/test/spector/parameters/body-optionality/src/generated/models/method_options.rs index f2c72dcda..0b74c2b95 100644 --- a/packages/typespec-rust/test/spector/parameters/body-optionality/src/generated/models/method_options.rs +++ b/packages/typespec-rust/test/spector/parameters/body-optionality/src/generated/models/method_options.rs @@ -3,11 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use super::BodyModel; -use azure_core::{ - fmt::SafeDebug, - http::{ClientMethodOptions, RequestContent}, -}; +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; /// Options to be passed to [`BodyOptionalityClient::required_explicit()`](crate::generated::clients::BodyOptionalityClient::required_explicit()) #[derive(Clone, Default, SafeDebug)] @@ -22,21 +18,3 @@ pub struct BodyOptionalityClientRequiredImplicitOptions<'a> { /// Allows customization of the method call. pub method_options: ClientMethodOptions<'a>, } - -/// Options to be passed to [`BodyOptionalityOptionalExplicitClient::omit()`](crate::generated::clients::BodyOptionalityOptionalExplicitClient::omit()) -#[derive(Clone, Default, SafeDebug)] -pub struct BodyOptionalityOptionalExplicitClientOmitOptions<'a> { - pub body: Option>, - - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`BodyOptionalityOptionalExplicitClient::set()`](crate::generated::clients::BodyOptionalityOptionalExplicitClient::set()) -#[derive(Clone, Default, SafeDebug)] -pub struct BodyOptionalityOptionalExplicitClientSetOptions<'a> { - pub body: Option>, - - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} diff --git a/packages/typespec-rust/test/spector/parameters/body-optionality/src/lib.rs b/packages/typespec-rust/test/spector/parameters/body-optionality/src/lib.rs index cc784e401..e0d0fceac 100644 --- a/packages/typespec-rust/test/spector/parameters/body-optionality/src/lib.rs +++ b/packages/typespec-rust/test/spector/parameters/body-optionality/src/lib.rs @@ -7,3 +7,4 @@ mod generated; pub use generated::*; +pub mod optional_explicit; diff --git a/packages/typespec-rust/test/spector/parameters/body-optionality/src/generated/clients/body_optionality_optional_explicit_client.rs b/packages/typespec-rust/test/spector/parameters/body-optionality/src/optional_explicit/generated/clients/body_optionality_optional_explicit_client.rs similarity index 98% rename from packages/typespec-rust/test/spector/parameters/body-optionality/src/generated/clients/body_optionality_optional_explicit_client.rs rename to packages/typespec-rust/test/spector/parameters/body-optionality/src/optional_explicit/generated/clients/body_optionality_optional_explicit_client.rs index fceffa554..d5f25fd32 100644 --- a/packages/typespec-rust/test/spector/parameters/body-optionality/src/generated/clients/body_optionality_optional_explicit_client.rs +++ b/packages/typespec-rust/test/spector/parameters/body-optionality/src/optional_explicit/generated/clients/body_optionality_optional_explicit_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::optional_explicit::generated::models::{ BodyOptionalityOptionalExplicitClientOmitOptions, BodyOptionalityOptionalExplicitClientSetOptions, }; diff --git a/packages/typespec-rust/test/spector/parameters/body-optionality/src/optional_explicit/generated/clients/mod.rs b/packages/typespec-rust/test/spector/parameters/body-optionality/src/optional_explicit/generated/clients/mod.rs new file mode 100644 index 000000000..e90a03a0a --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/body-optionality/src/optional_explicit/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod body_optionality_optional_explicit_client; +pub use body_optionality_optional_explicit_client::*; diff --git a/packages/typespec-rust/test/spector/parameters/body-optionality/src/optional_explicit/generated/mod.rs b/packages/typespec-rust/test/spector/parameters/body-optionality/src/optional_explicit/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/body-optionality/src/optional_explicit/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/parameters/body-optionality/src/optional_explicit/generated/models/method_options.rs b/packages/typespec-rust/test/spector/parameters/body-optionality/src/optional_explicit/generated/models/method_options.rs new file mode 100644 index 000000000..4d1070174 --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/body-optionality/src/optional_explicit/generated/models/method_options.rs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use crate::models::BodyModel; +use azure_core::{ + fmt::SafeDebug, + http::{ClientMethodOptions, RequestContent}, +}; + +/// Options to be passed to [`BodyOptionalityOptionalExplicitClient::omit()`](crate::optional_explicit::generated::clients::BodyOptionalityOptionalExplicitClient::omit()) +#[derive(Clone, Default, SafeDebug)] +pub struct BodyOptionalityOptionalExplicitClientOmitOptions<'a> { + pub body: Option>, + + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`BodyOptionalityOptionalExplicitClient::set()`](crate::optional_explicit::generated::clients::BodyOptionalityOptionalExplicitClient::set()) +#[derive(Clone, Default, SafeDebug)] +pub struct BodyOptionalityOptionalExplicitClientSetOptions<'a> { + pub body: Option>, + + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/parameters/body-optionality/src/optional_explicit/generated/models/mod.rs b/packages/typespec-rust/test/spector/parameters/body-optionality/src/optional_explicit/generated/models/mod.rs new file mode 100644 index 000000000..3e484b1ed --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/body-optionality/src/optional_explicit/generated/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/parameters/body-optionality/src/optional_explicit/mod.rs b/packages/typespec-rust/test/spector/parameters/body-optionality/src/optional_explicit/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/body-optionality/src/optional_explicit/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/parameters/body-optionality/tests/body_optionality_optional_explicit_client.rs b/packages/typespec-rust/test/spector/parameters/body-optionality/tests/body_optionality_optional_explicit_client.rs index 98782d100..472c632a8 100644 --- a/packages/typespec-rust/test/spector/parameters/body-optionality/tests/body_optionality_optional_explicit_client.rs +++ b/packages/typespec-rust/test/spector/parameters/body-optionality/tests/body_optionality_optional_explicit_client.rs @@ -3,7 +3,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. use spector_bodyoptional::{ - models::{BodyModel, BodyOptionalityOptionalExplicitClientSetOptions}, + models::BodyModel, optional_explicit::models::BodyOptionalityOptionalExplicitClientSetOptions, BodyOptionalityClient, }; diff --git a/packages/typespec-rust/test/spector/parameters/collection-format/src/generated/clients/collection_format_client.rs b/packages/typespec-rust/test/spector/parameters/collection-format/src/generated/clients/collection_format_client.rs index 8809a0ead..c449cc0a2 100644 --- a/packages/typespec-rust/test/spector/parameters/collection-format/src/generated/clients/collection_format_client.rs +++ b/packages/typespec-rust/test/spector/parameters/collection-format/src/generated/clients/collection_format_client.rs @@ -3,7 +3,9 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::clients::{CollectionFormatHeaderClient, CollectionFormatQueryClient}; +use crate::{ + header::clients::CollectionFormatHeaderClient, query::clients::CollectionFormatQueryClient, +}; use azure_core::{ fmt::SafeDebug, http::{ClientOptions, Pipeline, Url}, diff --git a/packages/typespec-rust/test/spector/parameters/collection-format/src/generated/clients/mod.rs b/packages/typespec-rust/test/spector/parameters/collection-format/src/generated/clients/mod.rs index c78490c55..0c6c771a8 100644 --- a/packages/typespec-rust/test/spector/parameters/collection-format/src/generated/clients/mod.rs +++ b/packages/typespec-rust/test/spector/parameters/collection-format/src/generated/clients/mod.rs @@ -4,8 +4,4 @@ // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. mod collection_format_client; -mod collection_format_header_client; -mod collection_format_query_client; pub use collection_format_client::*; -pub use collection_format_header_client::*; -pub use collection_format_query_client::*; diff --git a/packages/typespec-rust/test/spector/parameters/collection-format/src/generated/mod.rs b/packages/typespec-rust/test/spector/parameters/collection-format/src/generated/mod.rs index b3e148b8c..b193e93c7 100644 --- a/packages/typespec-rust/test/spector/parameters/collection-format/src/generated/mod.rs +++ b/packages/typespec-rust/test/spector/parameters/collection-format/src/generated/mod.rs @@ -5,6 +5,4 @@ /// Clients used to communicate with the service. pub mod clients; -/// Contains all the data structures and types used by the client library. -pub mod models; pub use clients::{CollectionFormatClient, CollectionFormatClientOptions}; diff --git a/packages/typespec-rust/test/spector/parameters/collection-format/src/generated/clients/collection_format_header_client.rs b/packages/typespec-rust/test/spector/parameters/collection-format/src/header/generated/clients/collection_format_header_client.rs similarity index 95% rename from packages/typespec-rust/test/spector/parameters/collection-format/src/generated/clients/collection_format_header_client.rs rename to packages/typespec-rust/test/spector/parameters/collection-format/src/header/generated/clients/collection_format_header_client.rs index 8b6329568..7dc36d747 100644 --- a/packages/typespec-rust/test/spector/parameters/collection-format/src/generated/clients/collection_format_header_client.rs +++ b/packages/typespec-rust/test/spector/parameters/collection-format/src/header/generated/clients/collection_format_header_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::CollectionFormatHeaderClientCsvOptions; +use crate::header::generated::models::CollectionFormatHeaderClientCsvOptions; use azure_core::{ error::CheckSuccessOptions, http::{Method, NoFormat, Pipeline, PipelineSendOptions, Request, Response, Url, UrlExt}, diff --git a/packages/typespec-rust/test/spector/parameters/collection-format/src/header/generated/clients/mod.rs b/packages/typespec-rust/test/spector/parameters/collection-format/src/header/generated/clients/mod.rs new file mode 100644 index 000000000..bec369146 --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/collection-format/src/header/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod collection_format_header_client; +pub use collection_format_header_client::*; diff --git a/packages/typespec-rust/test/spector/parameters/collection-format/src/header/generated/mod.rs b/packages/typespec-rust/test/spector/parameters/collection-format/src/header/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/collection-format/src/header/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/parameters/collection-format/src/header/generated/models/method_options.rs b/packages/typespec-rust/test/spector/parameters/collection-format/src/header/generated/models/method_options.rs new file mode 100644 index 000000000..c2c60d5e4 --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/collection-format/src/header/generated/models/method_options.rs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`CollectionFormatHeaderClient::csv()`](crate::header::generated::clients::CollectionFormatHeaderClient::csv()) +#[derive(Clone, Default, SafeDebug)] +pub struct CollectionFormatHeaderClientCsvOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/parameters/collection-format/src/header/generated/models/mod.rs b/packages/typespec-rust/test/spector/parameters/collection-format/src/header/generated/models/mod.rs new file mode 100644 index 000000000..3e484b1ed --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/collection-format/src/header/generated/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/parameters/collection-format/src/header/mod.rs b/packages/typespec-rust/test/spector/parameters/collection-format/src/header/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/collection-format/src/header/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/parameters/collection-format/src/lib.rs b/packages/typespec-rust/test/spector/parameters/collection-format/src/lib.rs index cc784e401..4a98050c0 100644 --- a/packages/typespec-rust/test/spector/parameters/collection-format/src/lib.rs +++ b/packages/typespec-rust/test/spector/parameters/collection-format/src/lib.rs @@ -7,3 +7,5 @@ mod generated; pub use generated::*; +pub mod header; +pub mod query; diff --git a/packages/typespec-rust/test/spector/parameters/collection-format/src/generated/clients/collection_format_query_client.rs b/packages/typespec-rust/test/spector/parameters/collection-format/src/query/generated/clients/collection_format_query_client.rs similarity index 99% rename from packages/typespec-rust/test/spector/parameters/collection-format/src/generated/clients/collection_format_query_client.rs rename to packages/typespec-rust/test/spector/parameters/collection-format/src/query/generated/clients/collection_format_query_client.rs index 3880834f3..b148dafd1 100644 --- a/packages/typespec-rust/test/spector/parameters/collection-format/src/generated/clients/collection_format_query_client.rs +++ b/packages/typespec-rust/test/spector/parameters/collection-format/src/query/generated/clients/collection_format_query_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::query::generated::models::{ CollectionFormatQueryClientCsvOptions, CollectionFormatQueryClientMultiOptions, CollectionFormatQueryClientPipesOptions, CollectionFormatQueryClientSsvOptions, }; diff --git a/packages/typespec-rust/test/spector/parameters/collection-format/src/query/generated/clients/mod.rs b/packages/typespec-rust/test/spector/parameters/collection-format/src/query/generated/clients/mod.rs new file mode 100644 index 000000000..a29816b9a --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/collection-format/src/query/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod collection_format_query_client; +pub use collection_format_query_client::*; diff --git a/packages/typespec-rust/test/spector/parameters/collection-format/src/query/generated/mod.rs b/packages/typespec-rust/test/spector/parameters/collection-format/src/query/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/collection-format/src/query/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/parameters/collection-format/src/generated/models/method_options.rs b/packages/typespec-rust/test/spector/parameters/collection-format/src/query/generated/models/method_options.rs similarity index 67% rename from packages/typespec-rust/test/spector/parameters/collection-format/src/generated/models/method_options.rs rename to packages/typespec-rust/test/spector/parameters/collection-format/src/query/generated/models/method_options.rs index be0f33f1f..5ade88fdf 100644 --- a/packages/typespec-rust/test/spector/parameters/collection-format/src/generated/models/method_options.rs +++ b/packages/typespec-rust/test/spector/parameters/collection-format/src/query/generated/models/method_options.rs @@ -5,35 +5,28 @@ use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; -/// Options to be passed to [`CollectionFormatHeaderClient::csv()`](crate::generated::clients::CollectionFormatHeaderClient::csv()) -#[derive(Clone, Default, SafeDebug)] -pub struct CollectionFormatHeaderClientCsvOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`CollectionFormatQueryClient::csv()`](crate::generated::clients::CollectionFormatQueryClient::csv()) +/// Options to be passed to [`CollectionFormatQueryClient::csv()`](crate::query::generated::clients::CollectionFormatQueryClient::csv()) #[derive(Clone, Default, SafeDebug)] pub struct CollectionFormatQueryClientCsvOptions<'a> { /// Allows customization of the method call. pub method_options: ClientMethodOptions<'a>, } -/// Options to be passed to [`CollectionFormatQueryClient::multi()`](crate::generated::clients::CollectionFormatQueryClient::multi()) +/// Options to be passed to [`CollectionFormatQueryClient::multi()`](crate::query::generated::clients::CollectionFormatQueryClient::multi()) #[derive(Clone, Default, SafeDebug)] pub struct CollectionFormatQueryClientMultiOptions<'a> { /// Allows customization of the method call. pub method_options: ClientMethodOptions<'a>, } -/// Options to be passed to [`CollectionFormatQueryClient::pipes()`](crate::generated::clients::CollectionFormatQueryClient::pipes()) +/// Options to be passed to [`CollectionFormatQueryClient::pipes()`](crate::query::generated::clients::CollectionFormatQueryClient::pipes()) #[derive(Clone, Default, SafeDebug)] pub struct CollectionFormatQueryClientPipesOptions<'a> { /// Allows customization of the method call. pub method_options: ClientMethodOptions<'a>, } -/// Options to be passed to [`CollectionFormatQueryClient::ssv()`](crate::generated::clients::CollectionFormatQueryClient::ssv()) +/// Options to be passed to [`CollectionFormatQueryClient::ssv()`](crate::query::generated::clients::CollectionFormatQueryClient::ssv()) #[derive(Clone, Default, SafeDebug)] pub struct CollectionFormatQueryClientSsvOptions<'a> { /// Allows customization of the method call. diff --git a/packages/typespec-rust/test/spector/parameters/collection-format/src/query/generated/models/mod.rs b/packages/typespec-rust/test/spector/parameters/collection-format/src/query/generated/models/mod.rs new file mode 100644 index 000000000..3e484b1ed --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/collection-format/src/query/generated/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/parameters/collection-format/src/query/mod.rs b/packages/typespec-rust/test/spector/parameters/collection-format/src/query/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/collection-format/src/query/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/parameters/spread/src/alias/generated/clients/mod.rs b/packages/typespec-rust/test/spector/parameters/spread/src/alias/generated/clients/mod.rs new file mode 100644 index 000000000..cf8c33a12 --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/spread/src/alias/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod spread_alias_client; +pub use spread_alias_client::*; diff --git a/packages/typespec-rust/test/spector/parameters/spread/src/generated/clients/spread_alias_client.rs b/packages/typespec-rust/test/spector/parameters/spread/src/alias/generated/clients/spread_alias_client.rs similarity index 94% rename from packages/typespec-rust/test/spector/parameters/spread/src/generated/clients/spread_alias_client.rs rename to packages/typespec-rust/test/spector/parameters/spread/src/alias/generated/clients/spread_alias_client.rs index f867b2c78..f589342f8 100644 --- a/packages/typespec-rust/test/spector/parameters/spread/src/generated/clients/spread_alias_client.rs +++ b/packages/typespec-rust/test/spector/parameters/spread/src/alias/generated/clients/spread_alias_client.rs @@ -3,13 +3,18 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ - SpreadAliasClientSpreadAsRequestBodyOptions, SpreadAliasClientSpreadAsRequestParameterOptions, - SpreadAliasClientSpreadParameterWithInnerAliasOptions, - SpreadAliasClientSpreadParameterWithInnerModelOptions, - SpreadAliasClientSpreadWithMultipleParametersOptions, SpreadAsRequestBodyRequest, - SpreadAsRequestParameterRequest, SpreadParameterWithInnerAliasRequest, - SpreadParameterWithInnerModelRequest, SpreadWithMultipleParametersRequest, +use crate::{ + alias::generated::models::{ + SpreadAliasClientSpreadAsRequestBodyOptions, + SpreadAliasClientSpreadAsRequestParameterOptions, + SpreadAliasClientSpreadParameterWithInnerAliasOptions, + SpreadAliasClientSpreadParameterWithInnerModelOptions, + SpreadAliasClientSpreadWithMultipleParametersOptions, SpreadAsRequestBodyRequest, + }, + models::{ + SpreadAsRequestParameterRequest, SpreadParameterWithInnerAliasRequest, + SpreadParameterWithInnerModelRequest, SpreadWithMultipleParametersRequest, + }, }; use azure_core::{ error::CheckSuccessOptions, diff --git a/packages/typespec-rust/test/spector/parameters/spread/src/alias/generated/mod.rs b/packages/typespec-rust/test/spector/parameters/spread/src/alias/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/spread/src/alias/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/parameters/spread/src/alias/generated/models/method_options.rs b/packages/typespec-rust/test/spector/parameters/spread/src/alias/generated/models/method_options.rs new file mode 100644 index 000000000..3f4e34208 --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/spread/src/alias/generated/models/method_options.rs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`SpreadAliasClient::spread_as_request_body()`](crate::alias::generated::clients::SpreadAliasClient::spread_as_request_body()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpreadAliasClientSpreadAsRequestBodyOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpreadAliasClient::spread_as_request_parameter()`](crate::alias::generated::clients::SpreadAliasClient::spread_as_request_parameter()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpreadAliasClientSpreadAsRequestParameterOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpreadAliasClient::spread_parameter_with_inner_alias()`](crate::alias::generated::clients::SpreadAliasClient::spread_parameter_with_inner_alias()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpreadAliasClientSpreadParameterWithInnerAliasOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpreadAliasClient::spread_parameter_with_inner_model()`](crate::alias::generated::clients::SpreadAliasClient::spread_parameter_with_inner_model()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpreadAliasClientSpreadParameterWithInnerModelOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpreadAliasClient::spread_with_multiple_parameters()`](crate::alias::generated::clients::SpreadAliasClient::spread_with_multiple_parameters()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpreadAliasClientSpreadWithMultipleParametersOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, + + /// optional int + pub optional_int: Option, + + /// optional string + pub optional_string_list: Option>, +} diff --git a/packages/typespec-rust/test/spector/parameters/spread/src/alias/generated/models/mod.rs b/packages/typespec-rust/test/spector/parameters/spread/src/alias/generated/models/mod.rs new file mode 100644 index 000000000..b498cd366 --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/spread/src/alias/generated/models/mod.rs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +mod models_impl; +pub use method_options::*; +#[allow(clippy::module_inception)] +pub(crate) mod models; +pub(crate) use models::*; diff --git a/packages/typespec-rust/test/spector/parameters/spread/src/alias/generated/models/models.rs b/packages/typespec-rust/test/spector/parameters/spread/src/alias/generated/models/models.rs new file mode 100644 index 000000000..4bbfb60b5 --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/spread/src/alias/generated/models/models.rs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::fmt::SafeDebug; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Deserialize, SafeDebug, Serialize)] +pub(crate) struct SpreadAsRequestBodyRequest { + pub(crate) name: String, +} diff --git a/packages/typespec-rust/test/spector/parameters/spread/src/alias/generated/models/models_impl.rs b/packages/typespec-rust/test/spector/parameters/spread/src/alias/generated/models/models_impl.rs new file mode 100644 index 000000000..5bc2ed241 --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/spread/src/alias/generated/models/models_impl.rs @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use super::SpreadAsRequestBodyRequest; +use azure_core::{http::RequestContent, json::to_json, Result}; + +impl TryFrom for RequestContent { + type Error = azure_core::Error; + fn try_from(value: SpreadAsRequestBodyRequest) -> Result { + Ok(to_json(&value)?.into()) + } +} diff --git a/packages/typespec-rust/test/spector/parameters/spread/src/alias/mod.rs b/packages/typespec-rust/test/spector/parameters/spread/src/alias/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/spread/src/alias/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/parameters/spread/src/generated/clients/mod.rs b/packages/typespec-rust/test/spector/parameters/spread/src/generated/clients/mod.rs index f8bceecd3..702fab065 100644 --- a/packages/typespec-rust/test/spector/parameters/spread/src/generated/clients/mod.rs +++ b/packages/typespec-rust/test/spector/parameters/spread/src/generated/clients/mod.rs @@ -3,9 +3,5 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -mod spread_alias_client; mod spread_client; -mod spread_model_client; -pub use spread_alias_client::*; pub use spread_client::*; -pub use spread_model_client::*; diff --git a/packages/typespec-rust/test/spector/parameters/spread/src/generated/clients/spread_client.rs b/packages/typespec-rust/test/spector/parameters/spread/src/generated/clients/spread_client.rs index ebdda0de8..0ec0d2ff8 100644 --- a/packages/typespec-rust/test/spector/parameters/spread/src/generated/clients/spread_client.rs +++ b/packages/typespec-rust/test/spector/parameters/spread/src/generated/clients/spread_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::clients::{SpreadAliasClient, SpreadModelClient}; +use crate::{alias::clients::SpreadAliasClient, model::clients::SpreadModelClient}; use azure_core::{ fmt::SafeDebug, http::{ClientOptions, Pipeline, Url}, diff --git a/packages/typespec-rust/test/spector/parameters/spread/src/generated/models/method_options.rs b/packages/typespec-rust/test/spector/parameters/spread/src/generated/models/method_options.rs deleted file mode 100644 index dbb004e04..000000000 --- a/packages/typespec-rust/test/spector/parameters/spread/src/generated/models/method_options.rs +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// -// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. - -use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; - -/// Options to be passed to [`SpreadAliasClient::spread_as_request_body()`](crate::generated::clients::SpreadAliasClient::spread_as_request_body()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpreadAliasClientSpreadAsRequestBodyOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpreadAliasClient::spread_as_request_parameter()`](crate::generated::clients::SpreadAliasClient::spread_as_request_parameter()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpreadAliasClientSpreadAsRequestParameterOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpreadAliasClient::spread_parameter_with_inner_alias()`](crate::generated::clients::SpreadAliasClient::spread_parameter_with_inner_alias()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpreadAliasClientSpreadParameterWithInnerAliasOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpreadAliasClient::spread_parameter_with_inner_model()`](crate::generated::clients::SpreadAliasClient::spread_parameter_with_inner_model()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpreadAliasClientSpreadParameterWithInnerModelOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpreadAliasClient::spread_with_multiple_parameters()`](crate::generated::clients::SpreadAliasClient::spread_with_multiple_parameters()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpreadAliasClientSpreadWithMultipleParametersOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, - - /// optional int - pub optional_int: Option, - - /// optional string - pub optional_string_list: Option>, -} - -/// Options to be passed to [`SpreadModelClient::spread_as_request_body()`](crate::generated::clients::SpreadModelClient::spread_as_request_body()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpreadModelClientSpreadAsRequestBodyOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpreadModelClient::spread_composite_request()`](crate::generated::clients::SpreadModelClient::spread_composite_request()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpreadModelClientSpreadCompositeRequestOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpreadModelClient::spread_composite_request_mix()`](crate::generated::clients::SpreadModelClient::spread_composite_request_mix()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpreadModelClientSpreadCompositeRequestMixOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpreadModelClient::spread_composite_request_only_with_body()`](crate::generated::clients::SpreadModelClient::spread_composite_request_only_with_body()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpreadModelClientSpreadCompositeRequestOnlyWithBodyOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpreadModelClient::spread_composite_request_without_body()`](crate::generated::clients::SpreadModelClient::spread_composite_request_without_body()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpreadModelClientSpreadCompositeRequestWithoutBodyOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} diff --git a/packages/typespec-rust/test/spector/parameters/spread/src/generated/models/mod.rs b/packages/typespec-rust/test/spector/parameters/spread/src/generated/models/mod.rs index 5dfb21b69..5827239eb 100644 --- a/packages/typespec-rust/test/spector/parameters/spread/src/generated/models/mod.rs +++ b/packages/typespec-rust/test/spector/parameters/spread/src/generated/models/mod.rs @@ -3,9 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -mod method_options; #[allow(clippy::module_inception)] -mod models; +pub(crate) mod models; mod models_impl; -pub use method_options::*; -pub use models::*; +pub(crate) use models::*; diff --git a/packages/typespec-rust/test/spector/parameters/spread/src/generated/models/models.rs b/packages/typespec-rust/test/spector/parameters/spread/src/generated/models/models.rs index d1b84d1ca..1a55ba9b4 100644 --- a/packages/typespec-rust/test/spector/parameters/spread/src/generated/models/models.rs +++ b/packages/typespec-rust/test/spector/parameters/spread/src/generated/models/models.rs @@ -6,18 +6,6 @@ use azure_core::fmt::SafeDebug; use serde::{Deserialize, Serialize}; -/// This is a simple model. -#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] -pub struct BodyParameter { - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -#[derive(Clone, Deserialize, SafeDebug, Serialize)] -pub(crate) struct SpreadAsRequestBodyRequest { - pub(crate) name: String, -} - #[derive(Clone, Deserialize, SafeDebug, Serialize)] pub(crate) struct SpreadAsRequestParameterRequest { pub(crate) name: String, diff --git a/packages/typespec-rust/test/spector/parameters/spread/src/generated/models/models_impl.rs b/packages/typespec-rust/test/spector/parameters/spread/src/generated/models/models_impl.rs index 1a3ff641e..f8a54e23a 100644 --- a/packages/typespec-rust/test/spector/parameters/spread/src/generated/models/models_impl.rs +++ b/packages/typespec-rust/test/spector/parameters/spread/src/generated/models/models_impl.rs @@ -4,26 +4,12 @@ // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. use super::{ - BodyParameter, SpreadAsRequestBodyRequest, SpreadAsRequestParameterRequest, - SpreadCompositeRequestMixRequest, SpreadParameterWithInnerAliasRequest, - SpreadParameterWithInnerModelRequest, SpreadWithMultipleParametersRequest, + SpreadAsRequestParameterRequest, SpreadCompositeRequestMixRequest, + SpreadParameterWithInnerAliasRequest, SpreadParameterWithInnerModelRequest, + SpreadWithMultipleParametersRequest, }; use azure_core::{http::RequestContent, json::to_json, Result}; -impl TryFrom for RequestContent { - type Error = azure_core::Error; - fn try_from(value: BodyParameter) -> Result { - Ok(to_json(&value)?.into()) - } -} - -impl TryFrom for RequestContent { - type Error = azure_core::Error; - fn try_from(value: SpreadAsRequestBodyRequest) -> Result { - Ok(to_json(&value)?.into()) - } -} - impl TryFrom for RequestContent { type Error = azure_core::Error; fn try_from(value: SpreadAsRequestParameterRequest) -> Result { diff --git a/packages/typespec-rust/test/spector/parameters/spread/src/lib.rs b/packages/typespec-rust/test/spector/parameters/spread/src/lib.rs index cc784e401..2e48b6f5e 100644 --- a/packages/typespec-rust/test/spector/parameters/spread/src/lib.rs +++ b/packages/typespec-rust/test/spector/parameters/spread/src/lib.rs @@ -7,3 +7,5 @@ mod generated; pub use generated::*; +pub mod alias; +pub mod model; diff --git a/packages/typespec-rust/test/spector/parameters/spread/src/model/generated/clients/mod.rs b/packages/typespec-rust/test/spector/parameters/spread/src/model/generated/clients/mod.rs new file mode 100644 index 000000000..9ff49c164 --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/spread/src/model/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod spread_model_client; +pub use spread_model_client::*; diff --git a/packages/typespec-rust/test/spector/parameters/spread/src/generated/clients/spread_model_client.rs b/packages/typespec-rust/test/spector/parameters/spread/src/model/generated/clients/spread_model_client.rs similarity index 95% rename from packages/typespec-rust/test/spector/parameters/spread/src/generated/clients/spread_model_client.rs rename to packages/typespec-rust/test/spector/parameters/spread/src/model/generated/clients/spread_model_client.rs index e5e9052e9..60915ac09 100644 --- a/packages/typespec-rust/test/spector/parameters/spread/src/generated/clients/spread_model_client.rs +++ b/packages/typespec-rust/test/spector/parameters/spread/src/model/generated/clients/spread_model_client.rs @@ -3,12 +3,15 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ - BodyParameter, SpreadCompositeRequestMixRequest, SpreadModelClientSpreadAsRequestBodyOptions, - SpreadModelClientSpreadCompositeRequestMixOptions, - SpreadModelClientSpreadCompositeRequestOnlyWithBodyOptions, - SpreadModelClientSpreadCompositeRequestOptions, - SpreadModelClientSpreadCompositeRequestWithoutBodyOptions, +use crate::{ + model::generated::models::{ + BodyParameter, SpreadModelClientSpreadAsRequestBodyOptions, + SpreadModelClientSpreadCompositeRequestMixOptions, + SpreadModelClientSpreadCompositeRequestOnlyWithBodyOptions, + SpreadModelClientSpreadCompositeRequestOptions, + SpreadModelClientSpreadCompositeRequestWithoutBodyOptions, + }, + models::SpreadCompositeRequestMixRequest, }; use azure_core::{ error::CheckSuccessOptions, diff --git a/packages/typespec-rust/test/spector/parameters/spread/src/model/generated/mod.rs b/packages/typespec-rust/test/spector/parameters/spread/src/model/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/spread/src/model/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/parameters/spread/src/model/generated/models/method_options.rs b/packages/typespec-rust/test/spector/parameters/spread/src/model/generated/models/method_options.rs new file mode 100644 index 000000000..1580e0de8 --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/spread/src/model/generated/models/method_options.rs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`SpreadModelClient::spread_as_request_body()`](crate::model::generated::clients::SpreadModelClient::spread_as_request_body()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpreadModelClientSpreadAsRequestBodyOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpreadModelClient::spread_composite_request()`](crate::model::generated::clients::SpreadModelClient::spread_composite_request()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpreadModelClientSpreadCompositeRequestOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpreadModelClient::spread_composite_request_mix()`](crate::model::generated::clients::SpreadModelClient::spread_composite_request_mix()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpreadModelClientSpreadCompositeRequestMixOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpreadModelClient::spread_composite_request_only_with_body()`](crate::model::generated::clients::SpreadModelClient::spread_composite_request_only_with_body()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpreadModelClientSpreadCompositeRequestOnlyWithBodyOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpreadModelClient::spread_composite_request_without_body()`](crate::model::generated::clients::SpreadModelClient::spread_composite_request_without_body()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpreadModelClientSpreadCompositeRequestWithoutBodyOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/parameters/spread/src/model/generated/models/mod.rs b/packages/typespec-rust/test/spector/parameters/spread/src/model/generated/models/mod.rs new file mode 100644 index 000000000..5dfb21b69 --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/spread/src/model/generated/models/mod.rs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +#[allow(clippy::module_inception)] +mod models; +mod models_impl; +pub use method_options::*; +pub use models::*; diff --git a/packages/typespec-rust/test/spector/parameters/spread/src/model/generated/models/models.rs b/packages/typespec-rust/test/spector/parameters/spread/src/model/generated/models/models.rs new file mode 100644 index 000000000..aa6859a03 --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/spread/src/model/generated/models/models.rs @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::fmt::SafeDebug; +use serde::{Deserialize, Serialize}; + +/// This is a simple model. +#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] +pub struct BodyParameter { + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, +} diff --git a/packages/typespec-rust/test/spector/parameters/spread/src/model/generated/models/models_impl.rs b/packages/typespec-rust/test/spector/parameters/spread/src/model/generated/models/models_impl.rs new file mode 100644 index 000000000..adb9bf4d7 --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/spread/src/model/generated/models/models_impl.rs @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use super::BodyParameter; +use azure_core::{http::RequestContent, json::to_json, Result}; + +impl TryFrom for RequestContent { + type Error = azure_core::Error; + fn try_from(value: BodyParameter) -> Result { + Ok(to_json(&value)?.into()) + } +} diff --git a/packages/typespec-rust/test/spector/parameters/spread/src/model/mod.rs b/packages/typespec-rust/test/spector/parameters/spread/src/model/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/parameters/spread/src/model/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/parameters/spread/tests/spread_alias_client_test.rs b/packages/typespec-rust/test/spector/parameters/spread/tests/spread_alias_client_test.rs index 6dc3482a7..bc0cca3a2 100644 --- a/packages/typespec-rust/test/spector/parameters/spread/tests/spread_alias_client_test.rs +++ b/packages/typespec-rust/test/spector/parameters/spread/tests/spread_alias_client_test.rs @@ -2,7 +2,9 @@ // // Licensed under the MIT License. See License.txt in the project root for license information. -use spector_spread::{models::SpreadAliasClientSpreadWithMultipleParametersOptions, SpreadClient}; +use spector_spread::{ + alias::models::SpreadAliasClientSpreadWithMultipleParametersOptions, SpreadClient, +}; #[tokio::test] async fn spread_as_request_body() { diff --git a/packages/typespec-rust/test/spector/parameters/spread/tests/spread_model_client_test.rs b/packages/typespec-rust/test/spector/parameters/spread/tests/spread_model_client_test.rs index ad14495e6..2b9b9ed1a 100644 --- a/packages/typespec-rust/test/spector/parameters/spread/tests/spread_model_client_test.rs +++ b/packages/typespec-rust/test/spector/parameters/spread/tests/spread_model_client_test.rs @@ -2,7 +2,7 @@ // // Licensed under the MIT License. See License.txt in the project root for license information. -use spector_spread::{models::BodyParameter, SpreadClient}; +use spector_spread::{model::models::BodyParameter, SpreadClient}; #[tokio::test] async fn spread_as_request_body() { diff --git a/packages/typespec-rust/test/spector/payload/content-negotiation/src/generated/clients/content_negotiation_different_body_client.rs b/packages/typespec-rust/test/spector/payload/content-negotiation/src/different_body/generated/clients/content_negotiation_different_body_client.rs similarity index 98% rename from packages/typespec-rust/test/spector/payload/content-negotiation/src/generated/clients/content_negotiation_different_body_client.rs rename to packages/typespec-rust/test/spector/payload/content-negotiation/src/different_body/generated/clients/content_negotiation_different_body_client.rs index 90c4b75ba..5e724e783 100644 --- a/packages/typespec-rust/test/spector/payload/content-negotiation/src/generated/clients/content_negotiation_different_body_client.rs +++ b/packages/typespec-rust/test/spector/payload/content-negotiation/src/different_body/generated/clients/content_negotiation_different_body_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::different_body::generated::models::{ ContentNegotiationDifferentBodyClientGetAvatarAsJsonOptions, ContentNegotiationDifferentBodyClientGetAvatarAsPngOptions, PngImageAsJson, }; diff --git a/packages/typespec-rust/test/spector/payload/content-negotiation/src/different_body/generated/clients/mod.rs b/packages/typespec-rust/test/spector/payload/content-negotiation/src/different_body/generated/clients/mod.rs new file mode 100644 index 000000000..897e6048f --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/content-negotiation/src/different_body/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod content_negotiation_different_body_client; +pub use content_negotiation_different_body_client::*; diff --git a/packages/typespec-rust/test/spector/payload/content-negotiation/src/different_body/generated/mod.rs b/packages/typespec-rust/test/spector/payload/content-negotiation/src/different_body/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/content-negotiation/src/different_body/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/payload/content-negotiation/src/different_body/generated/models/method_options.rs b/packages/typespec-rust/test/spector/payload/content-negotiation/src/different_body/generated/models/method_options.rs new file mode 100644 index 000000000..78a7c945f --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/content-negotiation/src/different_body/generated/models/method_options.rs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`ContentNegotiationDifferentBodyClient::get_avatar_as_json()`](crate::different_body::generated::clients::ContentNegotiationDifferentBodyClient::get_avatar_as_json()) +#[derive(Clone, Default, SafeDebug)] +pub struct ContentNegotiationDifferentBodyClientGetAvatarAsJsonOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`ContentNegotiationDifferentBodyClient::get_avatar_as_png()`](crate::different_body::generated::clients::ContentNegotiationDifferentBodyClient::get_avatar_as_png()) +#[derive(Clone, Default, SafeDebug)] +pub struct ContentNegotiationDifferentBodyClientGetAvatarAsPngOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/payload/content-negotiation/src/generated/models/mod.rs b/packages/typespec-rust/test/spector/payload/content-negotiation/src/different_body/generated/models/mod.rs similarity index 100% rename from packages/typespec-rust/test/spector/payload/content-negotiation/src/generated/models/mod.rs rename to packages/typespec-rust/test/spector/payload/content-negotiation/src/different_body/generated/models/mod.rs diff --git a/packages/typespec-rust/test/spector/payload/content-negotiation/src/generated/models/models.rs b/packages/typespec-rust/test/spector/payload/content-negotiation/src/different_body/generated/models/models.rs similarity index 100% rename from packages/typespec-rust/test/spector/payload/content-negotiation/src/generated/models/models.rs rename to packages/typespec-rust/test/spector/payload/content-negotiation/src/different_body/generated/models/models.rs diff --git a/packages/typespec-rust/test/spector/payload/content-negotiation/src/generated/models/models_serde.rs b/packages/typespec-rust/test/spector/payload/content-negotiation/src/different_body/generated/models/models_serde.rs similarity index 100% rename from packages/typespec-rust/test/spector/payload/content-negotiation/src/generated/models/models_serde.rs rename to packages/typespec-rust/test/spector/payload/content-negotiation/src/different_body/generated/models/models_serde.rs diff --git a/packages/typespec-rust/test/spector/payload/content-negotiation/src/different_body/mod.rs b/packages/typespec-rust/test/spector/payload/content-negotiation/src/different_body/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/content-negotiation/src/different_body/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/payload/content-negotiation/src/generated/clients/content_negotiation_client.rs b/packages/typespec-rust/test/spector/payload/content-negotiation/src/generated/clients/content_negotiation_client.rs index 96b43bc66..db3f81361 100644 --- a/packages/typespec-rust/test/spector/payload/content-negotiation/src/generated/clients/content_negotiation_client.rs +++ b/packages/typespec-rust/test/spector/payload/content-negotiation/src/generated/clients/content_negotiation_client.rs @@ -3,8 +3,9 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::clients::{ - ContentNegotiationDifferentBodyClient, ContentNegotiationSameBodyClient, +use crate::{ + different_body::clients::ContentNegotiationDifferentBodyClient, + same_body::clients::ContentNegotiationSameBodyClient, }; use azure_core::{ fmt::SafeDebug, diff --git a/packages/typespec-rust/test/spector/payload/content-negotiation/src/generated/clients/mod.rs b/packages/typespec-rust/test/spector/payload/content-negotiation/src/generated/clients/mod.rs index 285ccbcc3..acd41e4e4 100644 --- a/packages/typespec-rust/test/spector/payload/content-negotiation/src/generated/clients/mod.rs +++ b/packages/typespec-rust/test/spector/payload/content-negotiation/src/generated/clients/mod.rs @@ -4,8 +4,4 @@ // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. mod content_negotiation_client; -mod content_negotiation_different_body_client; -mod content_negotiation_same_body_client; pub use content_negotiation_client::*; -pub use content_negotiation_different_body_client::*; -pub use content_negotiation_same_body_client::*; diff --git a/packages/typespec-rust/test/spector/payload/content-negotiation/src/generated/mod.rs b/packages/typespec-rust/test/spector/payload/content-negotiation/src/generated/mod.rs index a68c608f9..96ebd962b 100644 --- a/packages/typespec-rust/test/spector/payload/content-negotiation/src/generated/mod.rs +++ b/packages/typespec-rust/test/spector/payload/content-negotiation/src/generated/mod.rs @@ -5,6 +5,4 @@ /// Clients used to communicate with the service. pub mod clients; -/// Contains all the data structures and types used by the client library. -pub mod models; pub use clients::{ContentNegotiationClient, ContentNegotiationClientOptions}; diff --git a/packages/typespec-rust/test/spector/payload/content-negotiation/src/generated/models/method_options.rs b/packages/typespec-rust/test/spector/payload/content-negotiation/src/generated/models/method_options.rs deleted file mode 100644 index dbc375058..000000000 --- a/packages/typespec-rust/test/spector/payload/content-negotiation/src/generated/models/method_options.rs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// -// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. - -use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; - -/// Options to be passed to [`ContentNegotiationDifferentBodyClient::get_avatar_as_json()`](crate::generated::clients::ContentNegotiationDifferentBodyClient::get_avatar_as_json()) -#[derive(Clone, Default, SafeDebug)] -pub struct ContentNegotiationDifferentBodyClientGetAvatarAsJsonOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`ContentNegotiationDifferentBodyClient::get_avatar_as_png()`](crate::generated::clients::ContentNegotiationDifferentBodyClient::get_avatar_as_png()) -#[derive(Clone, Default, SafeDebug)] -pub struct ContentNegotiationDifferentBodyClientGetAvatarAsPngOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`ContentNegotiationSameBodyClient::get_avatar_as_jpeg()`](crate::generated::clients::ContentNegotiationSameBodyClient::get_avatar_as_jpeg()) -#[derive(Clone, Default, SafeDebug)] -pub struct ContentNegotiationSameBodyClientGetAvatarAsJpegOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`ContentNegotiationSameBodyClient::get_avatar_as_png()`](crate::generated::clients::ContentNegotiationSameBodyClient::get_avatar_as_png()) -#[derive(Clone, Default, SafeDebug)] -pub struct ContentNegotiationSameBodyClientGetAvatarAsPngOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} diff --git a/packages/typespec-rust/test/spector/payload/content-negotiation/src/lib.rs b/packages/typespec-rust/test/spector/payload/content-negotiation/src/lib.rs index cc784e401..4d0204b52 100644 --- a/packages/typespec-rust/test/spector/payload/content-negotiation/src/lib.rs +++ b/packages/typespec-rust/test/spector/payload/content-negotiation/src/lib.rs @@ -7,3 +7,5 @@ mod generated; pub use generated::*; +pub mod different_body; +pub mod same_body; diff --git a/packages/typespec-rust/test/spector/payload/content-negotiation/src/generated/clients/content_negotiation_same_body_client.rs b/packages/typespec-rust/test/spector/payload/content-negotiation/src/same_body/generated/clients/content_negotiation_same_body_client.rs similarity index 98% rename from packages/typespec-rust/test/spector/payload/content-negotiation/src/generated/clients/content_negotiation_same_body_client.rs rename to packages/typespec-rust/test/spector/payload/content-negotiation/src/same_body/generated/clients/content_negotiation_same_body_client.rs index 6c5bbf58c..4d4bb0adc 100644 --- a/packages/typespec-rust/test/spector/payload/content-negotiation/src/generated/clients/content_negotiation_same_body_client.rs +++ b/packages/typespec-rust/test/spector/payload/content-negotiation/src/same_body/generated/clients/content_negotiation_same_body_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::same_body::generated::models::{ ContentNegotiationSameBodyClientGetAvatarAsJpegOptions, ContentNegotiationSameBodyClientGetAvatarAsPngOptions, }; diff --git a/packages/typespec-rust/test/spector/payload/content-negotiation/src/same_body/generated/clients/mod.rs b/packages/typespec-rust/test/spector/payload/content-negotiation/src/same_body/generated/clients/mod.rs new file mode 100644 index 000000000..9b3530760 --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/content-negotiation/src/same_body/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod content_negotiation_same_body_client; +pub use content_negotiation_same_body_client::*; diff --git a/packages/typespec-rust/test/spector/payload/content-negotiation/src/same_body/generated/mod.rs b/packages/typespec-rust/test/spector/payload/content-negotiation/src/same_body/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/content-negotiation/src/same_body/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/payload/content-negotiation/src/same_body/generated/models/method_options.rs b/packages/typespec-rust/test/spector/payload/content-negotiation/src/same_body/generated/models/method_options.rs new file mode 100644 index 000000000..b66d31146 --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/content-negotiation/src/same_body/generated/models/method_options.rs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`ContentNegotiationSameBodyClient::get_avatar_as_jpeg()`](crate::same_body::generated::clients::ContentNegotiationSameBodyClient::get_avatar_as_jpeg()) +#[derive(Clone, Default, SafeDebug)] +pub struct ContentNegotiationSameBodyClientGetAvatarAsJpegOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`ContentNegotiationSameBodyClient::get_avatar_as_png()`](crate::same_body::generated::clients::ContentNegotiationSameBodyClient::get_avatar_as_png()) +#[derive(Clone, Default, SafeDebug)] +pub struct ContentNegotiationSameBodyClientGetAvatarAsPngOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/payload/content-negotiation/src/same_body/generated/models/mod.rs b/packages/typespec-rust/test/spector/payload/content-negotiation/src/same_body/generated/models/mod.rs new file mode 100644 index 000000000..3e484b1ed --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/content-negotiation/src/same_body/generated/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/payload/content-negotiation/src/same_body/mod.rs b/packages/typespec-rust/test/spector/payload/content-negotiation/src/same_body/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/content-negotiation/src/same_body/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/payload/content-negotiation/tests/content_negotiation_different_body_test.rs b/packages/typespec-rust/test/spector/payload/content-negotiation/tests/content_negotiation_different_body_test.rs index 0fa450c9c..393d94255 100644 --- a/packages/typespec-rust/test/spector/payload/content-negotiation/tests/content_negotiation_different_body_test.rs +++ b/packages/typespec-rust/test/spector/payload/content-negotiation/tests/content_negotiation_different_body_test.rs @@ -2,7 +2,7 @@ // // Licensed under the MIT License. See License.txt in the project root for license information. -use spector_contentneg::{models::PngImageAsJson, ContentNegotiationClient}; +use spector_contentneg::{different_body::models::PngImageAsJson, ContentNegotiationClient}; use std::fs; #[tokio::test] diff --git a/packages/typespec-rust/test/spector/payload/media-type/src/generated/clients/media_type_client.rs b/packages/typespec-rust/test/spector/payload/media-type/src/generated/clients/media_type_client.rs index ba8fa530a..e0a9ce92a 100644 --- a/packages/typespec-rust/test/spector/payload/media-type/src/generated/clients/media_type_client.rs +++ b/packages/typespec-rust/test/spector/payload/media-type/src/generated/clients/media_type_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::clients::MediaTypeStringBodyClient; +use crate::string_body::clients::MediaTypeStringBodyClient; use azure_core::{ fmt::SafeDebug, http::{ClientOptions, Pipeline, Url}, diff --git a/packages/typespec-rust/test/spector/payload/media-type/src/generated/clients/mod.rs b/packages/typespec-rust/test/spector/payload/media-type/src/generated/clients/mod.rs index e12decd18..e1e4f0be4 100644 --- a/packages/typespec-rust/test/spector/payload/media-type/src/generated/clients/mod.rs +++ b/packages/typespec-rust/test/spector/payload/media-type/src/generated/clients/mod.rs @@ -4,6 +4,4 @@ // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. mod media_type_client; -mod media_type_string_body_client; pub use media_type_client::*; -pub use media_type_string_body_client::*; diff --git a/packages/typespec-rust/test/spector/payload/media-type/src/generated/mod.rs b/packages/typespec-rust/test/spector/payload/media-type/src/generated/mod.rs index 6118da06e..0e174b17a 100644 --- a/packages/typespec-rust/test/spector/payload/media-type/src/generated/mod.rs +++ b/packages/typespec-rust/test/spector/payload/media-type/src/generated/mod.rs @@ -5,6 +5,4 @@ /// Clients used to communicate with the service. pub mod clients; -/// Contains all the data structures and types used by the client library. -pub mod models; pub use clients::{MediaTypeClient, MediaTypeClientOptions}; diff --git a/packages/typespec-rust/test/spector/payload/media-type/src/lib.rs b/packages/typespec-rust/test/spector/payload/media-type/src/lib.rs index cc784e401..0307d9b15 100644 --- a/packages/typespec-rust/test/spector/payload/media-type/src/lib.rs +++ b/packages/typespec-rust/test/spector/payload/media-type/src/lib.rs @@ -7,3 +7,4 @@ mod generated; pub use generated::*; +pub mod string_body; diff --git a/packages/typespec-rust/test/spector/payload/media-type/src/generated/clients/media_type_string_body_client.rs b/packages/typespec-rust/test/spector/payload/media-type/src/string_body/generated/clients/media_type_string_body_client.rs similarity index 99% rename from packages/typespec-rust/test/spector/payload/media-type/src/generated/clients/media_type_string_body_client.rs rename to packages/typespec-rust/test/spector/payload/media-type/src/string_body/generated/clients/media_type_string_body_client.rs index ab84ead36..8d6ea8875 100644 --- a/packages/typespec-rust/test/spector/payload/media-type/src/generated/clients/media_type_string_body_client.rs +++ b/packages/typespec-rust/test/spector/payload/media-type/src/string_body/generated/clients/media_type_string_body_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::string_body::generated::models::{ MediaTypeStringBodyClientGetAsJsonOptions, MediaTypeStringBodyClientGetAsTextOptions, MediaTypeStringBodyClientSendAsJsonOptions, MediaTypeStringBodyClientSendAsTextOptions, }; diff --git a/packages/typespec-rust/test/spector/payload/media-type/src/string_body/generated/clients/mod.rs b/packages/typespec-rust/test/spector/payload/media-type/src/string_body/generated/clients/mod.rs new file mode 100644 index 000000000..08ad43bb0 --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/media-type/src/string_body/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod media_type_string_body_client; +pub use media_type_string_body_client::*; diff --git a/packages/typespec-rust/test/spector/payload/media-type/src/string_body/generated/mod.rs b/packages/typespec-rust/test/spector/payload/media-type/src/string_body/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/media-type/src/string_body/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/payload/media-type/src/generated/models/method_options.rs b/packages/typespec-rust/test/spector/payload/media-type/src/string_body/generated/models/method_options.rs similarity index 77% rename from packages/typespec-rust/test/spector/payload/media-type/src/generated/models/method_options.rs rename to packages/typespec-rust/test/spector/payload/media-type/src/string_body/generated/models/method_options.rs index 116a5e093..81b50ee11 100644 --- a/packages/typespec-rust/test/spector/payload/media-type/src/generated/models/method_options.rs +++ b/packages/typespec-rust/test/spector/payload/media-type/src/string_body/generated/models/method_options.rs @@ -5,28 +5,28 @@ use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; -/// Options to be passed to [`MediaTypeStringBodyClient::get_as_json()`](crate::generated::clients::MediaTypeStringBodyClient::get_as_json()) +/// Options to be passed to [`MediaTypeStringBodyClient::get_as_json()`](crate::string_body::generated::clients::MediaTypeStringBodyClient::get_as_json()) #[derive(Clone, Default, SafeDebug)] pub struct MediaTypeStringBodyClientGetAsJsonOptions<'a> { /// Allows customization of the method call. pub method_options: ClientMethodOptions<'a>, } -/// Options to be passed to [`MediaTypeStringBodyClient::get_as_text()`](crate::generated::clients::MediaTypeStringBodyClient::get_as_text()) +/// Options to be passed to [`MediaTypeStringBodyClient::get_as_text()`](crate::string_body::generated::clients::MediaTypeStringBodyClient::get_as_text()) #[derive(Clone, Default, SafeDebug)] pub struct MediaTypeStringBodyClientGetAsTextOptions<'a> { /// Allows customization of the method call. pub method_options: ClientMethodOptions<'a>, } -/// Options to be passed to [`MediaTypeStringBodyClient::send_as_json()`](crate::generated::clients::MediaTypeStringBodyClient::send_as_json()) +/// Options to be passed to [`MediaTypeStringBodyClient::send_as_json()`](crate::string_body::generated::clients::MediaTypeStringBodyClient::send_as_json()) #[derive(Clone, Default, SafeDebug)] pub struct MediaTypeStringBodyClientSendAsJsonOptions<'a> { /// Allows customization of the method call. pub method_options: ClientMethodOptions<'a>, } -/// Options to be passed to [`MediaTypeStringBodyClient::send_as_text()`](crate::generated::clients::MediaTypeStringBodyClient::send_as_text()) +/// Options to be passed to [`MediaTypeStringBodyClient::send_as_text()`](crate::string_body::generated::clients::MediaTypeStringBodyClient::send_as_text()) #[derive(Clone, Default, SafeDebug)] pub struct MediaTypeStringBodyClientSendAsTextOptions<'a> { /// Allows customization of the method call. diff --git a/packages/typespec-rust/test/spector/payload/media-type/src/string_body/generated/models/mod.rs b/packages/typespec-rust/test/spector/payload/media-type/src/string_body/generated/models/mod.rs new file mode 100644 index 000000000..3e484b1ed --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/media-type/src/string_body/generated/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/payload/media-type/src/string_body/mod.rs b/packages/typespec-rust/test/spector/payload/media-type/src/string_body/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/media-type/src/string_body/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/generated/clients/mod.rs b/packages/typespec-rust/test/spector/payload/pageable/src/generated/clients/mod.rs index 5f7faa01b..d12f8999f 100644 --- a/packages/typespec-rust/test/spector/payload/pageable/src/generated/clients/mod.rs +++ b/packages/typespec-rust/test/spector/payload/pageable/src/generated/clients/mod.rs @@ -4,12 +4,4 @@ // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. mod pageable_client; -mod pageable_page_size_client; -mod pageable_server_driven_pagination_client; -mod pageable_server_driven_pagination_continuation_token_client; -mod pageable_xml_pagination_client; pub use pageable_client::*; -pub use pageable_page_size_client::*; -pub use pageable_server_driven_pagination_client::*; -pub use pageable_server_driven_pagination_continuation_token_client::*; -pub use pageable_xml_pagination_client::*; diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/generated/clients/pageable_client.rs b/packages/typespec-rust/test/spector/payload/pageable/src/generated/clients/pageable_client.rs index 9e21705a8..6bf083e6d 100644 --- a/packages/typespec-rust/test/spector/payload/pageable/src/generated/clients/pageable_client.rs +++ b/packages/typespec-rust/test/spector/payload/pageable/src/generated/clients/pageable_client.rs @@ -3,8 +3,10 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::clients::{ - PageablePageSizeClient, PageableServerDrivenPaginationClient, PageableXmlPaginationClient, +use crate::{ + page_size::clients::PageablePageSizeClient, + server_driven_pagination::clients::PageableServerDrivenPaginationClient, + xml_pagination::clients::PageableXmlPaginationClient, }; use azure_core::{ fmt::SafeDebug, diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/generated/models/mod.rs b/packages/typespec-rust/test/spector/payload/pageable/src/generated/models/mod.rs index cd5ec462d..f55c2d015 100644 --- a/packages/typespec-rust/test/spector/payload/pageable/src/generated/models/mod.rs +++ b/packages/typespec-rust/test/spector/payload/pageable/src/generated/models/mod.rs @@ -3,12 +3,8 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -mod header_traits; -mod method_options; #[allow(clippy::module_inception)] mod models; mod models_impl; mod xml_helpers; -pub use header_traits::*; -pub use method_options::*; pub use models::*; diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/generated/models/models.rs b/packages/typespec-rust/test/spector/payload/pageable/src/generated/models/models.rs index 609d34aa6..b2c726b8d 100644 --- a/packages/typespec-rust/test/spector/payload/pageable/src/generated/models/models.rs +++ b/packages/typespec-rust/test/spector/payload/pageable/src/generated/models/models.rs @@ -7,64 +7,6 @@ use super::xml_helpers::PetsPet; use azure_core::fmt::SafeDebug; use serde::{Deserialize, Serialize}; -#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] -#[non_exhaustive] -pub struct LinkResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub next: Option, - - #[serde(default)] - pub pets: Vec, -} - -#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] -#[non_exhaustive] -pub struct LinkStringResponse { - #[serde(skip_serializing_if = "Option::is_none")] - pub next: Option, - - #[serde(default)] - pub pets: Vec, -} - -#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] -#[non_exhaustive] -pub struct ListWithPageSizeResponse { - #[serde(default)] - pub pets: Vec, -} - -#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] -#[non_exhaustive] -pub struct ListWithoutContinuationResponse { - #[serde(default)] - pub pets: Vec, -} - -#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] -#[non_exhaustive] -pub struct NestedLinkResponse { - #[serde(default, rename = "nestedItems")] - pub nested_items: NestedLinkResponseNestedItems, - - #[serde(rename = "nestedNext", skip_serializing_if = "Option::is_none")] - pub nested_next: Option, -} - -#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] -#[non_exhaustive] -pub struct NestedLinkResponseNestedItems { - #[serde(default)] - pub pets: Vec, -} - -#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] -#[non_exhaustive] -pub struct NestedLinkResponseNestedNext { - #[serde(skip_serializing_if = "Option::is_none")] - pub next: Option, -} - #[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] #[non_exhaustive] pub struct Pet { @@ -75,40 +17,6 @@ pub struct Pet { pub name: Option, } -#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] -#[non_exhaustive] -pub struct RequestHeaderNestedResponseBodyResponse { - #[serde(default, rename = "nestedItems")] - pub nested_items: RequestHeaderNestedResponseBodyResponseNestedItems, - - #[serde(rename = "nestedNext", skip_serializing_if = "Option::is_none")] - pub nested_next: Option, -} - -#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] -#[non_exhaustive] -pub struct RequestHeaderNestedResponseBodyResponseNestedItems { - #[serde(default)] - pub pets: Vec, -} - -#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] -#[non_exhaustive] -pub struct RequestHeaderNestedResponseBodyResponseNestedNext { - #[serde(rename = "nextToken", skip_serializing_if = "Option::is_none")] - pub next_token: Option, -} - -#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] -#[non_exhaustive] -pub struct RequestHeaderResponseBodyResponse { - #[serde(rename = "nextToken", skip_serializing_if = "Option::is_none")] - pub next_token: Option, - - #[serde(default)] - pub pets: Vec, -} - #[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] #[non_exhaustive] pub struct RequestHeaderResponseHeaderResponse { @@ -116,40 +24,6 @@ pub struct RequestHeaderResponseHeaderResponse { pub pets: Vec, } -#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] -#[non_exhaustive] -pub struct RequestQueryNestedResponseBodyResponse { - #[serde(default, rename = "nestedItems")] - pub nested_items: RequestQueryNestedResponseBodyResponseNestedItems, - - #[serde(rename = "nestedNext", skip_serializing_if = "Option::is_none")] - pub nested_next: Option, -} - -#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] -#[non_exhaustive] -pub struct RequestQueryNestedResponseBodyResponseNestedItems { - #[serde(default)] - pub pets: Vec, -} - -#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] -#[non_exhaustive] -pub struct RequestQueryNestedResponseBodyResponseNestedNext { - #[serde(rename = "nextToken", skip_serializing_if = "Option::is_none")] - pub next_token: Option, -} - -#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] -#[non_exhaustive] -pub struct RequestQueryResponseBodyResponse { - #[serde(rename = "nextToken", skip_serializing_if = "Option::is_none")] - pub next_token: Option, - - #[serde(default)] - pub pets: Vec, -} - #[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] #[non_exhaustive] pub struct RequestQueryResponseHeaderResponse { diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/generated/models/models_impl.rs b/packages/typespec-rust/test/spector/payload/pageable/src/generated/models/models_impl.rs index e2483ace3..07a658e51 100644 --- a/packages/typespec-rust/test/spector/payload/pageable/src/generated/models/models_impl.rs +++ b/packages/typespec-rust/test/spector/payload/pageable/src/generated/models/models_impl.rs @@ -4,78 +4,12 @@ // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. use super::{ - LinkResponse, LinkStringResponse, ListWithPageSizeResponse, ListWithoutContinuationResponse, - NestedLinkResponse, Pet, RequestHeaderNestedResponseBodyResponse, - RequestHeaderResponseBodyResponse, RequestHeaderResponseHeaderResponse, - RequestQueryNestedResponseBodyResponse, RequestQueryResponseBodyResponse, - RequestQueryResponseHeaderResponse, XmlPet, XmlPetListResult, XmlPetListResultWithNextLink, + Pet, RequestHeaderResponseHeaderResponse, RequestQueryResponseHeaderResponse, XmlPet, + XmlPetListResult, XmlPetListResultWithNextLink, }; use async_trait::async_trait; use azure_core::{http::pager::Page, Result}; -#[async_trait] -impl Page for LinkResponse { - type Item = Pet; - type IntoIter = as IntoIterator>::IntoIter; - async fn into_items(self) -> Result { - Ok(self.pets.into_iter()) - } -} - -#[async_trait] -impl Page for LinkStringResponse { - type Item = Pet; - type IntoIter = as IntoIterator>::IntoIter; - async fn into_items(self) -> Result { - Ok(self.pets.into_iter()) - } -} - -#[async_trait] -impl Page for ListWithPageSizeResponse { - type Item = Pet; - type IntoIter = as IntoIterator>::IntoIter; - async fn into_items(self) -> Result { - Ok(self.pets.into_iter()) - } -} - -#[async_trait] -impl Page for ListWithoutContinuationResponse { - type Item = Pet; - type IntoIter = as IntoIterator>::IntoIter; - async fn into_items(self) -> Result { - Ok(self.pets.into_iter()) - } -} - -#[async_trait] -impl Page for NestedLinkResponse { - type Item = Pet; - type IntoIter = as IntoIterator>::IntoIter; - async fn into_items(self) -> Result { - Ok(self.nested_items.pets.into_iter()) - } -} - -#[async_trait] -impl Page for RequestHeaderNestedResponseBodyResponse { - type Item = Pet; - type IntoIter = as IntoIterator>::IntoIter; - async fn into_items(self) -> Result { - Ok(self.nested_items.pets.into_iter()) - } -} - -#[async_trait] -impl Page for RequestHeaderResponseBodyResponse { - type Item = Pet; - type IntoIter = as IntoIterator>::IntoIter; - async fn into_items(self) -> Result { - Ok(self.pets.into_iter()) - } -} - #[async_trait] impl Page for RequestHeaderResponseHeaderResponse { type Item = Pet; @@ -85,24 +19,6 @@ impl Page for RequestHeaderResponseHeaderResponse { } } -#[async_trait] -impl Page for RequestQueryNestedResponseBodyResponse { - type Item = Pet; - type IntoIter = as IntoIterator>::IntoIter; - async fn into_items(self) -> Result { - Ok(self.nested_items.pets.into_iter()) - } -} - -#[async_trait] -impl Page for RequestQueryResponseBodyResponse { - type Item = Pet; - type IntoIter = as IntoIterator>::IntoIter; - async fn into_items(self) -> Result { - Ok(self.pets.into_iter()) - } -} - #[async_trait] impl Page for RequestQueryResponseHeaderResponse { type Item = Pet; diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/lib.rs b/packages/typespec-rust/test/spector/payload/pageable/src/lib.rs index f717f9638..f0cdeaff0 100644 --- a/packages/typespec-rust/test/spector/payload/pageable/src/lib.rs +++ b/packages/typespec-rust/test/spector/payload/pageable/src/lib.rs @@ -1,9 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // -// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. +// Code generated by Microsoft (R) Rust Code Generator. #![cfg_attr(docsrs, feature(doc_cfg))] #![allow(clippy::disallowed_names)] mod generated; pub use generated::*; +pub mod page_size; +pub mod server_driven_pagination; +pub mod xml_pagination; diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/page_size/generated/clients/mod.rs b/packages/typespec-rust/test/spector/payload/pageable/src/page_size/generated/clients/mod.rs new file mode 100644 index 000000000..107c0cff3 --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/pageable/src/page_size/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod pageable_page_size_client; +pub use pageable_page_size_client::*; diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/generated/clients/pageable_page_size_client.rs b/packages/typespec-rust/test/spector/payload/pageable/src/page_size/generated/clients/pageable_page_size_client.rs similarity index 99% rename from packages/typespec-rust/test/spector/payload/pageable/src/generated/clients/pageable_page_size_client.rs rename to packages/typespec-rust/test/spector/payload/pageable/src/page_size/generated/clients/pageable_page_size_client.rs index c48653ee8..b48437167 100644 --- a/packages/typespec-rust/test/spector/payload/pageable/src/generated/clients/pageable_page_size_client.rs +++ b/packages/typespec-rust/test/spector/payload/pageable/src/page_size/generated/clients/pageable_page_size_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::page_size::generated::models::{ ListWithPageSizeResponse, ListWithoutContinuationResponse, PageablePageSizeClientListWithPageSizeOptions, PageablePageSizeClientListWithoutContinuationOptions, diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/page_size/generated/mod.rs b/packages/typespec-rust/test/spector/payload/pageable/src/page_size/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/pageable/src/page_size/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/page_size/generated/models/method_options.rs b/packages/typespec-rust/test/spector/payload/pageable/src/page_size/generated/models/method_options.rs new file mode 100644 index 000000000..3af8533fe --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/pageable/src/page_size/generated/models/method_options.rs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::pager::PagerOptions}; + +/// Options to be passed to [`PageablePageSizeClient::list_with_page_size()`](crate::page_size::generated::clients::PageablePageSizeClient::list_with_page_size()) +#[derive(Clone, Default, SafeDebug)] +pub struct PageablePageSizeClientListWithPageSizeOptions<'a> { + /// Allows customization of the method call. + pub method_options: PagerOptions<'a>, + + pub page_size: Option, +} + +impl PageablePageSizeClientListWithPageSizeOptions<'_> { + /// Transforms this [`PageablePageSizeClientListWithPageSizeOptions`] into a new `PageablePageSizeClientListWithPageSizeOptions` that owns the underlying data, cloning it if necessary. + pub fn into_owned(self) -> PageablePageSizeClientListWithPageSizeOptions<'static> { + PageablePageSizeClientListWithPageSizeOptions { + method_options: PagerOptions { + context: self.method_options.context.into_owned(), + ..self.method_options + }, + page_size: self.page_size, + } + } +} + +/// Options to be passed to [`PageablePageSizeClient::list_without_continuation()`](crate::page_size::generated::clients::PageablePageSizeClient::list_without_continuation()) +#[derive(Clone, Default, SafeDebug)] +pub struct PageablePageSizeClientListWithoutContinuationOptions<'a> { + /// Allows customization of the method call. + pub method_options: PagerOptions<'a>, +} + +impl PageablePageSizeClientListWithoutContinuationOptions<'_> { + /// Transforms this [`PageablePageSizeClientListWithoutContinuationOptions`] into a new `PageablePageSizeClientListWithoutContinuationOptions` that owns the underlying data, cloning it if necessary. + pub fn into_owned(self) -> PageablePageSizeClientListWithoutContinuationOptions<'static> { + PageablePageSizeClientListWithoutContinuationOptions { + method_options: PagerOptions { + context: self.method_options.context.into_owned(), + ..self.method_options + }, + } + } +} diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/page_size/generated/models/mod.rs b/packages/typespec-rust/test/spector/payload/pageable/src/page_size/generated/models/mod.rs new file mode 100644 index 000000000..5dfb21b69 --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/pageable/src/page_size/generated/models/mod.rs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +#[allow(clippy::module_inception)] +mod models; +mod models_impl; +pub use method_options::*; +pub use models::*; diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/page_size/generated/models/models.rs b/packages/typespec-rust/test/spector/payload/pageable/src/page_size/generated/models/models.rs new file mode 100644 index 000000000..baf082635 --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/pageable/src/page_size/generated/models/models.rs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use crate::models::Pet; +use azure_core::fmt::SafeDebug; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] +#[non_exhaustive] +pub struct ListWithPageSizeResponse { + #[serde(default)] + pub pets: Vec, +} + +#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] +#[non_exhaustive] +pub struct ListWithoutContinuationResponse { + #[serde(default)] + pub pets: Vec, +} diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/page_size/generated/models/models_impl.rs b/packages/typespec-rust/test/spector/payload/pageable/src/page_size/generated/models/models_impl.rs new file mode 100644 index 000000000..d98f6dc69 --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/pageable/src/page_size/generated/models/models_impl.rs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use super::{ListWithPageSizeResponse, ListWithoutContinuationResponse}; +use crate::models::Pet; +use async_trait::async_trait; +use azure_core::{http::pager::Page, Result}; + +#[async_trait] +impl Page for ListWithPageSizeResponse { + type Item = Pet; + type IntoIter = as IntoIterator>::IntoIter; + async fn into_items(self) -> Result { + Ok(self.pets.into_iter()) + } +} + +#[async_trait] +impl Page for ListWithoutContinuationResponse { + type Item = Pet; + type IntoIter = as IntoIterator>::IntoIter; + async fn into_items(self) -> Result { + Ok(self.pets.into_iter()) + } +} diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/page_size/mod.rs b/packages/typespec-rust/test/spector/payload/pageable/src/page_size/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/pageable/src/page_size/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/continuation_token/generated/clients/mod.rs b/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/continuation_token/generated/clients/mod.rs new file mode 100644 index 000000000..3c026d6d6 --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/continuation_token/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod pageable_server_driven_pagination_continuation_token_client; +pub use pageable_server_driven_pagination_continuation_token_client::*; diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/generated/clients/pageable_server_driven_pagination_continuation_token_client.rs b/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/continuation_token/generated/clients/pageable_server_driven_pagination_continuation_token_client.rs similarity index 93% rename from packages/typespec-rust/test/spector/payload/pageable/src/generated/clients/pageable_server_driven_pagination_continuation_token_client.rs rename to packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/continuation_token/generated/clients/pageable_server_driven_pagination_continuation_token_client.rs index 2e845da17..3de00a592 100644 --- a/packages/typespec-rust/test/spector/payload/pageable/src/generated/clients/pageable_server_driven_pagination_continuation_token_client.rs +++ b/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/continuation_token/generated/clients/pageable_server_driven_pagination_continuation_token_client.rs @@ -3,17 +3,19 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ - PageableServerDrivenPaginationContinuationTokenClientListRequestHeaderNestedResponseBodyOptions, - PageableServerDrivenPaginationContinuationTokenClientListRequestHeaderResponseBodyOptions, - PageableServerDrivenPaginationContinuationTokenClientListRequestHeaderResponseHeaderOptions, - PageableServerDrivenPaginationContinuationTokenClientListRequestQueryNestedResponseBodyOptions, - PageableServerDrivenPaginationContinuationTokenClientListRequestQueryResponseBodyOptions, - PageableServerDrivenPaginationContinuationTokenClientListRequestQueryResponseHeaderOptions, - RequestHeaderNestedResponseBodyResponse, RequestHeaderResponseBodyResponse, - RequestHeaderResponseHeaderResponse, RequestHeaderResponseHeaderResponseHeaders, - RequestQueryNestedResponseBodyResponse, RequestQueryResponseBodyResponse, - RequestQueryResponseHeaderResponse, RequestQueryResponseHeaderResponseHeaders, +use crate::{ + models::{RequestHeaderResponseHeaderResponse, RequestQueryResponseHeaderResponse}, + server_driven_pagination::continuation_token::generated::models::{ + PageableServerDrivenPaginationContinuationTokenClientListRequestHeaderNestedResponseBodyOptions, + PageableServerDrivenPaginationContinuationTokenClientListRequestHeaderResponseBodyOptions, + PageableServerDrivenPaginationContinuationTokenClientListRequestHeaderResponseHeaderOptions, + PageableServerDrivenPaginationContinuationTokenClientListRequestQueryNestedResponseBodyOptions, + PageableServerDrivenPaginationContinuationTokenClientListRequestQueryResponseBodyOptions, + PageableServerDrivenPaginationContinuationTokenClientListRequestQueryResponseHeaderOptions, + RequestHeaderNestedResponseBodyResponse, RequestHeaderResponseBodyResponse, + RequestHeaderResponseHeaderResponseHeaders, RequestQueryNestedResponseBodyResponse, + RequestQueryResponseBodyResponse, RequestQueryResponseHeaderResponseHeaders, + }, }; use azure_core::{ error::CheckSuccessOptions, @@ -183,7 +185,8 @@ impl PageableServerDrivenPaginationContinuationTokenClient { /// /// ```no_run /// use azure_core::{Result, http::Response}; - /// use spector_corepageable::models::{RequestHeaderResponseHeaderResponse, RequestHeaderResponseHeaderResponseHeaders}; + /// use spector_corepageable::models::RequestHeaderResponseHeaderResponse; + /// use spector_corepageable::server_driven_pagination::continuation_token::models::RequestHeaderResponseHeaderResponseHeaders; /// async fn example() -> Result<()> { /// let response: Response = unimplemented!(); /// // Access response headers @@ -406,7 +409,8 @@ impl PageableServerDrivenPaginationContinuationTokenClient { /// /// ```no_run /// use azure_core::{Result, http::Response}; - /// use spector_corepageable::models::{RequestQueryResponseHeaderResponse, RequestQueryResponseHeaderResponseHeaders}; + /// use spector_corepageable::models::RequestQueryResponseHeaderResponse; + /// use spector_corepageable::server_driven_pagination::continuation_token::models::RequestQueryResponseHeaderResponseHeaders; /// async fn example() -> Result<()> { /// let response: Response = unimplemented!(); /// // Access response headers diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/continuation_token/generated/mod.rs b/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/continuation_token/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/continuation_token/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/generated/models/header_traits.rs b/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/continuation_token/generated/models/header_traits.rs similarity index 81% rename from packages/typespec-rust/test/spector/payload/pageable/src/generated/models/header_traits.rs rename to packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/continuation_token/generated/models/header_traits.rs index f8a93de21..9a25b2f3e 100644 --- a/packages/typespec-rust/test/spector/payload/pageable/src/generated/models/header_traits.rs +++ b/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/continuation_token/generated/models/header_traits.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use super::{RequestHeaderResponseHeaderResponse, RequestQueryResponseHeaderResponse}; +use crate::models::{RequestHeaderResponseHeaderResponse, RequestQueryResponseHeaderResponse}; use azure_core::{ http::{ headers::{HeaderName, Headers}, @@ -20,7 +20,8 @@ const NEXT_TOKEN: HeaderName = HeaderName::from_static("next-token"); /// /// ```no_run /// use azure_core::{Result, http::Response}; -/// use spector_corepageable::models::{RequestHeaderResponseHeaderResponse, RequestHeaderResponseHeaderResponseHeaders}; +/// use spector_corepageable::models::RequestHeaderResponseHeaderResponse; +/// use spector_corepageable::server_driven_pagination::continuation_token::models::RequestHeaderResponseHeaderResponseHeaders; /// async fn example() -> Result<()> { /// let response: Response = unimplemented!(); /// // Access response headers @@ -46,7 +47,8 @@ impl RequestHeaderResponseHeaderResponseHeaders for Response Result<()> { /// let response: Response = unimplemented!(); /// // Access response headers @@ -67,7 +69,7 @@ impl RequestQueryResponseHeaderResponseHeaders for Response { - /// Allows customization of the method call. - pub method_options: PagerOptions<'a>, - - pub page_size: Option, -} - -impl PageablePageSizeClientListWithPageSizeOptions<'_> { - /// Transforms this [`PageablePageSizeClientListWithPageSizeOptions`] into a new `PageablePageSizeClientListWithPageSizeOptions` that owns the underlying data, cloning it if necessary. - pub fn into_owned(self) -> PageablePageSizeClientListWithPageSizeOptions<'static> { - PageablePageSizeClientListWithPageSizeOptions { - method_options: PagerOptions { - context: self.method_options.context.into_owned(), - ..self.method_options - }, - page_size: self.page_size, - } - } -} - -/// Options to be passed to [`PageablePageSizeClient::list_without_continuation()`](crate::generated::clients::PageablePageSizeClient::list_without_continuation()) -#[derive(Clone, Default, SafeDebug)] -pub struct PageablePageSizeClientListWithoutContinuationOptions<'a> { - /// Allows customization of the method call. - pub method_options: PagerOptions<'a>, -} - -impl PageablePageSizeClientListWithoutContinuationOptions<'_> { - /// Transforms this [`PageablePageSizeClientListWithoutContinuationOptions`] into a new `PageablePageSizeClientListWithoutContinuationOptions` that owns the underlying data, cloning it if necessary. - pub fn into_owned(self) -> PageablePageSizeClientListWithoutContinuationOptions<'static> { - PageablePageSizeClientListWithoutContinuationOptions { - method_options: PagerOptions { - context: self.method_options.context.into_owned(), - ..self.method_options - }, - } - } -} -/// Options to be passed to [`PageableServerDrivenPaginationClient::list_link()`](crate::generated::clients::PageableServerDrivenPaginationClient::list_link()) -#[derive(Clone, Default, SafeDebug)] -pub struct PageableServerDrivenPaginationClientListLinkOptions<'a> { - /// Allows customization of the method call. - pub method_options: PagerOptions<'a>, -} - -impl PageableServerDrivenPaginationClientListLinkOptions<'_> { - /// Transforms this [`PageableServerDrivenPaginationClientListLinkOptions`] into a new `PageableServerDrivenPaginationClientListLinkOptions` that owns the underlying data, cloning it if necessary. - pub fn into_owned(self) -> PageableServerDrivenPaginationClientListLinkOptions<'static> { - PageableServerDrivenPaginationClientListLinkOptions { - method_options: PagerOptions { - context: self.method_options.context.into_owned(), - ..self.method_options - }, - } - } -} - -/// Options to be passed to [`PageableServerDrivenPaginationClient::list_link_string()`](crate::generated::clients::PageableServerDrivenPaginationClient::list_link_string()) -#[derive(Clone, Default, SafeDebug)] -pub struct PageableServerDrivenPaginationClientListLinkStringOptions<'a> { - /// Allows customization of the method call. - pub method_options: PagerOptions<'a>, -} - -impl PageableServerDrivenPaginationClientListLinkStringOptions<'_> { - /// Transforms this [`PageableServerDrivenPaginationClientListLinkStringOptions`] into a new `PageableServerDrivenPaginationClientListLinkStringOptions` that owns the underlying data, cloning it if necessary. - pub fn into_owned(self) -> PageableServerDrivenPaginationClientListLinkStringOptions<'static> { - PageableServerDrivenPaginationClientListLinkStringOptions { - method_options: PagerOptions { - context: self.method_options.context.into_owned(), - ..self.method_options - }, - } - } -} - -/// Options to be passed to [`PageableServerDrivenPaginationClient::list_nested_link()`](crate::generated::clients::PageableServerDrivenPaginationClient::list_nested_link()) -#[derive(Clone, Default, SafeDebug)] -pub struct PageableServerDrivenPaginationClientListNestedLinkOptions<'a> { - /// Allows customization of the method call. - pub method_options: PagerOptions<'a>, -} - -impl PageableServerDrivenPaginationClientListNestedLinkOptions<'_> { - /// Transforms this [`PageableServerDrivenPaginationClientListNestedLinkOptions`] into a new `PageableServerDrivenPaginationClientListNestedLinkOptions` that owns the underlying data, cloning it if necessary. - pub fn into_owned(self) -> PageableServerDrivenPaginationClientListNestedLinkOptions<'static> { - PageableServerDrivenPaginationClientListNestedLinkOptions { - method_options: PagerOptions { - context: self.method_options.context.into_owned(), - ..self.method_options - }, - } - } -} -/// Options to be passed to [`PageableServerDrivenPaginationContinuationTokenClient::list_request_header_nested_response_body()`](crate::generated::clients::PageableServerDrivenPaginationContinuationTokenClient::list_request_header_nested_response_body()) +/// Options to be passed to [`PageableServerDrivenPaginationContinuationTokenClient::list_request_header_nested_response_body()`](crate::server_driven_pagination::continuation_token::generated::clients::PageableServerDrivenPaginationContinuationTokenClient::list_request_header_nested_response_body()) #[derive(Clone, Default, SafeDebug)] pub struct PageableServerDrivenPaginationContinuationTokenClientListRequestHeaderNestedResponseBodyOptions< 'a, @@ -135,7 +39,7 @@ impl } } -/// Options to be passed to [`PageableServerDrivenPaginationContinuationTokenClient::list_request_header_response_body()`](crate::generated::clients::PageableServerDrivenPaginationContinuationTokenClient::list_request_header_response_body()) +/// Options to be passed to [`PageableServerDrivenPaginationContinuationTokenClient::list_request_header_response_body()`](crate::server_driven_pagination::continuation_token::generated::clients::PageableServerDrivenPaginationContinuationTokenClient::list_request_header_response_body()) #[derive(Clone, Default, SafeDebug)] pub struct PageableServerDrivenPaginationContinuationTokenClientListRequestHeaderResponseBodyOptions< 'a, @@ -165,7 +69,7 @@ impl PageableServerDrivenPaginationContinuationTokenClientListRequestHeaderRespo } } -/// Options to be passed to [`PageableServerDrivenPaginationContinuationTokenClient::list_request_header_response_header()`](crate::generated::clients::PageableServerDrivenPaginationContinuationTokenClient::list_request_header_response_header()) +/// Options to be passed to [`PageableServerDrivenPaginationContinuationTokenClient::list_request_header_response_header()`](crate::server_driven_pagination::continuation_token::generated::clients::PageableServerDrivenPaginationContinuationTokenClient::list_request_header_response_header()) #[derive(Clone, Default, SafeDebug)] pub struct PageableServerDrivenPaginationContinuationTokenClientListRequestHeaderResponseHeaderOptions< 'a, @@ -197,7 +101,7 @@ impl } } -/// Options to be passed to [`PageableServerDrivenPaginationContinuationTokenClient::list_request_query_nested_response_body()`](crate::generated::clients::PageableServerDrivenPaginationContinuationTokenClient::list_request_query_nested_response_body()) +/// Options to be passed to [`PageableServerDrivenPaginationContinuationTokenClient::list_request_query_nested_response_body()`](crate::server_driven_pagination::continuation_token::generated::clients::PageableServerDrivenPaginationContinuationTokenClient::list_request_query_nested_response_body()) #[derive(Clone, Default, SafeDebug)] pub struct PageableServerDrivenPaginationContinuationTokenClientListRequestQueryNestedResponseBodyOptions< 'a, @@ -231,7 +135,7 @@ impl } } -/// Options to be passed to [`PageableServerDrivenPaginationContinuationTokenClient::list_request_query_response_body()`](crate::generated::clients::PageableServerDrivenPaginationContinuationTokenClient::list_request_query_response_body()) +/// Options to be passed to [`PageableServerDrivenPaginationContinuationTokenClient::list_request_query_response_body()`](crate::server_driven_pagination::continuation_token::generated::clients::PageableServerDrivenPaginationContinuationTokenClient::list_request_query_response_body()) #[derive(Clone, Default, SafeDebug)] pub struct PageableServerDrivenPaginationContinuationTokenClientListRequestQueryResponseBodyOptions< 'a, @@ -261,7 +165,7 @@ impl PageableServerDrivenPaginationContinuationTokenClientListRequestQueryRespon } } -/// Options to be passed to [`PageableServerDrivenPaginationContinuationTokenClient::list_request_query_response_header()`](crate::generated::clients::PageableServerDrivenPaginationContinuationTokenClient::list_request_query_response_header()) +/// Options to be passed to [`PageableServerDrivenPaginationContinuationTokenClient::list_request_query_response_header()`](crate::server_driven_pagination::continuation_token::generated::clients::PageableServerDrivenPaginationContinuationTokenClient::list_request_query_response_header()) #[derive(Clone, Default, SafeDebug)] pub struct PageableServerDrivenPaginationContinuationTokenClientListRequestQueryResponseHeaderOptions< 'a, @@ -292,43 +196,3 @@ impl } } } -/// Options to be passed to [`PageableXmlPaginationClient::list_with_continuation()`](crate::generated::clients::PageableXmlPaginationClient::list_with_continuation()) -#[derive(Clone, Default, SafeDebug)] -pub struct PageableXmlPaginationClientListWithContinuationOptions<'a> { - pub marker: Option, - - /// Allows customization of the method call. - pub method_options: PagerOptions<'a>, -} - -impl PageableXmlPaginationClientListWithContinuationOptions<'_> { - /// Transforms this [`PageableXmlPaginationClientListWithContinuationOptions`] into a new `PageableXmlPaginationClientListWithContinuationOptions` that owns the underlying data, cloning it if necessary. - pub fn into_owned(self) -> PageableXmlPaginationClientListWithContinuationOptions<'static> { - PageableXmlPaginationClientListWithContinuationOptions { - marker: self.marker, - method_options: PagerOptions { - context: self.method_options.context.into_owned(), - ..self.method_options - }, - } - } -} - -/// Options to be passed to [`PageableXmlPaginationClient::list_with_next_link()`](crate::generated::clients::PageableXmlPaginationClient::list_with_next_link()) -#[derive(Clone, Default, SafeDebug)] -pub struct PageableXmlPaginationClientListWithNextLinkOptions<'a> { - /// Allows customization of the method call. - pub method_options: PagerOptions<'a>, -} - -impl PageableXmlPaginationClientListWithNextLinkOptions<'_> { - /// Transforms this [`PageableXmlPaginationClientListWithNextLinkOptions`] into a new `PageableXmlPaginationClientListWithNextLinkOptions` that owns the underlying data, cloning it if necessary. - pub fn into_owned(self) -> PageableXmlPaginationClientListWithNextLinkOptions<'static> { - PageableXmlPaginationClientListWithNextLinkOptions { - method_options: PagerOptions { - context: self.method_options.context.into_owned(), - ..self.method_options - }, - } - } -} diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/continuation_token/generated/models/mod.rs b/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/continuation_token/generated/models/mod.rs new file mode 100644 index 000000000..5cf40b1d0 --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/continuation_token/generated/models/mod.rs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod header_traits; +mod method_options; +#[allow(clippy::module_inception)] +mod models; +mod models_impl; +pub use header_traits::*; +pub use method_options::*; +pub use models::*; diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/continuation_token/generated/models/models.rs b/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/continuation_token/generated/models/models.rs new file mode 100644 index 000000000..05e88bc6e --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/continuation_token/generated/models/models.rs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use crate::models::Pet; +use azure_core::fmt::SafeDebug; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] +#[non_exhaustive] +pub struct RequestHeaderNestedResponseBodyResponse { + #[serde(default, rename = "nestedItems")] + pub nested_items: RequestHeaderNestedResponseBodyResponseNestedItems, + + #[serde(rename = "nestedNext", skip_serializing_if = "Option::is_none")] + pub nested_next: Option, +} + +#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] +#[non_exhaustive] +pub struct RequestHeaderNestedResponseBodyResponseNestedItems { + #[serde(default)] + pub pets: Vec, +} + +#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] +#[non_exhaustive] +pub struct RequestHeaderNestedResponseBodyResponseNestedNext { + #[serde(rename = "nextToken", skip_serializing_if = "Option::is_none")] + pub next_token: Option, +} + +#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] +#[non_exhaustive] +pub struct RequestHeaderResponseBodyResponse { + #[serde(rename = "nextToken", skip_serializing_if = "Option::is_none")] + pub next_token: Option, + + #[serde(default)] + pub pets: Vec, +} + +#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] +#[non_exhaustive] +pub struct RequestQueryNestedResponseBodyResponse { + #[serde(default, rename = "nestedItems")] + pub nested_items: RequestQueryNestedResponseBodyResponseNestedItems, + + #[serde(rename = "nestedNext", skip_serializing_if = "Option::is_none")] + pub nested_next: Option, +} + +#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] +#[non_exhaustive] +pub struct RequestQueryNestedResponseBodyResponseNestedItems { + #[serde(default)] + pub pets: Vec, +} + +#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] +#[non_exhaustive] +pub struct RequestQueryNestedResponseBodyResponseNestedNext { + #[serde(rename = "nextToken", skip_serializing_if = "Option::is_none")] + pub next_token: Option, +} + +#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] +#[non_exhaustive] +pub struct RequestQueryResponseBodyResponse { + #[serde(rename = "nextToken", skip_serializing_if = "Option::is_none")] + pub next_token: Option, + + #[serde(default)] + pub pets: Vec, +} diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/continuation_token/generated/models/models_impl.rs b/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/continuation_token/generated/models/models_impl.rs new file mode 100644 index 000000000..76fdccd00 --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/continuation_token/generated/models/models_impl.rs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use super::{ + RequestHeaderNestedResponseBodyResponse, RequestHeaderResponseBodyResponse, + RequestQueryNestedResponseBodyResponse, RequestQueryResponseBodyResponse, +}; +use crate::models::Pet; +use async_trait::async_trait; +use azure_core::{http::pager::Page, Result}; + +#[async_trait] +impl Page for RequestHeaderNestedResponseBodyResponse { + type Item = Pet; + type IntoIter = as IntoIterator>::IntoIter; + async fn into_items(self) -> Result { + Ok(self.nested_items.pets.into_iter()) + } +} + +#[async_trait] +impl Page for RequestHeaderResponseBodyResponse { + type Item = Pet; + type IntoIter = as IntoIterator>::IntoIter; + async fn into_items(self) -> Result { + Ok(self.pets.into_iter()) + } +} + +#[async_trait] +impl Page for RequestQueryNestedResponseBodyResponse { + type Item = Pet; + type IntoIter = as IntoIterator>::IntoIter; + async fn into_items(self) -> Result { + Ok(self.nested_items.pets.into_iter()) + } +} + +#[async_trait] +impl Page for RequestQueryResponseBodyResponse { + type Item = Pet; + type IntoIter = as IntoIterator>::IntoIter; + async fn into_items(self) -> Result { + Ok(self.pets.into_iter()) + } +} diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/continuation_token/mod.rs b/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/continuation_token/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/continuation_token/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/generated/clients/mod.rs b/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/generated/clients/mod.rs new file mode 100644 index 000000000..fef3bc4c7 --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod pageable_server_driven_pagination_client; +pub use pageable_server_driven_pagination_client::*; diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/generated/clients/pageable_server_driven_pagination_client.rs b/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/generated/clients/pageable_server_driven_pagination_client.rs similarity index 98% rename from packages/typespec-rust/test/spector/payload/pageable/src/generated/clients/pageable_server_driven_pagination_client.rs rename to packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/generated/clients/pageable_server_driven_pagination_client.rs index 64ab22917..ffb07c41b 100644 --- a/packages/typespec-rust/test/spector/payload/pageable/src/generated/clients/pageable_server_driven_pagination_client.rs +++ b/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/generated/clients/pageable_server_driven_pagination_client.rs @@ -3,9 +3,9 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::{ - clients::PageableServerDrivenPaginationContinuationTokenClient, - models::{ +use crate::server_driven_pagination::{ + continuation_token::clients::PageableServerDrivenPaginationContinuationTokenClient, + generated::models::{ LinkResponse, LinkStringResponse, NestedLinkResponse, PageableServerDrivenPaginationClientListLinkOptions, PageableServerDrivenPaginationClientListLinkStringOptions, diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/generated/mod.rs b/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/generated/models/method_options.rs b/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/generated/models/method_options.rs new file mode 100644 index 000000000..209c96eb0 --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/generated/models/method_options.rs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::pager::PagerOptions}; + +/// Options to be passed to [`PageableServerDrivenPaginationClient::list_link()`](crate::server_driven_pagination::generated::clients::PageableServerDrivenPaginationClient::list_link()) +#[derive(Clone, Default, SafeDebug)] +pub struct PageableServerDrivenPaginationClientListLinkOptions<'a> { + /// Allows customization of the method call. + pub method_options: PagerOptions<'a>, +} + +impl PageableServerDrivenPaginationClientListLinkOptions<'_> { + /// Transforms this [`PageableServerDrivenPaginationClientListLinkOptions`] into a new `PageableServerDrivenPaginationClientListLinkOptions` that owns the underlying data, cloning it if necessary. + pub fn into_owned(self) -> PageableServerDrivenPaginationClientListLinkOptions<'static> { + PageableServerDrivenPaginationClientListLinkOptions { + method_options: PagerOptions { + context: self.method_options.context.into_owned(), + ..self.method_options + }, + } + } +} + +/// Options to be passed to [`PageableServerDrivenPaginationClient::list_link_string()`](crate::server_driven_pagination::generated::clients::PageableServerDrivenPaginationClient::list_link_string()) +#[derive(Clone, Default, SafeDebug)] +pub struct PageableServerDrivenPaginationClientListLinkStringOptions<'a> { + /// Allows customization of the method call. + pub method_options: PagerOptions<'a>, +} + +impl PageableServerDrivenPaginationClientListLinkStringOptions<'_> { + /// Transforms this [`PageableServerDrivenPaginationClientListLinkStringOptions`] into a new `PageableServerDrivenPaginationClientListLinkStringOptions` that owns the underlying data, cloning it if necessary. + pub fn into_owned(self) -> PageableServerDrivenPaginationClientListLinkStringOptions<'static> { + PageableServerDrivenPaginationClientListLinkStringOptions { + method_options: PagerOptions { + context: self.method_options.context.into_owned(), + ..self.method_options + }, + } + } +} + +/// Options to be passed to [`PageableServerDrivenPaginationClient::list_nested_link()`](crate::server_driven_pagination::generated::clients::PageableServerDrivenPaginationClient::list_nested_link()) +#[derive(Clone, Default, SafeDebug)] +pub struct PageableServerDrivenPaginationClientListNestedLinkOptions<'a> { + /// Allows customization of the method call. + pub method_options: PagerOptions<'a>, +} + +impl PageableServerDrivenPaginationClientListNestedLinkOptions<'_> { + /// Transforms this [`PageableServerDrivenPaginationClientListNestedLinkOptions`] into a new `PageableServerDrivenPaginationClientListNestedLinkOptions` that owns the underlying data, cloning it if necessary. + pub fn into_owned(self) -> PageableServerDrivenPaginationClientListNestedLinkOptions<'static> { + PageableServerDrivenPaginationClientListNestedLinkOptions { + method_options: PagerOptions { + context: self.method_options.context.into_owned(), + ..self.method_options + }, + } + } +} diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/generated/models/mod.rs b/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/generated/models/mod.rs new file mode 100644 index 000000000..5dfb21b69 --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/generated/models/mod.rs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +#[allow(clippy::module_inception)] +mod models; +mod models_impl; +pub use method_options::*; +pub use models::*; diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/generated/models/models.rs b/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/generated/models/models.rs new file mode 100644 index 000000000..a1d6de310 --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/generated/models/models.rs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use crate::models::Pet; +use azure_core::fmt::SafeDebug; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] +#[non_exhaustive] +pub struct LinkResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub next: Option, + + #[serde(default)] + pub pets: Vec, +} + +#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] +#[non_exhaustive] +pub struct LinkStringResponse { + #[serde(skip_serializing_if = "Option::is_none")] + pub next: Option, + + #[serde(default)] + pub pets: Vec, +} + +#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] +#[non_exhaustive] +pub struct NestedLinkResponse { + #[serde(default, rename = "nestedItems")] + pub nested_items: NestedLinkResponseNestedItems, + + #[serde(rename = "nestedNext", skip_serializing_if = "Option::is_none")] + pub nested_next: Option, +} + +#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] +#[non_exhaustive] +pub struct NestedLinkResponseNestedItems { + #[serde(default)] + pub pets: Vec, +} + +#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] +#[non_exhaustive] +pub struct NestedLinkResponseNestedNext { + #[serde(skip_serializing_if = "Option::is_none")] + pub next: Option, +} diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/generated/models/models_impl.rs b/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/generated/models/models_impl.rs new file mode 100644 index 000000000..3e291b4ce --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/generated/models/models_impl.rs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use super::{LinkResponse, LinkStringResponse, NestedLinkResponse}; +use crate::models::Pet; +use async_trait::async_trait; +use azure_core::{http::pager::Page, Result}; + +#[async_trait] +impl Page for LinkResponse { + type Item = Pet; + type IntoIter = as IntoIterator>::IntoIter; + async fn into_items(self) -> Result { + Ok(self.pets.into_iter()) + } +} + +#[async_trait] +impl Page for LinkStringResponse { + type Item = Pet; + type IntoIter = as IntoIterator>::IntoIter; + async fn into_items(self) -> Result { + Ok(self.pets.into_iter()) + } +} + +#[async_trait] +impl Page for NestedLinkResponse { + type Item = Pet; + type IntoIter = as IntoIterator>::IntoIter; + async fn into_items(self) -> Result { + Ok(self.nested_items.pets.into_iter()) + } +} diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/mod.rs b/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/mod.rs new file mode 100644 index 000000000..cb012dc60 --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/pageable/src/server_driven_pagination/mod.rs @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; +pub mod continuation_token; diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/xml_pagination/generated/clients/mod.rs b/packages/typespec-rust/test/spector/payload/pageable/src/xml_pagination/generated/clients/mod.rs new file mode 100644 index 000000000..c6deb9422 --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/pageable/src/xml_pagination/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod pageable_xml_pagination_client; +pub use pageable_xml_pagination_client::*; diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/generated/clients/pageable_xml_pagination_client.rs b/packages/typespec-rust/test/spector/payload/pageable/src/xml_pagination/generated/clients/pageable_xml_pagination_client.rs similarity index 96% rename from packages/typespec-rust/test/spector/payload/pageable/src/generated/clients/pageable_xml_pagination_client.rs rename to packages/typespec-rust/test/spector/payload/pageable/src/xml_pagination/generated/clients/pageable_xml_pagination_client.rs index ed632c29a..92d17d8a4 100644 --- a/packages/typespec-rust/test/spector/payload/pageable/src/generated/clients/pageable_xml_pagination_client.rs +++ b/packages/typespec-rust/test/spector/payload/pageable/src/xml_pagination/generated/clients/pageable_xml_pagination_client.rs @@ -3,10 +3,12 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ - PageableXmlPaginationClientListWithContinuationOptions, - PageableXmlPaginationClientListWithNextLinkOptions, XmlPetListResult, - XmlPetListResultWithNextLink, +use crate::{ + models::{XmlPetListResult, XmlPetListResultWithNextLink}, + xml_pagination::generated::models::{ + PageableXmlPaginationClientListWithContinuationOptions, + PageableXmlPaginationClientListWithNextLinkOptions, + }, }; use azure_core::{ error::CheckSuccessOptions, diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/xml_pagination/generated/mod.rs b/packages/typespec-rust/test/spector/payload/pageable/src/xml_pagination/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/pageable/src/xml_pagination/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/xml_pagination/generated/models/method_options.rs b/packages/typespec-rust/test/spector/payload/pageable/src/xml_pagination/generated/models/method_options.rs new file mode 100644 index 000000000..8e31ae7eb --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/pageable/src/xml_pagination/generated/models/method_options.rs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::pager::PagerOptions}; + +/// Options to be passed to [`PageableXmlPaginationClient::list_with_continuation()`](crate::xml_pagination::generated::clients::PageableXmlPaginationClient::list_with_continuation()) +#[derive(Clone, Default, SafeDebug)] +pub struct PageableXmlPaginationClientListWithContinuationOptions<'a> { + pub marker: Option, + + /// Allows customization of the method call. + pub method_options: PagerOptions<'a>, +} + +impl PageableXmlPaginationClientListWithContinuationOptions<'_> { + /// Transforms this [`PageableXmlPaginationClientListWithContinuationOptions`] into a new `PageableXmlPaginationClientListWithContinuationOptions` that owns the underlying data, cloning it if necessary. + pub fn into_owned(self) -> PageableXmlPaginationClientListWithContinuationOptions<'static> { + PageableXmlPaginationClientListWithContinuationOptions { + marker: self.marker, + method_options: PagerOptions { + context: self.method_options.context.into_owned(), + ..self.method_options + }, + } + } +} + +/// Options to be passed to [`PageableXmlPaginationClient::list_with_next_link()`](crate::xml_pagination::generated::clients::PageableXmlPaginationClient::list_with_next_link()) +#[derive(Clone, Default, SafeDebug)] +pub struct PageableXmlPaginationClientListWithNextLinkOptions<'a> { + /// Allows customization of the method call. + pub method_options: PagerOptions<'a>, +} + +impl PageableXmlPaginationClientListWithNextLinkOptions<'_> { + /// Transforms this [`PageableXmlPaginationClientListWithNextLinkOptions`] into a new `PageableXmlPaginationClientListWithNextLinkOptions` that owns the underlying data, cloning it if necessary. + pub fn into_owned(self) -> PageableXmlPaginationClientListWithNextLinkOptions<'static> { + PageableXmlPaginationClientListWithNextLinkOptions { + method_options: PagerOptions { + context: self.method_options.context.into_owned(), + ..self.method_options + }, + } + } +} diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/xml_pagination/generated/models/mod.rs b/packages/typespec-rust/test/spector/payload/pageable/src/xml_pagination/generated/models/mod.rs new file mode 100644 index 000000000..3e484b1ed --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/pageable/src/xml_pagination/generated/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/payload/pageable/src/xml_pagination/mod.rs b/packages/typespec-rust/test/spector/payload/pageable/src/xml_pagination/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/payload/pageable/src/xml_pagination/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/payload/pageable/tests/continuation_token_client_tests.rs b/packages/typespec-rust/test/spector/payload/pageable/tests/continuation_token_client_tests.rs index 4b7e03df3..e4be67bca 100644 --- a/packages/typespec-rust/test/spector/payload/pageable/tests/continuation_token_client_tests.rs +++ b/packages/typespec-rust/test/spector/payload/pageable/tests/continuation_token_client_tests.rs @@ -4,16 +4,16 @@ use futures::StreamExt; use spector_corepageable::{ - models::{ + models::{RequestHeaderResponseHeaderResponse, RequestQueryResponseHeaderResponse}, + server_driven_pagination::continuation_token::models::{ PageableServerDrivenPaginationContinuationTokenClientListRequestHeaderNestedResponseBodyOptions, PageableServerDrivenPaginationContinuationTokenClientListRequestHeaderResponseBodyOptions, PageableServerDrivenPaginationContinuationTokenClientListRequestHeaderResponseHeaderOptions, PageableServerDrivenPaginationContinuationTokenClientListRequestQueryNestedResponseBodyOptions, PageableServerDrivenPaginationContinuationTokenClientListRequestQueryResponseBodyOptions, PageableServerDrivenPaginationContinuationTokenClientListRequestQueryResponseHeaderOptions, - RequestHeaderResponseBodyResponse, RequestHeaderResponseHeaderResponse, - RequestHeaderResponseHeaderResponseHeaders, RequestQueryResponseBodyResponse, - RequestQueryResponseHeaderResponse, RequestQueryResponseHeaderResponseHeaders, + RequestHeaderResponseBodyResponse, RequestHeaderResponseHeaderResponseHeaders, + RequestQueryResponseBodyResponse, RequestQueryResponseHeaderResponseHeaders, }, PageableClient, }; diff --git a/packages/typespec-rust/test/spector/payload/pageable/tests/pageable_client.rs b/packages/typespec-rust/test/spector/payload/pageable/tests/pageable_client.rs index 82cc146be..3659df0f9 100644 --- a/packages/typespec-rust/test/spector/payload/pageable/tests/pageable_client.rs +++ b/packages/typespec-rust/test/spector/payload/pageable/tests/pageable_client.rs @@ -3,7 +3,9 @@ // Licensed under the MIT License. See License.txt in the project root for license information. use futures::StreamExt; -use spector_corepageable::{models::PageablePageSizeClientListWithPageSizeOptions, PageableClient}; +use spector_corepageable::{ + page_size::models::PageablePageSizeClientListWithPageSizeOptions, PageableClient, +}; #[tokio::test] async fn list_with_page_size() { diff --git a/packages/typespec-rust/test/spector/payload/pageable/tests/pagination_client_tests.rs b/packages/typespec-rust/test/spector/payload/pageable/tests/pagination_client_tests.rs index dd21cf386..24220da0b 100644 --- a/packages/typespec-rust/test/spector/payload/pageable/tests/pagination_client_tests.rs +++ b/packages/typespec-rust/test/spector/payload/pageable/tests/pagination_client_tests.rs @@ -3,7 +3,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. use futures::StreamExt; -use spector_corepageable::{models::LinkResponse, PageableClient}; +use spector_corepageable::{server_driven_pagination::models::LinkResponse, PageableClient}; #[tokio::test] async fn list_link() { diff --git a/packages/typespec-rust/test/spector/payload/pageable/tests/xml_pagination_client_tests.rs b/packages/typespec-rust/test/spector/payload/pageable/tests/xml_pagination_client_tests.rs index 32a83ffeb..0070e9a69 100644 --- a/packages/typespec-rust/test/spector/payload/pageable/tests/xml_pagination_client_tests.rs +++ b/packages/typespec-rust/test/spector/payload/pageable/tests/xml_pagination_client_tests.rs @@ -4,10 +4,8 @@ use futures::StreamExt; use spector_corepageable::{ - models::{ - PageableXmlPaginationClientListWithContinuationOptions, XmlPet, XmlPetListResult, - XmlPetListResultWithNextLink, - }, + models::{XmlPet, XmlPetListResult, XmlPetListResultWithNextLink}, + xml_pagination::models::PageableXmlPaginationClientListWithContinuationOptions, PageableClient, }; diff --git a/packages/typespec-rust/test/spector/routes/src/generated/clients/mod.rs b/packages/typespec-rust/test/spector/routes/src/generated/clients/mod.rs index be02677ec..4405da001 100644 --- a/packages/typespec-rust/test/spector/routes/src/generated/clients/mod.rs +++ b/packages/typespec-rust/test/spector/routes/src/generated/clients/mod.rs @@ -5,47 +5,5 @@ mod routes_client; mod routes_in_interface_client; -mod routes_path_parameters_client; -mod routes_path_parameters_label_expansion_client; -mod routes_path_parameters_label_expansion_explode_client; -mod routes_path_parameters_label_expansion_standard_client; -mod routes_path_parameters_matrix_expansion_client; -mod routes_path_parameters_matrix_expansion_explode_client; -mod routes_path_parameters_matrix_expansion_standard_client; -mod routes_path_parameters_path_expansion_client; -mod routes_path_parameters_path_expansion_explode_client; -mod routes_path_parameters_path_expansion_standard_client; -mod routes_path_parameters_reserved_expansion_client; -mod routes_path_parameters_simple_expansion_client; -mod routes_path_parameters_simple_expansion_explode_client; -mod routes_path_parameters_simple_expansion_standard_client; -mod routes_query_parameters_client; -mod routes_query_parameters_query_continuation_client; -mod routes_query_parameters_query_continuation_explode_client; -mod routes_query_parameters_query_continuation_standard_client; -mod routes_query_parameters_query_expansion_client; -mod routes_query_parameters_query_expansion_explode_client; -mod routes_query_parameters_query_expansion_standard_client; pub use routes_client::*; pub use routes_in_interface_client::*; -pub use routes_path_parameters_client::*; -pub use routes_path_parameters_label_expansion_client::*; -pub use routes_path_parameters_label_expansion_explode_client::*; -pub use routes_path_parameters_label_expansion_standard_client::*; -pub use routes_path_parameters_matrix_expansion_client::*; -pub use routes_path_parameters_matrix_expansion_explode_client::*; -pub use routes_path_parameters_matrix_expansion_standard_client::*; -pub use routes_path_parameters_path_expansion_client::*; -pub use routes_path_parameters_path_expansion_explode_client::*; -pub use routes_path_parameters_path_expansion_standard_client::*; -pub use routes_path_parameters_reserved_expansion_client::*; -pub use routes_path_parameters_simple_expansion_client::*; -pub use routes_path_parameters_simple_expansion_explode_client::*; -pub use routes_path_parameters_simple_expansion_standard_client::*; -pub use routes_query_parameters_client::*; -pub use routes_query_parameters_query_continuation_client::*; -pub use routes_query_parameters_query_continuation_explode_client::*; -pub use routes_query_parameters_query_continuation_standard_client::*; -pub use routes_query_parameters_query_expansion_client::*; -pub use routes_query_parameters_query_expansion_explode_client::*; -pub use routes_query_parameters_query_expansion_standard_client::*; diff --git a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_client.rs b/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_client.rs index 38cf0ad87..9ea81b945 100644 --- a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_client.rs +++ b/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_client.rs @@ -3,9 +3,10 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::{ - clients::{RoutesInInterfaceClient, RoutesPathParametersClient, RoutesQueryParametersClient}, - models::RoutesClientFixedOptions, +use crate::{ + generated::{clients::RoutesInInterfaceClient, models::RoutesClientFixedOptions}, + path_parameters::clients::RoutesPathParametersClient, + query_parameters::clients::RoutesQueryParametersClient, }; use azure_core::{ error::CheckSuccessOptions, diff --git a/packages/typespec-rust/test/spector/routes/src/generated/models/method_options.rs b/packages/typespec-rust/test/spector/routes/src/generated/models/method_options.rs index 9074566b4..ac392c7f6 100644 --- a/packages/typespec-rust/test/spector/routes/src/generated/models/method_options.rs +++ b/packages/typespec-rust/test/spector/routes/src/generated/models/method_options.rs @@ -18,311 +18,3 @@ pub struct RoutesInInterfaceClientFixedOptions<'a> { /// Allows customization of the method call. pub method_options: ClientMethodOptions<'a>, } - -/// Options to be passed to [`RoutesPathParametersClient::annotation_only()`](crate::generated::clients::RoutesPathParametersClient::annotation_only()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesPathParametersClientAnnotationOnlyOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesPathParametersClient::explicit()`](crate::generated::clients::RoutesPathParametersClient::explicit()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesPathParametersClientExplicitOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesPathParametersClient::template_only()`](crate::generated::clients::RoutesPathParametersClient::template_only()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesPathParametersClientTemplateOnlyOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesPathParametersLabelExpansionExplodeClient::array()`](crate::generated::clients::RoutesPathParametersLabelExpansionExplodeClient::array()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesPathParametersLabelExpansionExplodeClientArrayOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesPathParametersLabelExpansionExplodeClient::primitive()`](crate::generated::clients::RoutesPathParametersLabelExpansionExplodeClient::primitive()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesPathParametersLabelExpansionExplodeClientPrimitiveOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesPathParametersLabelExpansionExplodeClient::record()`](crate::generated::clients::RoutesPathParametersLabelExpansionExplodeClient::record()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesPathParametersLabelExpansionExplodeClientRecordOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesPathParametersLabelExpansionStandardClient::array()`](crate::generated::clients::RoutesPathParametersLabelExpansionStandardClient::array()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesPathParametersLabelExpansionStandardClientArrayOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesPathParametersLabelExpansionStandardClient::primitive()`](crate::generated::clients::RoutesPathParametersLabelExpansionStandardClient::primitive()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesPathParametersLabelExpansionStandardClientPrimitiveOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesPathParametersLabelExpansionStandardClient::record()`](crate::generated::clients::RoutesPathParametersLabelExpansionStandardClient::record()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesPathParametersLabelExpansionStandardClientRecordOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesPathParametersMatrixExpansionExplodeClient::array()`](crate::generated::clients::RoutesPathParametersMatrixExpansionExplodeClient::array()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesPathParametersMatrixExpansionExplodeClientArrayOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesPathParametersMatrixExpansionExplodeClient::primitive()`](crate::generated::clients::RoutesPathParametersMatrixExpansionExplodeClient::primitive()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesPathParametersMatrixExpansionExplodeClientPrimitiveOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesPathParametersMatrixExpansionExplodeClient::record()`](crate::generated::clients::RoutesPathParametersMatrixExpansionExplodeClient::record()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesPathParametersMatrixExpansionExplodeClientRecordOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesPathParametersMatrixExpansionStandardClient::array()`](crate::generated::clients::RoutesPathParametersMatrixExpansionStandardClient::array()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesPathParametersMatrixExpansionStandardClientArrayOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesPathParametersMatrixExpansionStandardClient::primitive()`](crate::generated::clients::RoutesPathParametersMatrixExpansionStandardClient::primitive()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesPathParametersMatrixExpansionStandardClientPrimitiveOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesPathParametersMatrixExpansionStandardClient::record()`](crate::generated::clients::RoutesPathParametersMatrixExpansionStandardClient::record()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesPathParametersMatrixExpansionStandardClientRecordOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesPathParametersPathExpansionExplodeClient::array()`](crate::generated::clients::RoutesPathParametersPathExpansionExplodeClient::array()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesPathParametersPathExpansionExplodeClientArrayOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesPathParametersPathExpansionExplodeClient::primitive()`](crate::generated::clients::RoutesPathParametersPathExpansionExplodeClient::primitive()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesPathParametersPathExpansionExplodeClientPrimitiveOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesPathParametersPathExpansionExplodeClient::record()`](crate::generated::clients::RoutesPathParametersPathExpansionExplodeClient::record()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesPathParametersPathExpansionExplodeClientRecordOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesPathParametersPathExpansionStandardClient::array()`](crate::generated::clients::RoutesPathParametersPathExpansionStandardClient::array()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesPathParametersPathExpansionStandardClientArrayOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesPathParametersPathExpansionStandardClient::primitive()`](crate::generated::clients::RoutesPathParametersPathExpansionStandardClient::primitive()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesPathParametersPathExpansionStandardClientPrimitiveOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesPathParametersPathExpansionStandardClient::record()`](crate::generated::clients::RoutesPathParametersPathExpansionStandardClient::record()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesPathParametersPathExpansionStandardClientRecordOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesPathParametersReservedExpansionClient::annotation()`](crate::generated::clients::RoutesPathParametersReservedExpansionClient::annotation()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesPathParametersReservedExpansionClientAnnotationOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesPathParametersReservedExpansionClient::template()`](crate::generated::clients::RoutesPathParametersReservedExpansionClient::template()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesPathParametersReservedExpansionClientTemplateOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesPathParametersSimpleExpansionExplodeClient::array()`](crate::generated::clients::RoutesPathParametersSimpleExpansionExplodeClient::array()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesPathParametersSimpleExpansionExplodeClientArrayOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesPathParametersSimpleExpansionExplodeClient::primitive()`](crate::generated::clients::RoutesPathParametersSimpleExpansionExplodeClient::primitive()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesPathParametersSimpleExpansionExplodeClientPrimitiveOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesPathParametersSimpleExpansionExplodeClient::record()`](crate::generated::clients::RoutesPathParametersSimpleExpansionExplodeClient::record()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesPathParametersSimpleExpansionExplodeClientRecordOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesPathParametersSimpleExpansionStandardClient::array()`](crate::generated::clients::RoutesPathParametersSimpleExpansionStandardClient::array()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesPathParametersSimpleExpansionStandardClientArrayOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesPathParametersSimpleExpansionStandardClient::primitive()`](crate::generated::clients::RoutesPathParametersSimpleExpansionStandardClient::primitive()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesPathParametersSimpleExpansionStandardClientPrimitiveOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesPathParametersSimpleExpansionStandardClient::record()`](crate::generated::clients::RoutesPathParametersSimpleExpansionStandardClient::record()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesPathParametersSimpleExpansionStandardClientRecordOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesQueryParametersClient::annotation_only()`](crate::generated::clients::RoutesQueryParametersClient::annotation_only()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesQueryParametersClientAnnotationOnlyOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesQueryParametersClient::explicit()`](crate::generated::clients::RoutesQueryParametersClient::explicit()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesQueryParametersClientExplicitOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesQueryParametersClient::template_only()`](crate::generated::clients::RoutesQueryParametersClient::template_only()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesQueryParametersClientTemplateOnlyOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesQueryParametersQueryContinuationExplodeClient::array()`](crate::generated::clients::RoutesQueryParametersQueryContinuationExplodeClient::array()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesQueryParametersQueryContinuationExplodeClientArrayOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesQueryParametersQueryContinuationExplodeClient::primitive()`](crate::generated::clients::RoutesQueryParametersQueryContinuationExplodeClient::primitive()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesQueryParametersQueryContinuationExplodeClientPrimitiveOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesQueryParametersQueryContinuationExplodeClient::record()`](crate::generated::clients::RoutesQueryParametersQueryContinuationExplodeClient::record()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesQueryParametersQueryContinuationExplodeClientRecordOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesQueryParametersQueryContinuationStandardClient::array()`](crate::generated::clients::RoutesQueryParametersQueryContinuationStandardClient::array()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesQueryParametersQueryContinuationStandardClientArrayOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesQueryParametersQueryContinuationStandardClient::primitive()`](crate::generated::clients::RoutesQueryParametersQueryContinuationStandardClient::primitive()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesQueryParametersQueryContinuationStandardClientPrimitiveOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesQueryParametersQueryContinuationStandardClient::record()`](crate::generated::clients::RoutesQueryParametersQueryContinuationStandardClient::record()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesQueryParametersQueryContinuationStandardClientRecordOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesQueryParametersQueryExpansionExplodeClient::array()`](crate::generated::clients::RoutesQueryParametersQueryExpansionExplodeClient::array()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesQueryParametersQueryExpansionExplodeClientArrayOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesQueryParametersQueryExpansionExplodeClient::primitive()`](crate::generated::clients::RoutesQueryParametersQueryExpansionExplodeClient::primitive()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesQueryParametersQueryExpansionExplodeClientPrimitiveOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesQueryParametersQueryExpansionExplodeClient::record()`](crate::generated::clients::RoutesQueryParametersQueryExpansionExplodeClient::record()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesQueryParametersQueryExpansionExplodeClientRecordOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesQueryParametersQueryExpansionStandardClient::array()`](crate::generated::clients::RoutesQueryParametersQueryExpansionStandardClient::array()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesQueryParametersQueryExpansionStandardClientArrayOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesQueryParametersQueryExpansionStandardClient::primitive()`](crate::generated::clients::RoutesQueryParametersQueryExpansionStandardClient::primitive()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesQueryParametersQueryExpansionStandardClientPrimitiveOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`RoutesQueryParametersQueryExpansionStandardClient::record()`](crate::generated::clients::RoutesQueryParametersQueryExpansionStandardClient::record()) -#[derive(Clone, Default, SafeDebug)] -pub struct RoutesQueryParametersQueryExpansionStandardClientRecordOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} diff --git a/packages/typespec-rust/test/spector/routes/src/lib.rs b/packages/typespec-rust/test/spector/routes/src/lib.rs index cc784e401..f4305bc55 100644 --- a/packages/typespec-rust/test/spector/routes/src/lib.rs +++ b/packages/typespec-rust/test/spector/routes/src/lib.rs @@ -7,3 +7,5 @@ mod generated; pub use generated::*; +pub mod path_parameters; +pub mod query_parameters; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/generated/clients/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/generated/clients/mod.rs new file mode 100644 index 000000000..cfe9920d6 --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod routes_path_parameters_client; +pub use routes_path_parameters_client::*; diff --git a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_client.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/generated/clients/routes_path_parameters_client.rs similarity index 94% rename from packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_client.rs rename to packages/typespec-rust/test/spector/routes/src/path_parameters/generated/clients/routes_path_parameters_client.rs index 2b6711067..2857c6d0d 100644 --- a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_client.rs +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/generated/clients/routes_path_parameters_client.rs @@ -3,16 +3,16 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::{ - clients::{ - RoutesPathParametersLabelExpansionClient, RoutesPathParametersMatrixExpansionClient, - RoutesPathParametersPathExpansionClient, RoutesPathParametersReservedExpansionClient, - RoutesPathParametersSimpleExpansionClient, - }, - models::{ +use crate::path_parameters::{ + generated::models::{ RoutesPathParametersClientAnnotationOnlyOptions, RoutesPathParametersClientExplicitOptions, RoutesPathParametersClientTemplateOnlyOptions, }, + label_expansion::clients::RoutesPathParametersLabelExpansionClient, + matrix_expansion::clients::RoutesPathParametersMatrixExpansionClient, + path_expansion::clients::RoutesPathParametersPathExpansionClient, + reserved_expansion::clients::RoutesPathParametersReservedExpansionClient, + simple_expansion::clients::RoutesPathParametersSimpleExpansionClient, }; use azure_core::{ error::CheckSuccessOptions, diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/generated/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/generated/models/method_options.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/generated/models/method_options.rs new file mode 100644 index 000000000..a01e27549 --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/generated/models/method_options.rs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`RoutesPathParametersClient::annotation_only()`](crate::path_parameters::generated::clients::RoutesPathParametersClient::annotation_only()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesPathParametersClientAnnotationOnlyOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`RoutesPathParametersClient::explicit()`](crate::path_parameters::generated::clients::RoutesPathParametersClient::explicit()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesPathParametersClientExplicitOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`RoutesPathParametersClient::template_only()`](crate::path_parameters::generated::clients::RoutesPathParametersClient::template_only()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesPathParametersClientTemplateOnlyOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/generated/models/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/generated/models/mod.rs new file mode 100644 index 000000000..3e484b1ed --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/generated/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/explode/generated/clients/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/explode/generated/clients/mod.rs new file mode 100644 index 000000000..3ec8c44cc --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/explode/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod routes_path_parameters_label_expansion_explode_client; +pub use routes_path_parameters_label_expansion_explode_client::*; diff --git a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_label_expansion_explode_client.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/explode/generated/clients/routes_path_parameters_label_expansion_explode_client.rs similarity index 98% rename from packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_label_expansion_explode_client.rs rename to packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/explode/generated/clients/routes_path_parameters_label_expansion_explode_client.rs index 0b6a0659b..9cf61c6ef 100644 --- a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_label_expansion_explode_client.rs +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/explode/generated/clients/routes_path_parameters_label_expansion_explode_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::path_parameters::label_expansion::explode::generated::models::{ RoutesPathParametersLabelExpansionExplodeClientArrayOptions, RoutesPathParametersLabelExpansionExplodeClientPrimitiveOptions, RoutesPathParametersLabelExpansionExplodeClientRecordOptions, diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/explode/generated/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/explode/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/explode/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/explode/generated/models/method_options.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/explode/generated/models/method_options.rs new file mode 100644 index 000000000..b6e77b9b4 --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/explode/generated/models/method_options.rs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`RoutesPathParametersLabelExpansionExplodeClient::array()`](crate::path_parameters::label_expansion::explode::generated::clients::RoutesPathParametersLabelExpansionExplodeClient::array()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesPathParametersLabelExpansionExplodeClientArrayOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`RoutesPathParametersLabelExpansionExplodeClient::primitive()`](crate::path_parameters::label_expansion::explode::generated::clients::RoutesPathParametersLabelExpansionExplodeClient::primitive()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesPathParametersLabelExpansionExplodeClientPrimitiveOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`RoutesPathParametersLabelExpansionExplodeClient::record()`](crate::path_parameters::label_expansion::explode::generated::clients::RoutesPathParametersLabelExpansionExplodeClient::record()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesPathParametersLabelExpansionExplodeClientRecordOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/explode/generated/models/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/explode/generated/models/mod.rs new file mode 100644 index 000000000..3e484b1ed --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/explode/generated/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/explode/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/explode/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/explode/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/generated/clients/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/generated/clients/mod.rs new file mode 100644 index 000000000..fdded9a19 --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod routes_path_parameters_label_expansion_client; +pub use routes_path_parameters_label_expansion_client::*; diff --git a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_label_expansion_client.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/generated/clients/routes_path_parameters_label_expansion_client.rs similarity index 87% rename from packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_label_expansion_client.rs rename to packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/generated/clients/routes_path_parameters_label_expansion_client.rs index 8000e0b1d..e01dbdd29 100644 --- a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_label_expansion_client.rs +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/generated/clients/routes_path_parameters_label_expansion_client.rs @@ -3,9 +3,9 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::clients::{ - RoutesPathParametersLabelExpansionExplodeClient, - RoutesPathParametersLabelExpansionStandardClient, +use crate::path_parameters::label_expansion::{ + explode::clients::RoutesPathParametersLabelExpansionExplodeClient, + standard::clients::RoutesPathParametersLabelExpansionStandardClient, }; use azure_core::{ http::{Pipeline, Url}, diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/generated/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/generated/mod.rs new file mode 100644 index 000000000..8aa217ea3 --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/generated/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/mod.rs new file mode 100644 index 000000000..1a2e8cc62 --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; +pub mod explode; +pub mod standard; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/standard/generated/clients/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/standard/generated/clients/mod.rs new file mode 100644 index 000000000..692d343e7 --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/standard/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod routes_path_parameters_label_expansion_standard_client; +pub use routes_path_parameters_label_expansion_standard_client::*; diff --git a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_label_expansion_standard_client.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/standard/generated/clients/routes_path_parameters_label_expansion_standard_client.rs similarity index 98% rename from packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_label_expansion_standard_client.rs rename to packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/standard/generated/clients/routes_path_parameters_label_expansion_standard_client.rs index 618defc50..38b542636 100644 --- a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_label_expansion_standard_client.rs +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/standard/generated/clients/routes_path_parameters_label_expansion_standard_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::path_parameters::label_expansion::standard::generated::models::{ RoutesPathParametersLabelExpansionStandardClientArrayOptions, RoutesPathParametersLabelExpansionStandardClientPrimitiveOptions, RoutesPathParametersLabelExpansionStandardClientRecordOptions, diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/standard/generated/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/standard/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/standard/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/standard/generated/models/method_options.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/standard/generated/models/method_options.rs new file mode 100644 index 000000000..cb3c6fc07 --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/standard/generated/models/method_options.rs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`RoutesPathParametersLabelExpansionStandardClient::array()`](crate::path_parameters::label_expansion::standard::generated::clients::RoutesPathParametersLabelExpansionStandardClient::array()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesPathParametersLabelExpansionStandardClientArrayOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`RoutesPathParametersLabelExpansionStandardClient::primitive()`](crate::path_parameters::label_expansion::standard::generated::clients::RoutesPathParametersLabelExpansionStandardClient::primitive()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesPathParametersLabelExpansionStandardClientPrimitiveOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`RoutesPathParametersLabelExpansionStandardClient::record()`](crate::path_parameters::label_expansion::standard::generated::clients::RoutesPathParametersLabelExpansionStandardClient::record()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesPathParametersLabelExpansionStandardClientRecordOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/standard/generated/models/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/standard/generated/models/mod.rs new file mode 100644 index 000000000..3e484b1ed --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/standard/generated/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/standard/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/standard/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/label_expansion/standard/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/explode/generated/clients/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/explode/generated/clients/mod.rs new file mode 100644 index 000000000..2cfc4931d --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/explode/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod routes_path_parameters_matrix_expansion_explode_client; +pub use routes_path_parameters_matrix_expansion_explode_client::*; diff --git a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_matrix_expansion_explode_client.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/explode/generated/clients/routes_path_parameters_matrix_expansion_explode_client.rs similarity index 98% rename from packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_matrix_expansion_explode_client.rs rename to packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/explode/generated/clients/routes_path_parameters_matrix_expansion_explode_client.rs index 06333d157..100752202 100644 --- a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_matrix_expansion_explode_client.rs +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/explode/generated/clients/routes_path_parameters_matrix_expansion_explode_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::path_parameters::matrix_expansion::explode::generated::models::{ RoutesPathParametersMatrixExpansionExplodeClientArrayOptions, RoutesPathParametersMatrixExpansionExplodeClientPrimitiveOptions, RoutesPathParametersMatrixExpansionExplodeClientRecordOptions, diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/explode/generated/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/explode/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/explode/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/explode/generated/models/method_options.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/explode/generated/models/method_options.rs new file mode 100644 index 000000000..0c8db96d6 --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/explode/generated/models/method_options.rs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`RoutesPathParametersMatrixExpansionExplodeClient::array()`](crate::path_parameters::matrix_expansion::explode::generated::clients::RoutesPathParametersMatrixExpansionExplodeClient::array()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesPathParametersMatrixExpansionExplodeClientArrayOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`RoutesPathParametersMatrixExpansionExplodeClient::primitive()`](crate::path_parameters::matrix_expansion::explode::generated::clients::RoutesPathParametersMatrixExpansionExplodeClient::primitive()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesPathParametersMatrixExpansionExplodeClientPrimitiveOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`RoutesPathParametersMatrixExpansionExplodeClient::record()`](crate::path_parameters::matrix_expansion::explode::generated::clients::RoutesPathParametersMatrixExpansionExplodeClient::record()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesPathParametersMatrixExpansionExplodeClientRecordOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/explode/generated/models/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/explode/generated/models/mod.rs new file mode 100644 index 000000000..3e484b1ed --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/explode/generated/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/explode/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/explode/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/explode/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/generated/clients/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/generated/clients/mod.rs new file mode 100644 index 000000000..1f455e66d --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod routes_path_parameters_matrix_expansion_client; +pub use routes_path_parameters_matrix_expansion_client::*; diff --git a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_matrix_expansion_client.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/generated/clients/routes_path_parameters_matrix_expansion_client.rs similarity index 87% rename from packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_matrix_expansion_client.rs rename to packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/generated/clients/routes_path_parameters_matrix_expansion_client.rs index 0f6fe18cf..cd949c1ab 100644 --- a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_matrix_expansion_client.rs +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/generated/clients/routes_path_parameters_matrix_expansion_client.rs @@ -3,9 +3,9 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::clients::{ - RoutesPathParametersMatrixExpansionExplodeClient, - RoutesPathParametersMatrixExpansionStandardClient, +use crate::path_parameters::matrix_expansion::{ + explode::clients::RoutesPathParametersMatrixExpansionExplodeClient, + standard::clients::RoutesPathParametersMatrixExpansionStandardClient, }; use azure_core::{ http::{Pipeline, Url}, diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/generated/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/generated/mod.rs new file mode 100644 index 000000000..8aa217ea3 --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/generated/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/mod.rs new file mode 100644 index 000000000..1a2e8cc62 --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; +pub mod explode; +pub mod standard; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/standard/generated/clients/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/standard/generated/clients/mod.rs new file mode 100644 index 000000000..ab6b9c370 --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/standard/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod routes_path_parameters_matrix_expansion_standard_client; +pub use routes_path_parameters_matrix_expansion_standard_client::*; diff --git a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_matrix_expansion_standard_client.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/standard/generated/clients/routes_path_parameters_matrix_expansion_standard_client.rs similarity index 98% rename from packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_matrix_expansion_standard_client.rs rename to packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/standard/generated/clients/routes_path_parameters_matrix_expansion_standard_client.rs index b25f3f6b2..ab3df9774 100644 --- a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_matrix_expansion_standard_client.rs +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/standard/generated/clients/routes_path_parameters_matrix_expansion_standard_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::path_parameters::matrix_expansion::standard::generated::models::{ RoutesPathParametersMatrixExpansionStandardClientArrayOptions, RoutesPathParametersMatrixExpansionStandardClientPrimitiveOptions, RoutesPathParametersMatrixExpansionStandardClientRecordOptions, diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/standard/generated/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/standard/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/standard/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/standard/generated/models/method_options.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/standard/generated/models/method_options.rs new file mode 100644 index 000000000..d8ab37c6b --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/standard/generated/models/method_options.rs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`RoutesPathParametersMatrixExpansionStandardClient::array()`](crate::path_parameters::matrix_expansion::standard::generated::clients::RoutesPathParametersMatrixExpansionStandardClient::array()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesPathParametersMatrixExpansionStandardClientArrayOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`RoutesPathParametersMatrixExpansionStandardClient::primitive()`](crate::path_parameters::matrix_expansion::standard::generated::clients::RoutesPathParametersMatrixExpansionStandardClient::primitive()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesPathParametersMatrixExpansionStandardClientPrimitiveOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`RoutesPathParametersMatrixExpansionStandardClient::record()`](crate::path_parameters::matrix_expansion::standard::generated::clients::RoutesPathParametersMatrixExpansionStandardClient::record()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesPathParametersMatrixExpansionStandardClientRecordOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/standard/generated/models/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/standard/generated/models/mod.rs new file mode 100644 index 000000000..3e484b1ed --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/standard/generated/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/standard/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/standard/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/matrix_expansion/standard/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/mod.rs new file mode 100644 index 000000000..f3c7a4acf --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/mod.rs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; +pub mod label_expansion; +pub mod matrix_expansion; +pub mod path_expansion; +pub mod reserved_expansion; +pub mod simple_expansion; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/explode/generated/clients/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/explode/generated/clients/mod.rs new file mode 100644 index 000000000..e5577b645 --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/explode/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod routes_path_parameters_path_expansion_explode_client; +pub use routes_path_parameters_path_expansion_explode_client::*; diff --git a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_path_expansion_explode_client.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/explode/generated/clients/routes_path_parameters_path_expansion_explode_client.rs similarity index 98% rename from packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_path_expansion_explode_client.rs rename to packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/explode/generated/clients/routes_path_parameters_path_expansion_explode_client.rs index e4c6b5b72..3749baf65 100644 --- a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_path_expansion_explode_client.rs +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/explode/generated/clients/routes_path_parameters_path_expansion_explode_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::path_parameters::path_expansion::explode::generated::models::{ RoutesPathParametersPathExpansionExplodeClientArrayOptions, RoutesPathParametersPathExpansionExplodeClientPrimitiveOptions, RoutesPathParametersPathExpansionExplodeClientRecordOptions, diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/explode/generated/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/explode/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/explode/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/explode/generated/models/method_options.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/explode/generated/models/method_options.rs new file mode 100644 index 000000000..4594c67c4 --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/explode/generated/models/method_options.rs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`RoutesPathParametersPathExpansionExplodeClient::array()`](crate::path_parameters::path_expansion::explode::generated::clients::RoutesPathParametersPathExpansionExplodeClient::array()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesPathParametersPathExpansionExplodeClientArrayOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`RoutesPathParametersPathExpansionExplodeClient::primitive()`](crate::path_parameters::path_expansion::explode::generated::clients::RoutesPathParametersPathExpansionExplodeClient::primitive()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesPathParametersPathExpansionExplodeClientPrimitiveOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`RoutesPathParametersPathExpansionExplodeClient::record()`](crate::path_parameters::path_expansion::explode::generated::clients::RoutesPathParametersPathExpansionExplodeClient::record()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesPathParametersPathExpansionExplodeClientRecordOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/explode/generated/models/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/explode/generated/models/mod.rs new file mode 100644 index 000000000..3e484b1ed --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/explode/generated/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/explode/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/explode/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/explode/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/generated/clients/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/generated/clients/mod.rs new file mode 100644 index 000000000..6aba6fdb7 --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod routes_path_parameters_path_expansion_client; +pub use routes_path_parameters_path_expansion_client::*; diff --git a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_path_expansion_client.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/generated/clients/routes_path_parameters_path_expansion_client.rs similarity index 87% rename from packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_path_expansion_client.rs rename to packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/generated/clients/routes_path_parameters_path_expansion_client.rs index 22f74171d..cde1c9750 100644 --- a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_path_expansion_client.rs +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/generated/clients/routes_path_parameters_path_expansion_client.rs @@ -3,8 +3,9 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::clients::{ - RoutesPathParametersPathExpansionExplodeClient, RoutesPathParametersPathExpansionStandardClient, +use crate::path_parameters::path_expansion::{ + explode::clients::RoutesPathParametersPathExpansionExplodeClient, + standard::clients::RoutesPathParametersPathExpansionStandardClient, }; use azure_core::{ http::{Pipeline, Url}, diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/generated/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/generated/mod.rs new file mode 100644 index 000000000..8aa217ea3 --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/generated/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/mod.rs new file mode 100644 index 000000000..1a2e8cc62 --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; +pub mod explode; +pub mod standard; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/standard/generated/clients/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/standard/generated/clients/mod.rs new file mode 100644 index 000000000..6ef292f11 --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/standard/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod routes_path_parameters_path_expansion_standard_client; +pub use routes_path_parameters_path_expansion_standard_client::*; diff --git a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_path_expansion_standard_client.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/standard/generated/clients/routes_path_parameters_path_expansion_standard_client.rs similarity index 98% rename from packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_path_expansion_standard_client.rs rename to packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/standard/generated/clients/routes_path_parameters_path_expansion_standard_client.rs index f8bcee43c..0093d8319 100644 --- a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_path_expansion_standard_client.rs +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/standard/generated/clients/routes_path_parameters_path_expansion_standard_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::path_parameters::path_expansion::standard::generated::models::{ RoutesPathParametersPathExpansionStandardClientArrayOptions, RoutesPathParametersPathExpansionStandardClientPrimitiveOptions, RoutesPathParametersPathExpansionStandardClientRecordOptions, diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/standard/generated/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/standard/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/standard/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/standard/generated/models/method_options.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/standard/generated/models/method_options.rs new file mode 100644 index 000000000..37cc4acdf --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/standard/generated/models/method_options.rs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`RoutesPathParametersPathExpansionStandardClient::array()`](crate::path_parameters::path_expansion::standard::generated::clients::RoutesPathParametersPathExpansionStandardClient::array()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesPathParametersPathExpansionStandardClientArrayOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`RoutesPathParametersPathExpansionStandardClient::primitive()`](crate::path_parameters::path_expansion::standard::generated::clients::RoutesPathParametersPathExpansionStandardClient::primitive()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesPathParametersPathExpansionStandardClientPrimitiveOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`RoutesPathParametersPathExpansionStandardClient::record()`](crate::path_parameters::path_expansion::standard::generated::clients::RoutesPathParametersPathExpansionStandardClient::record()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesPathParametersPathExpansionStandardClientRecordOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/standard/generated/models/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/standard/generated/models/mod.rs new file mode 100644 index 000000000..3e484b1ed --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/standard/generated/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/standard/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/standard/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/path_expansion/standard/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/reserved_expansion/generated/clients/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/reserved_expansion/generated/clients/mod.rs new file mode 100644 index 000000000..ad93aa0ff --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/reserved_expansion/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod routes_path_parameters_reserved_expansion_client; +pub use routes_path_parameters_reserved_expansion_client::*; diff --git a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_reserved_expansion_client.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/reserved_expansion/generated/clients/routes_path_parameters_reserved_expansion_client.rs similarity index 98% rename from packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_reserved_expansion_client.rs rename to packages/typespec-rust/test/spector/routes/src/path_parameters/reserved_expansion/generated/clients/routes_path_parameters_reserved_expansion_client.rs index 2cc982ada..e0f96ac88 100644 --- a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_reserved_expansion_client.rs +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/reserved_expansion/generated/clients/routes_path_parameters_reserved_expansion_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::path_parameters::reserved_expansion::generated::models::{ RoutesPathParametersReservedExpansionClientAnnotationOptions, RoutesPathParametersReservedExpansionClientTemplateOptions, }; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/reserved_expansion/generated/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/reserved_expansion/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/reserved_expansion/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/reserved_expansion/generated/models/method_options.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/reserved_expansion/generated/models/method_options.rs new file mode 100644 index 000000000..86ec2c3bc --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/reserved_expansion/generated/models/method_options.rs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`RoutesPathParametersReservedExpansionClient::annotation()`](crate::path_parameters::reserved_expansion::generated::clients::RoutesPathParametersReservedExpansionClient::annotation()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesPathParametersReservedExpansionClientAnnotationOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`RoutesPathParametersReservedExpansionClient::template()`](crate::path_parameters::reserved_expansion::generated::clients::RoutesPathParametersReservedExpansionClient::template()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesPathParametersReservedExpansionClientTemplateOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/reserved_expansion/generated/models/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/reserved_expansion/generated/models/mod.rs new file mode 100644 index 000000000..3e484b1ed --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/reserved_expansion/generated/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/reserved_expansion/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/reserved_expansion/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/reserved_expansion/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/explode/generated/clients/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/explode/generated/clients/mod.rs new file mode 100644 index 000000000..ff02be479 --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/explode/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod routes_path_parameters_simple_expansion_explode_client; +pub use routes_path_parameters_simple_expansion_explode_client::*; diff --git a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_simple_expansion_explode_client.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/explode/generated/clients/routes_path_parameters_simple_expansion_explode_client.rs similarity index 98% rename from packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_simple_expansion_explode_client.rs rename to packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/explode/generated/clients/routes_path_parameters_simple_expansion_explode_client.rs index 655a96156..8e686c4b9 100644 --- a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_simple_expansion_explode_client.rs +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/explode/generated/clients/routes_path_parameters_simple_expansion_explode_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::path_parameters::simple_expansion::explode::generated::models::{ RoutesPathParametersSimpleExpansionExplodeClientArrayOptions, RoutesPathParametersSimpleExpansionExplodeClientPrimitiveOptions, RoutesPathParametersSimpleExpansionExplodeClientRecordOptions, diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/explode/generated/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/explode/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/explode/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/explode/generated/models/method_options.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/explode/generated/models/method_options.rs new file mode 100644 index 000000000..cc86bdf1f --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/explode/generated/models/method_options.rs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`RoutesPathParametersSimpleExpansionExplodeClient::array()`](crate::path_parameters::simple_expansion::explode::generated::clients::RoutesPathParametersSimpleExpansionExplodeClient::array()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesPathParametersSimpleExpansionExplodeClientArrayOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`RoutesPathParametersSimpleExpansionExplodeClient::primitive()`](crate::path_parameters::simple_expansion::explode::generated::clients::RoutesPathParametersSimpleExpansionExplodeClient::primitive()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesPathParametersSimpleExpansionExplodeClientPrimitiveOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`RoutesPathParametersSimpleExpansionExplodeClient::record()`](crate::path_parameters::simple_expansion::explode::generated::clients::RoutesPathParametersSimpleExpansionExplodeClient::record()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesPathParametersSimpleExpansionExplodeClientRecordOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/explode/generated/models/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/explode/generated/models/mod.rs new file mode 100644 index 000000000..3e484b1ed --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/explode/generated/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/explode/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/explode/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/explode/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/generated/clients/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/generated/clients/mod.rs new file mode 100644 index 000000000..a932bb9ec --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod routes_path_parameters_simple_expansion_client; +pub use routes_path_parameters_simple_expansion_client::*; diff --git a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_simple_expansion_client.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/generated/clients/routes_path_parameters_simple_expansion_client.rs similarity index 87% rename from packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_simple_expansion_client.rs rename to packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/generated/clients/routes_path_parameters_simple_expansion_client.rs index 5b84506d8..56e7b527e 100644 --- a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_simple_expansion_client.rs +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/generated/clients/routes_path_parameters_simple_expansion_client.rs @@ -3,9 +3,9 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::clients::{ - RoutesPathParametersSimpleExpansionExplodeClient, - RoutesPathParametersSimpleExpansionStandardClient, +use crate::path_parameters::simple_expansion::{ + explode::clients::RoutesPathParametersSimpleExpansionExplodeClient, + standard::clients::RoutesPathParametersSimpleExpansionStandardClient, }; use azure_core::{ http::{Pipeline, Url}, diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/generated/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/generated/mod.rs new file mode 100644 index 000000000..8aa217ea3 --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/generated/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/mod.rs new file mode 100644 index 000000000..1a2e8cc62 --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; +pub mod explode; +pub mod standard; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/standard/generated/clients/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/standard/generated/clients/mod.rs new file mode 100644 index 000000000..47687aa98 --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/standard/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod routes_path_parameters_simple_expansion_standard_client; +pub use routes_path_parameters_simple_expansion_standard_client::*; diff --git a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_simple_expansion_standard_client.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/standard/generated/clients/routes_path_parameters_simple_expansion_standard_client.rs similarity index 98% rename from packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_simple_expansion_standard_client.rs rename to packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/standard/generated/clients/routes_path_parameters_simple_expansion_standard_client.rs index 1adbdc873..ff9e8cfb8 100644 --- a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_path_parameters_simple_expansion_standard_client.rs +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/standard/generated/clients/routes_path_parameters_simple_expansion_standard_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::path_parameters::simple_expansion::standard::generated::models::{ RoutesPathParametersSimpleExpansionStandardClientArrayOptions, RoutesPathParametersSimpleExpansionStandardClientPrimitiveOptions, RoutesPathParametersSimpleExpansionStandardClientRecordOptions, diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/standard/generated/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/standard/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/standard/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/standard/generated/models/method_options.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/standard/generated/models/method_options.rs new file mode 100644 index 000000000..ae5877973 --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/standard/generated/models/method_options.rs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`RoutesPathParametersSimpleExpansionStandardClient::array()`](crate::path_parameters::simple_expansion::standard::generated::clients::RoutesPathParametersSimpleExpansionStandardClient::array()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesPathParametersSimpleExpansionStandardClientArrayOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`RoutesPathParametersSimpleExpansionStandardClient::primitive()`](crate::path_parameters::simple_expansion::standard::generated::clients::RoutesPathParametersSimpleExpansionStandardClient::primitive()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesPathParametersSimpleExpansionStandardClientPrimitiveOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`RoutesPathParametersSimpleExpansionStandardClient::record()`](crate::path_parameters::simple_expansion::standard::generated::clients::RoutesPathParametersSimpleExpansionStandardClient::record()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesPathParametersSimpleExpansionStandardClientRecordOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/standard/generated/models/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/standard/generated/models/mod.rs new file mode 100644 index 000000000..3e484b1ed --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/standard/generated/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/standard/mod.rs b/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/standard/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/path_parameters/simple_expansion/standard/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/routes/src/query_parameters/generated/clients/mod.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/generated/clients/mod.rs new file mode 100644 index 000000000..74333c362 --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod routes_query_parameters_client; +pub use routes_query_parameters_client::*; diff --git a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_query_parameters_client.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/generated/clients/routes_query_parameters_client.rs similarity index 96% rename from packages/typespec-rust/test/spector/routes/src/generated/clients/routes_query_parameters_client.rs rename to packages/typespec-rust/test/spector/routes/src/query_parameters/generated/clients/routes_query_parameters_client.rs index b3185419a..45330bd6c 100644 --- a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_query_parameters_client.rs +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/generated/clients/routes_query_parameters_client.rs @@ -3,14 +3,13 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::{ - clients::{ - RoutesQueryParametersQueryContinuationClient, RoutesQueryParametersQueryExpansionClient, - }, - models::{ +use crate::query_parameters::{ + generated::models::{ RoutesQueryParametersClientAnnotationOnlyOptions, RoutesQueryParametersClientExplicitOptions, RoutesQueryParametersClientTemplateOnlyOptions, }, + query_continuation::clients::RoutesQueryParametersQueryContinuationClient, + query_expansion::clients::RoutesQueryParametersQueryExpansionClient, }; use azure_core::{ error::CheckSuccessOptions, diff --git a/packages/typespec-rust/test/spector/routes/src/query_parameters/generated/mod.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/routes/src/query_parameters/generated/models/method_options.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/generated/models/method_options.rs new file mode 100644 index 000000000..f557cf24b --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/generated/models/method_options.rs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`RoutesQueryParametersClient::annotation_only()`](crate::query_parameters::generated::clients::RoutesQueryParametersClient::annotation_only()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesQueryParametersClientAnnotationOnlyOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`RoutesQueryParametersClient::explicit()`](crate::query_parameters::generated::clients::RoutesQueryParametersClient::explicit()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesQueryParametersClientExplicitOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`RoutesQueryParametersClient::template_only()`](crate::query_parameters::generated::clients::RoutesQueryParametersClient::template_only()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesQueryParametersClientTemplateOnlyOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/routes/src/query_parameters/generated/models/mod.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/generated/models/mod.rs new file mode 100644 index 000000000..3e484b1ed --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/generated/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/routes/src/query_parameters/mod.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/mod.rs new file mode 100644 index 000000000..f5e69cec1 --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; +pub mod query_continuation; +pub mod query_expansion; diff --git a/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/explode/generated/clients/mod.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/explode/generated/clients/mod.rs new file mode 100644 index 000000000..0b1be8e39 --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/explode/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod routes_query_parameters_query_continuation_explode_client; +pub use routes_query_parameters_query_continuation_explode_client::*; diff --git a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_query_parameters_query_continuation_explode_client.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/explode/generated/clients/routes_query_parameters_query_continuation_explode_client.rs similarity index 98% rename from packages/typespec-rust/test/spector/routes/src/generated/clients/routes_query_parameters_query_continuation_explode_client.rs rename to packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/explode/generated/clients/routes_query_parameters_query_continuation_explode_client.rs index c6a9fed82..0e15db131 100644 --- a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_query_parameters_query_continuation_explode_client.rs +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/explode/generated/clients/routes_query_parameters_query_continuation_explode_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::query_parameters::query_continuation::explode::generated::models::{ RoutesQueryParametersQueryContinuationExplodeClientArrayOptions, RoutesQueryParametersQueryContinuationExplodeClientPrimitiveOptions, RoutesQueryParametersQueryContinuationExplodeClientRecordOptions, diff --git a/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/explode/generated/mod.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/explode/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/explode/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/explode/generated/models/method_options.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/explode/generated/models/method_options.rs new file mode 100644 index 000000000..f2db50f2b --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/explode/generated/models/method_options.rs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`RoutesQueryParametersQueryContinuationExplodeClient::array()`](crate::query_parameters::query_continuation::explode::generated::clients::RoutesQueryParametersQueryContinuationExplodeClient::array()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesQueryParametersQueryContinuationExplodeClientArrayOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`RoutesQueryParametersQueryContinuationExplodeClient::primitive()`](crate::query_parameters::query_continuation::explode::generated::clients::RoutesQueryParametersQueryContinuationExplodeClient::primitive()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesQueryParametersQueryContinuationExplodeClientPrimitiveOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`RoutesQueryParametersQueryContinuationExplodeClient::record()`](crate::query_parameters::query_continuation::explode::generated::clients::RoutesQueryParametersQueryContinuationExplodeClient::record()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesQueryParametersQueryContinuationExplodeClientRecordOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/explode/generated/models/mod.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/explode/generated/models/mod.rs new file mode 100644 index 000000000..3e484b1ed --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/explode/generated/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/explode/mod.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/explode/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/explode/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/generated/clients/mod.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/generated/clients/mod.rs new file mode 100644 index 000000000..ce51d1470 --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod routes_query_parameters_query_continuation_client; +pub use routes_query_parameters_query_continuation_client::*; diff --git a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_query_parameters_query_continuation_client.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/generated/clients/routes_query_parameters_query_continuation_client.rs similarity index 87% rename from packages/typespec-rust/test/spector/routes/src/generated/clients/routes_query_parameters_query_continuation_client.rs rename to packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/generated/clients/routes_query_parameters_query_continuation_client.rs index c76a0d42d..5427fab92 100644 --- a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_query_parameters_query_continuation_client.rs +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/generated/clients/routes_query_parameters_query_continuation_client.rs @@ -3,9 +3,9 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::clients::{ - RoutesQueryParametersQueryContinuationExplodeClient, - RoutesQueryParametersQueryContinuationStandardClient, +use crate::query_parameters::query_continuation::{ + explode::clients::RoutesQueryParametersQueryContinuationExplodeClient, + standard::clients::RoutesQueryParametersQueryContinuationStandardClient, }; use azure_core::{ http::{Pipeline, Url}, diff --git a/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/generated/mod.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/generated/mod.rs new file mode 100644 index 000000000..8aa217ea3 --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/generated/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; diff --git a/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/mod.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/mod.rs new file mode 100644 index 000000000..1a2e8cc62 --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; +pub mod explode; +pub mod standard; diff --git a/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/standard/generated/clients/mod.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/standard/generated/clients/mod.rs new file mode 100644 index 000000000..d4a398291 --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/standard/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod routes_query_parameters_query_continuation_standard_client; +pub use routes_query_parameters_query_continuation_standard_client::*; diff --git a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_query_parameters_query_continuation_standard_client.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/standard/generated/clients/routes_query_parameters_query_continuation_standard_client.rs similarity index 98% rename from packages/typespec-rust/test/spector/routes/src/generated/clients/routes_query_parameters_query_continuation_standard_client.rs rename to packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/standard/generated/clients/routes_query_parameters_query_continuation_standard_client.rs index 84109559c..c313a1f9d 100644 --- a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_query_parameters_query_continuation_standard_client.rs +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/standard/generated/clients/routes_query_parameters_query_continuation_standard_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::query_parameters::query_continuation::standard::generated::models::{ RoutesQueryParametersQueryContinuationStandardClientArrayOptions, RoutesQueryParametersQueryContinuationStandardClientPrimitiveOptions, RoutesQueryParametersQueryContinuationStandardClientRecordOptions, diff --git a/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/standard/generated/mod.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/standard/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/standard/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/standard/generated/models/method_options.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/standard/generated/models/method_options.rs new file mode 100644 index 000000000..e408a2b99 --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/standard/generated/models/method_options.rs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`RoutesQueryParametersQueryContinuationStandardClient::array()`](crate::query_parameters::query_continuation::standard::generated::clients::RoutesQueryParametersQueryContinuationStandardClient::array()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesQueryParametersQueryContinuationStandardClientArrayOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`RoutesQueryParametersQueryContinuationStandardClient::primitive()`](crate::query_parameters::query_continuation::standard::generated::clients::RoutesQueryParametersQueryContinuationStandardClient::primitive()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesQueryParametersQueryContinuationStandardClientPrimitiveOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`RoutesQueryParametersQueryContinuationStandardClient::record()`](crate::query_parameters::query_continuation::standard::generated::clients::RoutesQueryParametersQueryContinuationStandardClient::record()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesQueryParametersQueryContinuationStandardClientRecordOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/standard/generated/models/mod.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/standard/generated/models/mod.rs new file mode 100644 index 000000000..3e484b1ed --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/standard/generated/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/standard/mod.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/standard/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_continuation/standard/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/explode/generated/clients/mod.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/explode/generated/clients/mod.rs new file mode 100644 index 000000000..5f298bed8 --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/explode/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod routes_query_parameters_query_expansion_explode_client; +pub use routes_query_parameters_query_expansion_explode_client::*; diff --git a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_query_parameters_query_expansion_explode_client.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/explode/generated/clients/routes_query_parameters_query_expansion_explode_client.rs similarity index 98% rename from packages/typespec-rust/test/spector/routes/src/generated/clients/routes_query_parameters_query_expansion_explode_client.rs rename to packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/explode/generated/clients/routes_query_parameters_query_expansion_explode_client.rs index 46080df21..3a1ad7f56 100644 --- a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_query_parameters_query_expansion_explode_client.rs +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/explode/generated/clients/routes_query_parameters_query_expansion_explode_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::query_parameters::query_expansion::explode::generated::models::{ RoutesQueryParametersQueryExpansionExplodeClientArrayOptions, RoutesQueryParametersQueryExpansionExplodeClientPrimitiveOptions, RoutesQueryParametersQueryExpansionExplodeClientRecordOptions, diff --git a/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/explode/generated/mod.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/explode/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/explode/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/explode/generated/models/method_options.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/explode/generated/models/method_options.rs new file mode 100644 index 000000000..ff341de4d --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/explode/generated/models/method_options.rs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`RoutesQueryParametersQueryExpansionExplodeClient::array()`](crate::query_parameters::query_expansion::explode::generated::clients::RoutesQueryParametersQueryExpansionExplodeClient::array()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesQueryParametersQueryExpansionExplodeClientArrayOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`RoutesQueryParametersQueryExpansionExplodeClient::primitive()`](crate::query_parameters::query_expansion::explode::generated::clients::RoutesQueryParametersQueryExpansionExplodeClient::primitive()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesQueryParametersQueryExpansionExplodeClientPrimitiveOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`RoutesQueryParametersQueryExpansionExplodeClient::record()`](crate::query_parameters::query_expansion::explode::generated::clients::RoutesQueryParametersQueryExpansionExplodeClient::record()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesQueryParametersQueryExpansionExplodeClientRecordOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/explode/generated/models/mod.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/explode/generated/models/mod.rs new file mode 100644 index 000000000..3e484b1ed --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/explode/generated/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/explode/mod.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/explode/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/explode/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/generated/clients/mod.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/generated/clients/mod.rs new file mode 100644 index 000000000..fe2c8af4d --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod routes_query_parameters_query_expansion_client; +pub use routes_query_parameters_query_expansion_client::*; diff --git a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_query_parameters_query_expansion_client.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/generated/clients/routes_query_parameters_query_expansion_client.rs similarity index 87% rename from packages/typespec-rust/test/spector/routes/src/generated/clients/routes_query_parameters_query_expansion_client.rs rename to packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/generated/clients/routes_query_parameters_query_expansion_client.rs index 907cea9d8..e6de829e3 100644 --- a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_query_parameters_query_expansion_client.rs +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/generated/clients/routes_query_parameters_query_expansion_client.rs @@ -3,9 +3,9 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::clients::{ - RoutesQueryParametersQueryExpansionExplodeClient, - RoutesQueryParametersQueryExpansionStandardClient, +use crate::query_parameters::query_expansion::{ + explode::clients::RoutesQueryParametersQueryExpansionExplodeClient, + standard::clients::RoutesQueryParametersQueryExpansionStandardClient, }; use azure_core::{ http::{Pipeline, Url}, diff --git a/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/generated/mod.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/generated/mod.rs new file mode 100644 index 000000000..8aa217ea3 --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/generated/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; diff --git a/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/mod.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/mod.rs new file mode 100644 index 000000000..1a2e8cc62 --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; +pub mod explode; +pub mod standard; diff --git a/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/standard/generated/clients/mod.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/standard/generated/clients/mod.rs new file mode 100644 index 000000000..644d7411f --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/standard/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod routes_query_parameters_query_expansion_standard_client; +pub use routes_query_parameters_query_expansion_standard_client::*; diff --git a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_query_parameters_query_expansion_standard_client.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/standard/generated/clients/routes_query_parameters_query_expansion_standard_client.rs similarity index 98% rename from packages/typespec-rust/test/spector/routes/src/generated/clients/routes_query_parameters_query_expansion_standard_client.rs rename to packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/standard/generated/clients/routes_query_parameters_query_expansion_standard_client.rs index 3edc717d5..caada7f2a 100644 --- a/packages/typespec-rust/test/spector/routes/src/generated/clients/routes_query_parameters_query_expansion_standard_client.rs +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/standard/generated/clients/routes_query_parameters_query_expansion_standard_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::query_parameters::query_expansion::standard::generated::models::{ RoutesQueryParametersQueryExpansionStandardClientArrayOptions, RoutesQueryParametersQueryExpansionStandardClientPrimitiveOptions, RoutesQueryParametersQueryExpansionStandardClientRecordOptions, diff --git a/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/standard/generated/mod.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/standard/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/standard/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/standard/generated/models/method_options.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/standard/generated/models/method_options.rs new file mode 100644 index 000000000..f32918f7e --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/standard/generated/models/method_options.rs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`RoutesQueryParametersQueryExpansionStandardClient::array()`](crate::query_parameters::query_expansion::standard::generated::clients::RoutesQueryParametersQueryExpansionStandardClient::array()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesQueryParametersQueryExpansionStandardClientArrayOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`RoutesQueryParametersQueryExpansionStandardClient::primitive()`](crate::query_parameters::query_expansion::standard::generated::clients::RoutesQueryParametersQueryExpansionStandardClient::primitive()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesQueryParametersQueryExpansionStandardClientPrimitiveOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`RoutesQueryParametersQueryExpansionStandardClient::record()`](crate::query_parameters::query_expansion::standard::generated::clients::RoutesQueryParametersQueryExpansionStandardClient::record()) +#[derive(Clone, Default, SafeDebug)] +pub struct RoutesQueryParametersQueryExpansionStandardClientRecordOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/standard/generated/models/mod.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/standard/generated/models/mod.rs new file mode 100644 index 000000000..3e484b1ed --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/standard/generated/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/standard/mod.rs b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/standard/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/routes/src/query_parameters/query_expansion/standard/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/generated/clients/json_client.rs b/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/generated/clients/json_client.rs index 3456928dc..611383601 100644 --- a/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/generated/clients/json_client.rs +++ b/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/generated/clients/json_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::clients::JsonPropertyClient; +use crate::property::clients::JsonPropertyClient; use azure_core::{ fmt::SafeDebug, http::{ClientOptions, Pipeline, Url}, diff --git a/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/generated/clients/mod.rs b/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/generated/clients/mod.rs index e101fcd7f..757588ef1 100644 --- a/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/generated/clients/mod.rs +++ b/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/generated/clients/mod.rs @@ -4,6 +4,4 @@ // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. mod json_client; -mod json_property_client; pub use json_client::*; -pub use json_property_client::*; diff --git a/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/generated/mod.rs b/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/generated/mod.rs index c495799d0..4f785f717 100644 --- a/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/generated/mod.rs +++ b/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/generated/mod.rs @@ -5,6 +5,4 @@ /// Clients used to communicate with the service. pub mod clients; -/// Contains all the data structures and types used by the client library. -pub mod models; pub use clients::{JsonClient, JsonClientOptions}; diff --git a/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/lib.rs b/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/lib.rs index cc784e401..4e24cb1eb 100644 --- a/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/lib.rs +++ b/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/lib.rs @@ -7,3 +7,4 @@ mod generated; pub use generated::*; +pub mod property; diff --git a/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/generated/clients/json_property_client.rs b/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/property/generated/clients/json_property_client.rs similarity index 98% rename from packages/typespec-rust/test/spector/serialization/encoded-name/json/src/generated/clients/json_property_client.rs rename to packages/typespec-rust/test/spector/serialization/encoded-name/json/src/property/generated/clients/json_property_client.rs index cec1cbe77..f3227bc69 100644 --- a/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/generated/clients/json_property_client.rs +++ b/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/property/generated/clients/json_property_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::property::generated::models::{ JsonEncodedNameModel, JsonPropertyClientGetOptions, JsonPropertyClientSendOptions, }; use azure_core::{ diff --git a/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/property/generated/clients/mod.rs b/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/property/generated/clients/mod.rs new file mode 100644 index 000000000..998cd57ab --- /dev/null +++ b/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/property/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod json_property_client; +pub use json_property_client::*; diff --git a/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/property/generated/mod.rs b/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/property/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/property/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/generated/models/method_options.rs b/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/property/generated/models/method_options.rs similarity index 86% rename from packages/typespec-rust/test/spector/serialization/encoded-name/json/src/generated/models/method_options.rs rename to packages/typespec-rust/test/spector/serialization/encoded-name/json/src/property/generated/models/method_options.rs index 499deb77d..37f740104 100644 --- a/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/generated/models/method_options.rs +++ b/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/property/generated/models/method_options.rs @@ -5,14 +5,14 @@ use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; -/// Options to be passed to [`JsonPropertyClient::get()`](crate::generated::clients::JsonPropertyClient::get()) +/// Options to be passed to [`JsonPropertyClient::get()`](crate::property::generated::clients::JsonPropertyClient::get()) #[derive(Clone, Default, SafeDebug)] pub struct JsonPropertyClientGetOptions<'a> { /// Allows customization of the method call. pub method_options: ClientMethodOptions<'a>, } -/// Options to be passed to [`JsonPropertyClient::send()`](crate::generated::clients::JsonPropertyClient::send()) +/// Options to be passed to [`JsonPropertyClient::send()`](crate::property::generated::clients::JsonPropertyClient::send()) #[derive(Clone, Default, SafeDebug)] pub struct JsonPropertyClientSendOptions<'a> { /// Allows customization of the method call. diff --git a/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/property/generated/models/mod.rs b/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/property/generated/models/mod.rs new file mode 100644 index 000000000..5dfb21b69 --- /dev/null +++ b/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/property/generated/models/mod.rs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +#[allow(clippy::module_inception)] +mod models; +mod models_impl; +pub use method_options::*; +pub use models::*; diff --git a/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/generated/models/models.rs b/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/property/generated/models/models.rs similarity index 100% rename from packages/typespec-rust/test/spector/serialization/encoded-name/json/src/generated/models/models.rs rename to packages/typespec-rust/test/spector/serialization/encoded-name/json/src/property/generated/models/models.rs diff --git a/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/generated/models/models_impl.rs b/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/property/generated/models/models_impl.rs similarity index 100% rename from packages/typespec-rust/test/spector/serialization/encoded-name/json/src/generated/models/models_impl.rs rename to packages/typespec-rust/test/spector/serialization/encoded-name/json/src/property/generated/models/models_impl.rs diff --git a/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/property/mod.rs b/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/property/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/serialization/encoded-name/json/src/property/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/serialization/encoded-name/json/tests/json_property_tests.rs b/packages/typespec-rust/test/spector/serialization/encoded-name/json/tests/json_property_tests.rs index 8c25c120f..931443714 100644 --- a/packages/typespec-rust/test/spector/serialization/encoded-name/json/tests/json_property_tests.rs +++ b/packages/typespec-rust/test/spector/serialization/encoded-name/json/tests/json_property_tests.rs @@ -2,7 +2,7 @@ // // Licensed under the MIT License. See License.txt in the project root for license information. -use spector_jsonencodedname::{models::JsonEncodedNameModel, JsonClient}; +use spector_jsonencodedname::{property::models::JsonEncodedNameModel, JsonClient}; #[tokio::test] async fn get() { diff --git a/packages/typespec-rust/test/spector/service/multi-service/src/generated/clients/combined_client.rs b/packages/typespec-rust/test/spector/service/multi-service/src/generated/clients/combined_client.rs index 9028b64a5..17de5ca9b 100644 --- a/packages/typespec-rust/test/spector/service/multi-service/src/generated/clients/combined_client.rs +++ b/packages/typespec-rust/test/spector/service/multi-service/src/generated/clients/combined_client.rs @@ -3,7 +3,9 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::clients::{CombinedBarClient, CombinedFooClient}; +use crate::service::multi_service::{ + service_a::clients::CombinedFooClient, service_b::clients::CombinedBarClient, +}; use azure_core::{ fmt::SafeDebug, http::{ClientOptions, Pipeline, Url}, diff --git a/packages/typespec-rust/test/spector/service/multi-service/src/generated/clients/mod.rs b/packages/typespec-rust/test/spector/service/multi-service/src/generated/clients/mod.rs index dfe805f7e..1077e662f 100644 --- a/packages/typespec-rust/test/spector/service/multi-service/src/generated/clients/mod.rs +++ b/packages/typespec-rust/test/spector/service/multi-service/src/generated/clients/mod.rs @@ -3,9 +3,5 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -mod combined_bar_client; mod combined_client; -mod combined_foo_client; -pub use combined_bar_client::*; pub use combined_client::*; -pub use combined_foo_client::*; diff --git a/packages/typespec-rust/test/spector/service/multi-service/src/generated/mod.rs b/packages/typespec-rust/test/spector/service/multi-service/src/generated/mod.rs index b7efb8a4e..2f461297d 100644 --- a/packages/typespec-rust/test/spector/service/multi-service/src/generated/mod.rs +++ b/packages/typespec-rust/test/spector/service/multi-service/src/generated/mod.rs @@ -5,6 +5,4 @@ /// Clients used to communicate with the service. pub mod clients; -/// Contains all the data structures and types used by the client library. -pub mod models; pub use clients::{CombinedClient, CombinedClientOptions}; diff --git a/packages/typespec-rust/test/spector/service/multi-service/src/lib.rs b/packages/typespec-rust/test/spector/service/multi-service/src/lib.rs index cc784e401..f96e70cdb 100644 --- a/packages/typespec-rust/test/spector/service/multi-service/src/lib.rs +++ b/packages/typespec-rust/test/spector/service/multi-service/src/lib.rs @@ -7,3 +7,4 @@ mod generated; pub use generated::*; +pub mod service; diff --git a/packages/typespec-rust/test/spector/service/multi-service/src/service/mod.rs b/packages/typespec-rust/test/spector/service/multi-service/src/service/mod.rs new file mode 100644 index 000000000..ed3c120e5 --- /dev/null +++ b/packages/typespec-rust/test/spector/service/multi-service/src/service/mod.rs @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +pub mod multi_service; diff --git a/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/mod.rs b/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/mod.rs new file mode 100644 index 000000000..e7d428c43 --- /dev/null +++ b/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +pub mod service_a; +pub mod service_b; diff --git a/packages/typespec-rust/test/spector/service/multi-service/src/generated/clients/combined_foo_client.rs b/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_a/generated/clients/combined_foo_client.rs similarity index 94% rename from packages/typespec-rust/test/spector/service/multi-service/src/generated/clients/combined_foo_client.rs rename to packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_a/generated/clients/combined_foo_client.rs index 957ba1a89..63ba2f2b0 100644 --- a/packages/typespec-rust/test/spector/service/multi-service/src/generated/clients/combined_foo_client.rs +++ b/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_a/generated/clients/combined_foo_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::CombinedFooClientTestOptions; +use crate::service::multi_service::service_a::generated::models::CombinedFooClientTestOptions; use azure_core::{ error::CheckSuccessOptions, http::{Method, NoFormat, Pipeline, PipelineSendOptions, Request, Response, Url, UrlExt}, diff --git a/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_a/generated/clients/mod.rs b/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_a/generated/clients/mod.rs new file mode 100644 index 000000000..0043c1b4f --- /dev/null +++ b/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_a/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod combined_foo_client; +pub use combined_foo_client::*; diff --git a/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_a/generated/mod.rs b/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_a/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_a/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_a/generated/models/method_options.rs b/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_a/generated/models/method_options.rs new file mode 100644 index 000000000..96d8973df --- /dev/null +++ b/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_a/generated/models/method_options.rs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`CombinedFooClient::test()`](crate::service::multi_service::service_a::generated::clients::CombinedFooClient::test()) +#[derive(Clone, Default, SafeDebug)] +pub struct CombinedFooClientTestOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_a/generated/models/mod.rs b/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_a/generated/models/mod.rs new file mode 100644 index 000000000..3e484b1ed --- /dev/null +++ b/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_a/generated/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_a/mod.rs b/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_a/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_a/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/service/multi-service/src/generated/clients/combined_bar_client.rs b/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_b/generated/clients/combined_bar_client.rs similarity index 94% rename from packages/typespec-rust/test/spector/service/multi-service/src/generated/clients/combined_bar_client.rs rename to packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_b/generated/clients/combined_bar_client.rs index b633cfebd..4a00ea512 100644 --- a/packages/typespec-rust/test/spector/service/multi-service/src/generated/clients/combined_bar_client.rs +++ b/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_b/generated/clients/combined_bar_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::CombinedBarClientTestOptions; +use crate::service::multi_service::service_b::generated::models::CombinedBarClientTestOptions; use azure_core::{ error::CheckSuccessOptions, http::{Method, NoFormat, Pipeline, PipelineSendOptions, Request, Response, Url, UrlExt}, diff --git a/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_b/generated/clients/mod.rs b/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_b/generated/clients/mod.rs new file mode 100644 index 000000000..7d969ff8a --- /dev/null +++ b/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_b/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod combined_bar_client; +pub use combined_bar_client::*; diff --git a/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_b/generated/mod.rs b/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_b/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_b/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_b/generated/models/method_options.rs b/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_b/generated/models/method_options.rs new file mode 100644 index 000000000..021be1621 --- /dev/null +++ b/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_b/generated/models/method_options.rs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`CombinedBarClient::test()`](crate::service::multi_service::service_b::generated::clients::CombinedBarClient::test()) +#[derive(Clone, Default, SafeDebug)] +pub struct CombinedBarClientTestOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_b/generated/models/mod.rs b/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_b/generated/models/mod.rs new file mode 100644 index 000000000..3e484b1ed --- /dev/null +++ b/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_b/generated/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_b/mod.rs b/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_b/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/service/multi-service/src/service/multi_service/service_b/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/special-words/src/generated/clients/mod.rs b/packages/typespec-rust/test/spector/special-words/src/generated/clients/mod.rs index 67326a92b..f5a266484 100644 --- a/packages/typespec-rust/test/spector/special-words/src/generated/clients/mod.rs +++ b/packages/typespec-rust/test/spector/special-words/src/generated/clients/mod.rs @@ -4,12 +4,8 @@ // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. mod special_words_client; -mod special_words_model_properties_client; -mod special_words_models_client; mod special_words_operations_client; mod special_words_parameters_client; pub use special_words_client::*; -pub use special_words_model_properties_client::*; -pub use special_words_models_client::*; pub use special_words_operations_client::*; pub use special_words_parameters_client::*; diff --git a/packages/typespec-rust/test/spector/special-words/src/generated/clients/special_words_client.rs b/packages/typespec-rust/test/spector/special-words/src/generated/clients/special_words_client.rs index 0c33da862..a76502ecf 100644 --- a/packages/typespec-rust/test/spector/special-words/src/generated/clients/special_words_client.rs +++ b/packages/typespec-rust/test/spector/special-words/src/generated/clients/special_words_client.rs @@ -3,9 +3,10 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::clients::{ - SpecialWordsModelPropertiesClient, SpecialWordsModelsClient, SpecialWordsOperationsClient, - SpecialWordsParametersClient, +use crate::{ + generated::clients::{SpecialWordsOperationsClient, SpecialWordsParametersClient}, + model_properties::clients::SpecialWordsModelPropertiesClient, + models::clients::SpecialWordsModelsClient, }; use azure_core::{ fmt::SafeDebug, diff --git a/packages/typespec-rust/test/spector/special-words/src/generated/models/method_options.rs b/packages/typespec-rust/test/spector/special-words/src/generated/models/method_options.rs index 142aab828..0db06f0f1 100644 --- a/packages/typespec-rust/test/spector/special-words/src/generated/models/method_options.rs +++ b/packages/typespec-rust/test/spector/special-words/src/generated/models/method_options.rs @@ -5,258 +5,6 @@ use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; -/// Options to be passed to [`SpecialWordsModelPropertiesClient::dict_methods()`](crate::generated::clients::SpecialWordsModelPropertiesClient::dict_methods()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelPropertiesClientDictMethodsOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpecialWordsModelPropertiesClient::same_as_model()`](crate::generated::clients::SpecialWordsModelPropertiesClient::same_as_model()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelPropertiesClientSameAsModelOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpecialWordsModelPropertiesClient::with_list()`](crate::generated::clients::SpecialWordsModelPropertiesClient::with_list()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelPropertiesClientWithListOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpecialWordsModelsClient::with_and()`](crate::generated::clients::SpecialWordsModelsClient::with_and()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelsClientWithAndOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpecialWordsModelsClient::with_as()`](crate::generated::clients::SpecialWordsModelsClient::with_as()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelsClientWithAsOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpecialWordsModelsClient::with_assert()`](crate::generated::clients::SpecialWordsModelsClient::with_assert()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelsClientWithAssertOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpecialWordsModelsClient::with_async()`](crate::generated::clients::SpecialWordsModelsClient::with_async()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelsClientWithAsyncOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpecialWordsModelsClient::with_await()`](crate::generated::clients::SpecialWordsModelsClient::with_await()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelsClientWithAwaitOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpecialWordsModelsClient::with_break()`](crate::generated::clients::SpecialWordsModelsClient::with_break()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelsClientWithBreakOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpecialWordsModelsClient::with_class()`](crate::generated::clients::SpecialWordsModelsClient::with_class()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelsClientWithClassOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpecialWordsModelsClient::with_constructor()`](crate::generated::clients::SpecialWordsModelsClient::with_constructor()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelsClientWithConstructorOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpecialWordsModelsClient::with_continue()`](crate::generated::clients::SpecialWordsModelsClient::with_continue()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelsClientWithContinueOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpecialWordsModelsClient::with_def()`](crate::generated::clients::SpecialWordsModelsClient::with_def()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelsClientWithDefOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpecialWordsModelsClient::with_del()`](crate::generated::clients::SpecialWordsModelsClient::with_del()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelsClientWithDelOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpecialWordsModelsClient::with_elif()`](crate::generated::clients::SpecialWordsModelsClient::with_elif()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelsClientWithElifOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpecialWordsModelsClient::with_else()`](crate::generated::clients::SpecialWordsModelsClient::with_else()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelsClientWithElseOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpecialWordsModelsClient::with_except()`](crate::generated::clients::SpecialWordsModelsClient::with_except()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelsClientWithExceptOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpecialWordsModelsClient::with_exec()`](crate::generated::clients::SpecialWordsModelsClient::with_exec()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelsClientWithExecOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpecialWordsModelsClient::with_finally()`](crate::generated::clients::SpecialWordsModelsClient::with_finally()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelsClientWithFinallyOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpecialWordsModelsClient::with_for()`](crate::generated::clients::SpecialWordsModelsClient::with_for()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelsClientWithForOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpecialWordsModelsClient::with_from()`](crate::generated::clients::SpecialWordsModelsClient::with_from()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelsClientWithFromOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpecialWordsModelsClient::with_global()`](crate::generated::clients::SpecialWordsModelsClient::with_global()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelsClientWithGlobalOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpecialWordsModelsClient::with_if()`](crate::generated::clients::SpecialWordsModelsClient::with_if()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelsClientWithIfOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpecialWordsModelsClient::with_import()`](crate::generated::clients::SpecialWordsModelsClient::with_import()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelsClientWithImportOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpecialWordsModelsClient::with_in()`](crate::generated::clients::SpecialWordsModelsClient::with_in()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelsClientWithInOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpecialWordsModelsClient::with_is()`](crate::generated::clients::SpecialWordsModelsClient::with_is()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelsClientWithIsOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpecialWordsModelsClient::with_lambda()`](crate::generated::clients::SpecialWordsModelsClient::with_lambda()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelsClientWithLambdaOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpecialWordsModelsClient::with_not()`](crate::generated::clients::SpecialWordsModelsClient::with_not()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelsClientWithNotOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpecialWordsModelsClient::with_or()`](crate::generated::clients::SpecialWordsModelsClient::with_or()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelsClientWithOrOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpecialWordsModelsClient::with_pass()`](crate::generated::clients::SpecialWordsModelsClient::with_pass()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelsClientWithPassOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpecialWordsModelsClient::with_raise()`](crate::generated::clients::SpecialWordsModelsClient::with_raise()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelsClientWithRaiseOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpecialWordsModelsClient::with_return()`](crate::generated::clients::SpecialWordsModelsClient::with_return()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelsClientWithReturnOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpecialWordsModelsClient::with_try()`](crate::generated::clients::SpecialWordsModelsClient::with_try()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelsClientWithTryOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpecialWordsModelsClient::with_while()`](crate::generated::clients::SpecialWordsModelsClient::with_while()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelsClientWithWhileOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpecialWordsModelsClient::with_with()`](crate::generated::clients::SpecialWordsModelsClient::with_with()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelsClientWithWithOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`SpecialWordsModelsClient::with_yield()`](crate::generated::clients::SpecialWordsModelsClient::with_yield()) -#[derive(Clone, Default, SafeDebug)] -pub struct SpecialWordsModelsClientWithYieldOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - /// Options to be passed to [`SpecialWordsOperationsClient::and()`](crate::generated::clients::SpecialWordsOperationsClient::and()) #[derive(Clone, Default, SafeDebug)] pub struct SpecialWordsOperationsClientAndOptions<'a> { diff --git a/packages/typespec-rust/test/spector/special-words/src/generated/models/mod.rs b/packages/typespec-rust/test/spector/special-words/src/generated/models/mod.rs index 5dfb21b69..3e484b1ed 100644 --- a/packages/typespec-rust/test/spector/special-words/src/generated/models/mod.rs +++ b/packages/typespec-rust/test/spector/special-words/src/generated/models/mod.rs @@ -4,8 +4,4 @@ // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. mod method_options; -#[allow(clippy::module_inception)] -mod models; -mod models_impl; pub use method_options::*; -pub use models::*; diff --git a/packages/typespec-rust/test/spector/special-words/src/lib.rs b/packages/typespec-rust/test/spector/special-words/src/lib.rs index cc784e401..1b21f4a46 100644 --- a/packages/typespec-rust/test/spector/special-words/src/lib.rs +++ b/packages/typespec-rust/test/spector/special-words/src/lib.rs @@ -7,3 +7,5 @@ mod generated; pub use generated::*; +pub mod model_properties; +pub mod models; diff --git a/packages/typespec-rust/test/spector/special-words/src/model_properties/generated/clients/mod.rs b/packages/typespec-rust/test/spector/special-words/src/model_properties/generated/clients/mod.rs new file mode 100644 index 000000000..c7391a6d4 --- /dev/null +++ b/packages/typespec-rust/test/spector/special-words/src/model_properties/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod special_words_model_properties_client; +pub use special_words_model_properties_client::*; diff --git a/packages/typespec-rust/test/spector/special-words/src/generated/clients/special_words_model_properties_client.rs b/packages/typespec-rust/test/spector/special-words/src/model_properties/generated/clients/special_words_model_properties_client.rs similarity index 98% rename from packages/typespec-rust/test/spector/special-words/src/generated/clients/special_words_model_properties_client.rs rename to packages/typespec-rust/test/spector/special-words/src/model_properties/generated/clients/special_words_model_properties_client.rs index 2abf8b384..134b8692a 100644 --- a/packages/typespec-rust/test/spector/special-words/src/generated/clients/special_words_model_properties_client.rs +++ b/packages/typespec-rust/test/spector/special-words/src/model_properties/generated/clients/special_words_model_properties_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::model_properties::generated::models::{ DictMethods, ModelWithList, SameAsModel, SpecialWordsModelPropertiesClientDictMethodsOptions, SpecialWordsModelPropertiesClientSameAsModelOptions, SpecialWordsModelPropertiesClientWithListOptions, diff --git a/packages/typespec-rust/test/spector/special-words/src/model_properties/generated/mod.rs b/packages/typespec-rust/test/spector/special-words/src/model_properties/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/special-words/src/model_properties/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/special-words/src/model_properties/generated/models/method_options.rs b/packages/typespec-rust/test/spector/special-words/src/model_properties/generated/models/method_options.rs new file mode 100644 index 000000000..7ce82e79d --- /dev/null +++ b/packages/typespec-rust/test/spector/special-words/src/model_properties/generated/models/method_options.rs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`SpecialWordsModelPropertiesClient::dict_methods()`](crate::model_properties::generated::clients::SpecialWordsModelPropertiesClient::dict_methods()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelPropertiesClientDictMethodsOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpecialWordsModelPropertiesClient::same_as_model()`](crate::model_properties::generated::clients::SpecialWordsModelPropertiesClient::same_as_model()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelPropertiesClientSameAsModelOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpecialWordsModelPropertiesClient::with_list()`](crate::model_properties::generated::clients::SpecialWordsModelPropertiesClient::with_list()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelPropertiesClientWithListOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/special-words/src/model_properties/generated/models/mod.rs b/packages/typespec-rust/test/spector/special-words/src/model_properties/generated/models/mod.rs new file mode 100644 index 000000000..5dfb21b69 --- /dev/null +++ b/packages/typespec-rust/test/spector/special-words/src/model_properties/generated/models/mod.rs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +#[allow(clippy::module_inception)] +mod models; +mod models_impl; +pub use method_options::*; +pub use models::*; diff --git a/packages/typespec-rust/test/spector/special-words/src/model_properties/generated/models/models.rs b/packages/typespec-rust/test/spector/special-words/src/model_properties/generated/models/models.rs new file mode 100644 index 000000000..1ba3e12e8 --- /dev/null +++ b/packages/typespec-rust/test/spector/special-words/src/model_properties/generated/models/models.rs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::fmt::SafeDebug; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] +pub struct DictMethods { + #[serde(skip_serializing_if = "Option::is_none")] + pub clear: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub copy: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub get: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub items: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub keys: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub pop: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub popitem: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub setdefault: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub update: Option, + + #[serde(skip_serializing_if = "Option::is_none")] + pub values: Option, +} + +#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] +pub struct ModelWithList { + #[serde(skip_serializing_if = "Option::is_none")] + pub list: Option, +} + +#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] +pub struct SameAsModel { + #[serde(rename = "SameAsModel", skip_serializing_if = "Option::is_none")] + pub same_as_model: Option, +} diff --git a/packages/typespec-rust/test/spector/special-words/src/model_properties/generated/models/models_impl.rs b/packages/typespec-rust/test/spector/special-words/src/model_properties/generated/models/models_impl.rs new file mode 100644 index 000000000..55fac8e99 --- /dev/null +++ b/packages/typespec-rust/test/spector/special-words/src/model_properties/generated/models/models_impl.rs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use super::{DictMethods, ModelWithList, SameAsModel}; +use azure_core::{http::RequestContent, json::to_json, Result}; + +impl TryFrom for RequestContent { + type Error = azure_core::Error; + fn try_from(value: DictMethods) -> Result { + Ok(to_json(&value)?.into()) + } +} + +impl TryFrom for RequestContent { + type Error = azure_core::Error; + fn try_from(value: ModelWithList) -> Result { + Ok(to_json(&value)?.into()) + } +} + +impl TryFrom for RequestContent { + type Error = azure_core::Error; + fn try_from(value: SameAsModel) -> Result { + Ok(to_json(&value)?.into()) + } +} diff --git a/packages/typespec-rust/test/spector/special-words/src/model_properties/mod.rs b/packages/typespec-rust/test/spector/special-words/src/model_properties/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/special-words/src/model_properties/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/special-words/src/models/generated/clients/mod.rs b/packages/typespec-rust/test/spector/special-words/src/models/generated/clients/mod.rs new file mode 100644 index 000000000..02779b166 --- /dev/null +++ b/packages/typespec-rust/test/spector/special-words/src/models/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod special_words_models_client; +pub use special_words_models_client::*; diff --git a/packages/typespec-rust/test/spector/special-words/src/generated/clients/special_words_models_client.rs b/packages/typespec-rust/test/spector/special-words/src/models/generated/clients/special_words_models_client.rs similarity index 99% rename from packages/typespec-rust/test/spector/special-words/src/generated/clients/special_words_models_client.rs rename to packages/typespec-rust/test/spector/special-words/src/models/generated/clients/special_words_models_client.rs index 46fcb6543..2186e5414 100644 --- a/packages/typespec-rust/test/spector/special-words/src/generated/clients/special_words_models_client.rs +++ b/packages/typespec-rust/test/spector/special-words/src/models/generated/clients/special_words_models_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ +use crate::models::generated::models::{ And, As, Assert, Async, Await, Break, Class, Constructor, Continue, Def, Del, Elif, Else, Except, Exec, Finally, For, From, Global, If, Import, In, Is, Lambda, Not, Or, Pass, Raise, Return, SpecialWordsModelsClientWithAndOptions, SpecialWordsModelsClientWithAsOptions, diff --git a/packages/typespec-rust/test/spector/special-words/src/models/generated/mod.rs b/packages/typespec-rust/test/spector/special-words/src/models/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/special-words/src/models/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/special-words/src/models/generated/models/method_options.rs b/packages/typespec-rust/test/spector/special-words/src/models/generated/models/method_options.rs new file mode 100644 index 000000000..807527668 --- /dev/null +++ b/packages/typespec-rust/test/spector/special-words/src/models/generated/models/method_options.rs @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`SpecialWordsModelsClient::with_and()`](crate::models::generated::clients::SpecialWordsModelsClient::with_and()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelsClientWithAndOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpecialWordsModelsClient::with_as()`](crate::models::generated::clients::SpecialWordsModelsClient::with_as()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelsClientWithAsOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpecialWordsModelsClient::with_assert()`](crate::models::generated::clients::SpecialWordsModelsClient::with_assert()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelsClientWithAssertOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpecialWordsModelsClient::with_async()`](crate::models::generated::clients::SpecialWordsModelsClient::with_async()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelsClientWithAsyncOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpecialWordsModelsClient::with_await()`](crate::models::generated::clients::SpecialWordsModelsClient::with_await()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelsClientWithAwaitOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpecialWordsModelsClient::with_break()`](crate::models::generated::clients::SpecialWordsModelsClient::with_break()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelsClientWithBreakOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpecialWordsModelsClient::with_class()`](crate::models::generated::clients::SpecialWordsModelsClient::with_class()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelsClientWithClassOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpecialWordsModelsClient::with_constructor()`](crate::models::generated::clients::SpecialWordsModelsClient::with_constructor()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelsClientWithConstructorOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpecialWordsModelsClient::with_continue()`](crate::models::generated::clients::SpecialWordsModelsClient::with_continue()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelsClientWithContinueOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpecialWordsModelsClient::with_def()`](crate::models::generated::clients::SpecialWordsModelsClient::with_def()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelsClientWithDefOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpecialWordsModelsClient::with_del()`](crate::models::generated::clients::SpecialWordsModelsClient::with_del()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelsClientWithDelOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpecialWordsModelsClient::with_elif()`](crate::models::generated::clients::SpecialWordsModelsClient::with_elif()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelsClientWithElifOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpecialWordsModelsClient::with_else()`](crate::models::generated::clients::SpecialWordsModelsClient::with_else()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelsClientWithElseOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpecialWordsModelsClient::with_except()`](crate::models::generated::clients::SpecialWordsModelsClient::with_except()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelsClientWithExceptOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpecialWordsModelsClient::with_exec()`](crate::models::generated::clients::SpecialWordsModelsClient::with_exec()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelsClientWithExecOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpecialWordsModelsClient::with_finally()`](crate::models::generated::clients::SpecialWordsModelsClient::with_finally()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelsClientWithFinallyOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpecialWordsModelsClient::with_for()`](crate::models::generated::clients::SpecialWordsModelsClient::with_for()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelsClientWithForOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpecialWordsModelsClient::with_from()`](crate::models::generated::clients::SpecialWordsModelsClient::with_from()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelsClientWithFromOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpecialWordsModelsClient::with_global()`](crate::models::generated::clients::SpecialWordsModelsClient::with_global()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelsClientWithGlobalOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpecialWordsModelsClient::with_if()`](crate::models::generated::clients::SpecialWordsModelsClient::with_if()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelsClientWithIfOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpecialWordsModelsClient::with_import()`](crate::models::generated::clients::SpecialWordsModelsClient::with_import()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelsClientWithImportOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpecialWordsModelsClient::with_in()`](crate::models::generated::clients::SpecialWordsModelsClient::with_in()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelsClientWithInOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpecialWordsModelsClient::with_is()`](crate::models::generated::clients::SpecialWordsModelsClient::with_is()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelsClientWithIsOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpecialWordsModelsClient::with_lambda()`](crate::models::generated::clients::SpecialWordsModelsClient::with_lambda()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelsClientWithLambdaOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpecialWordsModelsClient::with_not()`](crate::models::generated::clients::SpecialWordsModelsClient::with_not()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelsClientWithNotOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpecialWordsModelsClient::with_or()`](crate::models::generated::clients::SpecialWordsModelsClient::with_or()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelsClientWithOrOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpecialWordsModelsClient::with_pass()`](crate::models::generated::clients::SpecialWordsModelsClient::with_pass()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelsClientWithPassOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpecialWordsModelsClient::with_raise()`](crate::models::generated::clients::SpecialWordsModelsClient::with_raise()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelsClientWithRaiseOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpecialWordsModelsClient::with_return()`](crate::models::generated::clients::SpecialWordsModelsClient::with_return()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelsClientWithReturnOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpecialWordsModelsClient::with_try()`](crate::models::generated::clients::SpecialWordsModelsClient::with_try()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelsClientWithTryOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpecialWordsModelsClient::with_while()`](crate::models::generated::clients::SpecialWordsModelsClient::with_while()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelsClientWithWhileOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpecialWordsModelsClient::with_with()`](crate::models::generated::clients::SpecialWordsModelsClient::with_with()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelsClientWithWithOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`SpecialWordsModelsClient::with_yield()`](crate::models::generated::clients::SpecialWordsModelsClient::with_yield()) +#[derive(Clone, Default, SafeDebug)] +pub struct SpecialWordsModelsClientWithYieldOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/special-words/src/models/generated/models/mod.rs b/packages/typespec-rust/test/spector/special-words/src/models/generated/models/mod.rs new file mode 100644 index 000000000..5dfb21b69 --- /dev/null +++ b/packages/typespec-rust/test/spector/special-words/src/models/generated/models/mod.rs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +#[allow(clippy::module_inception)] +mod models; +mod models_impl; +pub use method_options::*; +pub use models::*; diff --git a/packages/typespec-rust/test/spector/special-words/src/generated/models/models.rs b/packages/typespec-rust/test/spector/special-words/src/models/generated/models/models.rs similarity index 81% rename from packages/typespec-rust/test/spector/special-words/src/generated/models/models.rs rename to packages/typespec-rust/test/spector/special-words/src/models/generated/models/models.rs index cbe8c0e4a..4fd2cd7de 100644 --- a/packages/typespec-rust/test/spector/special-words/src/generated/models/models.rs +++ b/packages/typespec-rust/test/spector/special-words/src/models/generated/models/models.rs @@ -72,39 +72,6 @@ pub struct Del { pub name: Option, } -#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] -pub struct DictMethods { - #[serde(skip_serializing_if = "Option::is_none")] - pub clear: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub copy: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub get: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub items: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub keys: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pop: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub popitem: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub setdefault: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub update: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub values: Option, -} - #[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] pub struct Elif { #[serde(skip_serializing_if = "Option::is_none")] @@ -183,12 +150,6 @@ pub struct Lambda { pub name: Option, } -#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] -pub struct ModelWithList { - #[serde(skip_serializing_if = "Option::is_none")] - pub list: Option, -} - #[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] pub struct Not { #[serde(skip_serializing_if = "Option::is_none")] @@ -219,12 +180,6 @@ pub struct Return { pub name: Option, } -#[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] -pub struct SameAsModel { - #[serde(rename = "SameAsModel", skip_serializing_if = "Option::is_none")] - pub same_as_model: Option, -} - #[derive(Clone, Default, Deserialize, SafeDebug, Serialize)] pub struct Try { #[serde(skip_serializing_if = "Option::is_none")] diff --git a/packages/typespec-rust/test/spector/special-words/src/generated/models/models_impl.rs b/packages/typespec-rust/test/spector/special-words/src/models/generated/models/models_impl.rs similarity index 88% rename from packages/typespec-rust/test/spector/special-words/src/generated/models/models_impl.rs rename to packages/typespec-rust/test/spector/special-words/src/models/generated/models/models_impl.rs index 3e8aa83e9..3151c9d1b 100644 --- a/packages/typespec-rust/test/spector/special-words/src/generated/models/models_impl.rs +++ b/packages/typespec-rust/test/spector/special-words/src/models/generated/models/models_impl.rs @@ -4,9 +4,9 @@ // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. use super::{ - And, As, Assert, Async, Await, Break, Class, Constructor, Continue, Def, Del, DictMethods, - Elif, Else, Except, Exec, Finally, For, From, Global, If, Import, In, Is, Lambda, - ModelWithList, Not, Or, Pass, Raise, Return, SameAsModel, Try, While, With, Yield, + And, As, Assert, Async, Await, Break, Class, Constructor, Continue, Def, Del, Elif, Else, + Except, Exec, Finally, For, From, Global, If, Import, In, Is, Lambda, Not, Or, Pass, Raise, + Return, Try, While, With, Yield, }; use azure_core::{http::RequestContent, json::to_json, Result}; @@ -87,13 +87,6 @@ impl TryFrom for RequestContent { } } -impl TryFrom for RequestContent { - type Error = azure_core::Error; - fn try_from(value: DictMethods) -> Result { - Ok(to_json(&value)?.into()) - } -} - impl TryFrom for RequestContent { type Error = azure_core::Error; fn try_from(value: Elif) -> Result { @@ -185,13 +178,6 @@ impl TryFrom for RequestContent { } } -impl TryFrom for RequestContent { - type Error = azure_core::Error; - fn try_from(value: ModelWithList) -> Result { - Ok(to_json(&value)?.into()) - } -} - impl TryFrom for RequestContent { type Error = azure_core::Error; fn try_from(value: Not) -> Result { @@ -227,13 +213,6 @@ impl TryFrom for RequestContent { } } -impl TryFrom for RequestContent { - type Error = azure_core::Error; - fn try_from(value: SameAsModel) -> Result { - Ok(to_json(&value)?.into()) - } -} - impl TryFrom for RequestContent { type Error = azure_core::Error; fn try_from(value: Try) -> Result { diff --git a/packages/typespec-rust/test/spector/special-words/src/models/mod.rs b/packages/typespec-rust/test/spector/special-words/src/models/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/special-words/src/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/special-words/tests/special_words_model_properties_tests.rs b/packages/typespec-rust/test/spector/special-words/tests/special_words_model_properties_tests.rs index e92a774c9..7acad1681 100644 --- a/packages/typespec-rust/test/spector/special-words/tests/special_words_model_properties_tests.rs +++ b/packages/typespec-rust/test/spector/special-words/tests/special_words_model_properties_tests.rs @@ -4,7 +4,7 @@ use azure_core::http::StatusCode; use spector_specialwords::{ - models::{DictMethods, ModelWithList, SameAsModel}, + model_properties::models::{DictMethods, ModelWithList, SameAsModel}, SpecialWordsClient, }; diff --git a/packages/typespec-rust/test/spector/special-words/tests/special_words_models_tests.rs b/packages/typespec-rust/test/spector/special-words/tests/special_words_models_tests.rs index 685498178..22f8c1d8d 100644 --- a/packages/typespec-rust/test/spector/special-words/tests/special_words_models_tests.rs +++ b/packages/typespec-rust/test/spector/special-words/tests/special_words_models_tests.rs @@ -4,7 +4,7 @@ use spector_specialwords::SpecialWordsClient; -use spector_specialwords::models::{ +use spector_specialwords::models::models::{ And, As, Assert, Async, Await, Break, Class, Constructor, Continue, Def, Del, Elif, Else, Except, Exec, Finally, For, From, Global, If, Import, In, Is, Lambda, Not, Or, Pass, Raise, Return, Try, While, With, Yield, diff --git a/packages/typespec-rust/test/spector/type/model/inheritance/enum-discriminator/src/lib.rs b/packages/typespec-rust/test/spector/type/model/inheritance/enum-discriminator/src/lib.rs index d592efc87..cc784e401 100644 --- a/packages/typespec-rust/test/spector/type/model/inheritance/enum-discriminator/src/lib.rs +++ b/packages/typespec-rust/test/spector/type/model/inheritance/enum-discriminator/src/lib.rs @@ -4,6 +4,6 @@ // Code generated by Microsoft (R) Rust Code Generator. #![cfg_attr(docsrs, feature(doc_cfg))] -#[allow(non_camel_case_types)] + mod generated; pub use generated::*; diff --git a/packages/typespec-rust/test/spector/type/union/discriminated/src/generated/clients/discriminated_envelope_client.rs b/packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/generated/clients/discriminated_envelope_client.rs similarity index 92% rename from packages/typespec-rust/test/spector/type/union/discriminated/src/generated/clients/discriminated_envelope_client.rs rename to packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/generated/clients/discriminated_envelope_client.rs index ec57e2e70..627df6b0d 100644 --- a/packages/typespec-rust/test/spector/type/union/discriminated/src/generated/clients/discriminated_envelope_client.rs +++ b/packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/generated/clients/discriminated_envelope_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::clients::DiscriminatedEnvelopeObjectClient; +use crate::envelope::object::clients::DiscriminatedEnvelopeObjectClient; use azure_core::{ http::{Pipeline, Url}, tracing, diff --git a/packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/generated/clients/mod.rs b/packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/generated/clients/mod.rs new file mode 100644 index 000000000..078ebc3e7 --- /dev/null +++ b/packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/generated/clients/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod discriminated_envelope_client; +pub use discriminated_envelope_client::*; diff --git a/packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/generated/mod.rs b/packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/generated/mod.rs new file mode 100644 index 000000000..8aa217ea3 --- /dev/null +++ b/packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/generated/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; diff --git a/packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/mod.rs b/packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/mod.rs new file mode 100644 index 000000000..2e3b55e64 --- /dev/null +++ b/packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/mod.rs @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; +pub mod object; diff --git a/packages/typespec-rust/test/spector/type/union/discriminated/src/generated/clients/discriminated_envelope_object_client.rs b/packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/object/generated/clients/discriminated_envelope_object_client.rs similarity index 96% rename from packages/typespec-rust/test/spector/type/union/discriminated/src/generated/clients/discriminated_envelope_object_client.rs rename to packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/object/generated/clients/discriminated_envelope_object_client.rs index 026499f5b..b4d75595c 100644 --- a/packages/typespec-rust/test/spector/type/union/discriminated/src/generated/clients/discriminated_envelope_object_client.rs +++ b/packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/object/generated/clients/discriminated_envelope_object_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::clients::{ +use crate::envelope::object::generated::clients::{ DiscriminatedEnvelopeObjectCustomPropertiesClient, DiscriminatedEnvelopeObjectDefaultClient, }; use azure_core::{ diff --git a/packages/typespec-rust/test/spector/type/union/discriminated/src/generated/clients/discriminated_envelope_object_custom_properties_client.rs b/packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/object/generated/clients/discriminated_envelope_object_custom_properties_client.rs similarity index 93% rename from packages/typespec-rust/test/spector/type/union/discriminated/src/generated/clients/discriminated_envelope_object_custom_properties_client.rs rename to packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/object/generated/clients/discriminated_envelope_object_custom_properties_client.rs index f3246e57b..20cf6e93b 100644 --- a/packages/typespec-rust/test/spector/type/union/discriminated/src/generated/clients/discriminated_envelope_object_custom_properties_client.rs +++ b/packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/object/generated/clients/discriminated_envelope_object_custom_properties_client.rs @@ -3,9 +3,12 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ - DiscriminatedEnvelopeObjectCustomPropertiesClientGetOptions, - DiscriminatedEnvelopeObjectCustomPropertiesClientPutOptions, PetWithCustomNames, +use crate::{ + envelope::object::generated::models::{ + DiscriminatedEnvelopeObjectCustomPropertiesClientGetOptions, + DiscriminatedEnvelopeObjectCustomPropertiesClientPutOptions, + }, + models::PetWithCustomNames, }; use azure_core::{ error::CheckSuccessOptions, diff --git a/packages/typespec-rust/test/spector/type/union/discriminated/src/generated/clients/discriminated_envelope_object_default_client.rs b/packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/object/generated/clients/discriminated_envelope_object_default_client.rs similarity index 93% rename from packages/typespec-rust/test/spector/type/union/discriminated/src/generated/clients/discriminated_envelope_object_default_client.rs rename to packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/object/generated/clients/discriminated_envelope_object_default_client.rs index c662e07f5..9c09ee780 100644 --- a/packages/typespec-rust/test/spector/type/union/discriminated/src/generated/clients/discriminated_envelope_object_default_client.rs +++ b/packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/object/generated/clients/discriminated_envelope_object_default_client.rs @@ -3,9 +3,12 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ - DiscriminatedEnvelopeObjectDefaultClientGetOptions, - DiscriminatedEnvelopeObjectDefaultClientPutOptions, PetWithEnvelope, +use crate::{ + envelope::object::generated::models::{ + DiscriminatedEnvelopeObjectDefaultClientGetOptions, + DiscriminatedEnvelopeObjectDefaultClientPutOptions, + }, + models::PetWithEnvelope, }; use azure_core::{ error::CheckSuccessOptions, diff --git a/packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/object/generated/clients/mod.rs b/packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/object/generated/clients/mod.rs new file mode 100644 index 000000000..83475d97a --- /dev/null +++ b/packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/object/generated/clients/mod.rs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod discriminated_envelope_object_client; +mod discriminated_envelope_object_custom_properties_client; +mod discriminated_envelope_object_default_client; +pub use discriminated_envelope_object_client::*; +pub use discriminated_envelope_object_custom_properties_client::*; +pub use discriminated_envelope_object_default_client::*; diff --git a/packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/object/generated/mod.rs b/packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/object/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/object/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/object/generated/models/method_options.rs b/packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/object/generated/models/method_options.rs new file mode 100644 index 000000000..a7c08a936 --- /dev/null +++ b/packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/object/generated/models/method_options.rs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`DiscriminatedEnvelopeObjectCustomPropertiesClient::get()`](crate::envelope::object::generated::clients::DiscriminatedEnvelopeObjectCustomPropertiesClient::get()) +#[derive(Clone, Default, SafeDebug)] +pub struct DiscriminatedEnvelopeObjectCustomPropertiesClientGetOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, + + pub pet_type: Option, +} + +/// Options to be passed to [`DiscriminatedEnvelopeObjectCustomPropertiesClient::put()`](crate::envelope::object::generated::clients::DiscriminatedEnvelopeObjectCustomPropertiesClient::put()) +#[derive(Clone, Default, SafeDebug)] +pub struct DiscriminatedEnvelopeObjectCustomPropertiesClientPutOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DiscriminatedEnvelopeObjectDefaultClient::get()`](crate::envelope::object::generated::clients::DiscriminatedEnvelopeObjectDefaultClient::get()) +#[derive(Clone, Default, SafeDebug)] +pub struct DiscriminatedEnvelopeObjectDefaultClientGetOptions<'a> { + pub kind: Option, + + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DiscriminatedEnvelopeObjectDefaultClient::put()`](crate::envelope::object::generated::clients::DiscriminatedEnvelopeObjectDefaultClient::put()) +#[derive(Clone, Default, SafeDebug)] +pub struct DiscriminatedEnvelopeObjectDefaultClientPutOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/object/generated/models/mod.rs b/packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/object/generated/models/mod.rs new file mode 100644 index 000000000..3e484b1ed --- /dev/null +++ b/packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/object/generated/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/object/mod.rs b/packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/object/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/type/union/discriminated/src/envelope/object/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/type/union/discriminated/src/generated/clients/discriminated_client.rs b/packages/typespec-rust/test/spector/type/union/discriminated/src/generated/clients/discriminated_client.rs index 1bf6e3c5f..81e279b31 100644 --- a/packages/typespec-rust/test/spector/type/union/discriminated/src/generated/clients/discriminated_client.rs +++ b/packages/typespec-rust/test/spector/type/union/discriminated/src/generated/clients/discriminated_client.rs @@ -3,7 +3,10 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::clients::{DiscriminatedEnvelopeClient, DiscriminatedNoEnvelopeClient}; +use crate::{ + envelope::clients::DiscriminatedEnvelopeClient, + no_envelope::clients::DiscriminatedNoEnvelopeClient, +}; use azure_core::{ fmt::SafeDebug, http::{ClientOptions, Pipeline, Url}, diff --git a/packages/typespec-rust/test/spector/type/union/discriminated/src/generated/clients/mod.rs b/packages/typespec-rust/test/spector/type/union/discriminated/src/generated/clients/mod.rs index 0d6056b36..17370653b 100644 --- a/packages/typespec-rust/test/spector/type/union/discriminated/src/generated/clients/mod.rs +++ b/packages/typespec-rust/test/spector/type/union/discriminated/src/generated/clients/mod.rs @@ -4,18 +4,4 @@ // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. mod discriminated_client; -mod discriminated_envelope_client; -mod discriminated_envelope_object_client; -mod discriminated_envelope_object_custom_properties_client; -mod discriminated_envelope_object_default_client; -mod discriminated_no_envelope_client; -mod discriminated_no_envelope_custom_discriminator_client; -mod discriminated_no_envelope_default_client; pub use discriminated_client::*; -pub use discriminated_envelope_client::*; -pub use discriminated_envelope_object_client::*; -pub use discriminated_envelope_object_custom_properties_client::*; -pub use discriminated_envelope_object_default_client::*; -pub use discriminated_no_envelope_client::*; -pub use discriminated_no_envelope_custom_discriminator_client::*; -pub use discriminated_no_envelope_default_client::*; diff --git a/packages/typespec-rust/test/spector/type/union/discriminated/src/generated/models/method_options.rs b/packages/typespec-rust/test/spector/type/union/discriminated/src/generated/models/method_options.rs deleted file mode 100644 index 3cd1bdca5..000000000 --- a/packages/typespec-rust/test/spector/type/union/discriminated/src/generated/models/method_options.rs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// -// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. - -use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; - -/// Options to be passed to [`DiscriminatedEnvelopeObjectCustomPropertiesClient::get()`](crate::generated::clients::DiscriminatedEnvelopeObjectCustomPropertiesClient::get()) -#[derive(Clone, Default, SafeDebug)] -pub struct DiscriminatedEnvelopeObjectCustomPropertiesClientGetOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, - - pub pet_type: Option, -} - -/// Options to be passed to [`DiscriminatedEnvelopeObjectCustomPropertiesClient::put()`](crate::generated::clients::DiscriminatedEnvelopeObjectCustomPropertiesClient::put()) -#[derive(Clone, Default, SafeDebug)] -pub struct DiscriminatedEnvelopeObjectCustomPropertiesClientPutOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DiscriminatedEnvelopeObjectDefaultClient::get()`](crate::generated::clients::DiscriminatedEnvelopeObjectDefaultClient::get()) -#[derive(Clone, Default, SafeDebug)] -pub struct DiscriminatedEnvelopeObjectDefaultClientGetOptions<'a> { - pub kind: Option, - - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DiscriminatedEnvelopeObjectDefaultClient::put()`](crate::generated::clients::DiscriminatedEnvelopeObjectDefaultClient::put()) -#[derive(Clone, Default, SafeDebug)] -pub struct DiscriminatedEnvelopeObjectDefaultClientPutOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DiscriminatedNoEnvelopeCustomDiscriminatorClient::get()`](crate::generated::clients::DiscriminatedNoEnvelopeCustomDiscriminatorClient::get()) -#[derive(Clone, Default, SafeDebug)] -pub struct DiscriminatedNoEnvelopeCustomDiscriminatorClientGetOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, - - pub type_param: Option, -} - -/// Options to be passed to [`DiscriminatedNoEnvelopeCustomDiscriminatorClient::put()`](crate::generated::clients::DiscriminatedNoEnvelopeCustomDiscriminatorClient::put()) -#[derive(Clone, Default, SafeDebug)] -pub struct DiscriminatedNoEnvelopeCustomDiscriminatorClientPutOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DiscriminatedNoEnvelopeDefaultClient::get()`](crate::generated::clients::DiscriminatedNoEnvelopeDefaultClient::get()) -#[derive(Clone, Default, SafeDebug)] -pub struct DiscriminatedNoEnvelopeDefaultClientGetOptions<'a> { - pub kind: Option, - - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} - -/// Options to be passed to [`DiscriminatedNoEnvelopeDefaultClient::put()`](crate::generated::clients::DiscriminatedNoEnvelopeDefaultClient::put()) -#[derive(Clone, Default, SafeDebug)] -pub struct DiscriminatedNoEnvelopeDefaultClientPutOptions<'a> { - /// Allows customization of the method call. - pub method_options: ClientMethodOptions<'a>, -} diff --git a/packages/typespec-rust/test/spector/type/union/discriminated/src/generated/models/mod.rs b/packages/typespec-rust/test/spector/type/union/discriminated/src/generated/models/mod.rs index 58b05be1a..60a631495 100644 --- a/packages/typespec-rust/test/spector/type/union/discriminated/src/generated/models/mod.rs +++ b/packages/typespec-rust/test/spector/type/union/discriminated/src/generated/models/mod.rs @@ -3,12 +3,10 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -mod method_options; #[allow(clippy::module_inception)] mod models; mod models_impl; mod unions; mod unions_impl; -pub use method_options::*; pub use models::*; pub use unions::*; diff --git a/packages/typespec-rust/test/spector/type/union/discriminated/src/lib.rs b/packages/typespec-rust/test/spector/type/union/discriminated/src/lib.rs index cc784e401..5471d37df 100644 --- a/packages/typespec-rust/test/spector/type/union/discriminated/src/lib.rs +++ b/packages/typespec-rust/test/spector/type/union/discriminated/src/lib.rs @@ -7,3 +7,5 @@ mod generated; pub use generated::*; +pub mod envelope; +pub mod no_envelope; diff --git a/packages/typespec-rust/test/spector/type/union/discriminated/src/generated/clients/discriminated_no_envelope_client.rs b/packages/typespec-rust/test/spector/type/union/discriminated/src/no_envelope/generated/clients/discriminated_no_envelope_client.rs similarity index 96% rename from packages/typespec-rust/test/spector/type/union/discriminated/src/generated/clients/discriminated_no_envelope_client.rs rename to packages/typespec-rust/test/spector/type/union/discriminated/src/no_envelope/generated/clients/discriminated_no_envelope_client.rs index c4e404c28..b1915c376 100644 --- a/packages/typespec-rust/test/spector/type/union/discriminated/src/generated/clients/discriminated_no_envelope_client.rs +++ b/packages/typespec-rust/test/spector/type/union/discriminated/src/no_envelope/generated/clients/discriminated_no_envelope_client.rs @@ -3,7 +3,7 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::clients::{ +use crate::no_envelope::generated::clients::{ DiscriminatedNoEnvelopeCustomDiscriminatorClient, DiscriminatedNoEnvelopeDefaultClient, }; use azure_core::{ diff --git a/packages/typespec-rust/test/spector/type/union/discriminated/src/generated/clients/discriminated_no_envelope_custom_discriminator_client.rs b/packages/typespec-rust/test/spector/type/union/discriminated/src/no_envelope/generated/clients/discriminated_no_envelope_custom_discriminator_client.rs similarity index 93% rename from packages/typespec-rust/test/spector/type/union/discriminated/src/generated/clients/discriminated_no_envelope_custom_discriminator_client.rs rename to packages/typespec-rust/test/spector/type/union/discriminated/src/no_envelope/generated/clients/discriminated_no_envelope_custom_discriminator_client.rs index bbe68f977..c622f62ca 100644 --- a/packages/typespec-rust/test/spector/type/union/discriminated/src/generated/clients/discriminated_no_envelope_custom_discriminator_client.rs +++ b/packages/typespec-rust/test/spector/type/union/discriminated/src/no_envelope/generated/clients/discriminated_no_envelope_custom_discriminator_client.rs @@ -3,9 +3,12 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ - DiscriminatedNoEnvelopeCustomDiscriminatorClientGetOptions, - DiscriminatedNoEnvelopeCustomDiscriminatorClientPutOptions, PetInlineWithCustomDiscriminator, +use crate::{ + models::PetInlineWithCustomDiscriminator, + no_envelope::generated::models::{ + DiscriminatedNoEnvelopeCustomDiscriminatorClientGetOptions, + DiscriminatedNoEnvelopeCustomDiscriminatorClientPutOptions, + }, }; use azure_core::{ error::CheckSuccessOptions, diff --git a/packages/typespec-rust/test/spector/type/union/discriminated/src/generated/clients/discriminated_no_envelope_default_client.rs b/packages/typespec-rust/test/spector/type/union/discriminated/src/no_envelope/generated/clients/discriminated_no_envelope_default_client.rs similarity index 94% rename from packages/typespec-rust/test/spector/type/union/discriminated/src/generated/clients/discriminated_no_envelope_default_client.rs rename to packages/typespec-rust/test/spector/type/union/discriminated/src/no_envelope/generated/clients/discriminated_no_envelope_default_client.rs index 06e53a996..5d943befd 100644 --- a/packages/typespec-rust/test/spector/type/union/discriminated/src/generated/clients/discriminated_no_envelope_default_client.rs +++ b/packages/typespec-rust/test/spector/type/union/discriminated/src/no_envelope/generated/clients/discriminated_no_envelope_default_client.rs @@ -3,9 +3,12 @@ // // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use crate::generated::models::{ - DiscriminatedNoEnvelopeDefaultClientGetOptions, DiscriminatedNoEnvelopeDefaultClientPutOptions, - PetInline, +use crate::{ + models::PetInline, + no_envelope::generated::models::{ + DiscriminatedNoEnvelopeDefaultClientGetOptions, + DiscriminatedNoEnvelopeDefaultClientPutOptions, + }, }; use azure_core::{ error::CheckSuccessOptions, diff --git a/packages/typespec-rust/test/spector/type/union/discriminated/src/no_envelope/generated/clients/mod.rs b/packages/typespec-rust/test/spector/type/union/discriminated/src/no_envelope/generated/clients/mod.rs new file mode 100644 index 000000000..4f79ca64e --- /dev/null +++ b/packages/typespec-rust/test/spector/type/union/discriminated/src/no_envelope/generated/clients/mod.rs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod discriminated_no_envelope_client; +mod discriminated_no_envelope_custom_discriminator_client; +mod discriminated_no_envelope_default_client; +pub use discriminated_no_envelope_client::*; +pub use discriminated_no_envelope_custom_discriminator_client::*; +pub use discriminated_no_envelope_default_client::*; diff --git a/packages/typespec-rust/test/spector/type/union/discriminated/src/no_envelope/generated/mod.rs b/packages/typespec-rust/test/spector/type/union/discriminated/src/no_envelope/generated/mod.rs new file mode 100644 index 000000000..ac0b31a6a --- /dev/null +++ b/packages/typespec-rust/test/spector/type/union/discriminated/src/no_envelope/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +/// Clients used to communicate with the service. +pub mod clients; +/// Contains all the data structures and types used by the client library. +pub mod models; diff --git a/packages/typespec-rust/test/spector/type/union/discriminated/src/no_envelope/generated/models/method_options.rs b/packages/typespec-rust/test/spector/type/union/discriminated/src/no_envelope/generated/models/method_options.rs new file mode 100644 index 000000000..bea83503d --- /dev/null +++ b/packages/typespec-rust/test/spector/type/union/discriminated/src/no_envelope/generated/models/method_options.rs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{fmt::SafeDebug, http::ClientMethodOptions}; + +/// Options to be passed to [`DiscriminatedNoEnvelopeCustomDiscriminatorClient::get()`](crate::no_envelope::generated::clients::DiscriminatedNoEnvelopeCustomDiscriminatorClient::get()) +#[derive(Clone, Default, SafeDebug)] +pub struct DiscriminatedNoEnvelopeCustomDiscriminatorClientGetOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, + + pub type_param: Option, +} + +/// Options to be passed to [`DiscriminatedNoEnvelopeCustomDiscriminatorClient::put()`](crate::no_envelope::generated::clients::DiscriminatedNoEnvelopeCustomDiscriminatorClient::put()) +#[derive(Clone, Default, SafeDebug)] +pub struct DiscriminatedNoEnvelopeCustomDiscriminatorClientPutOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DiscriminatedNoEnvelopeDefaultClient::get()`](crate::no_envelope::generated::clients::DiscriminatedNoEnvelopeDefaultClient::get()) +#[derive(Clone, Default, SafeDebug)] +pub struct DiscriminatedNoEnvelopeDefaultClientGetOptions<'a> { + pub kind: Option, + + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} + +/// Options to be passed to [`DiscriminatedNoEnvelopeDefaultClient::put()`](crate::no_envelope::generated::clients::DiscriminatedNoEnvelopeDefaultClient::put()) +#[derive(Clone, Default, SafeDebug)] +pub struct DiscriminatedNoEnvelopeDefaultClientPutOptions<'a> { + /// Allows customization of the method call. + pub method_options: ClientMethodOptions<'a>, +} diff --git a/packages/typespec-rust/test/spector/type/union/discriminated/src/no_envelope/generated/models/mod.rs b/packages/typespec-rust/test/spector/type/union/discriminated/src/no_envelope/generated/models/mod.rs new file mode 100644 index 000000000..3e484b1ed --- /dev/null +++ b/packages/typespec-rust/test/spector/type/union/discriminated/src/no_envelope/generated/models/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod method_options; +pub use method_options::*; diff --git a/packages/typespec-rust/test/spector/type/union/discriminated/src/no_envelope/mod.rs b/packages/typespec-rust/test/spector/type/union/discriminated/src/no_envelope/mod.rs new file mode 100644 index 000000000..bc612bfcd --- /dev/null +++ b/packages/typespec-rust/test/spector/type/union/discriminated/src/no_envelope/mod.rs @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; +pub use generated::*; diff --git a/packages/typespec-rust/test/spector/type/union/discriminated/tests/discriminated_union_test.rs b/packages/typespec-rust/test/spector/type/union/discriminated/tests/discriminated_union_test.rs index ad6ae572e..67f68d0c9 100644 --- a/packages/typespec-rust/test/spector/type/union/discriminated/tests/discriminated_union_test.rs +++ b/packages/typespec-rust/test/spector/type/union/discriminated/tests/discriminated_union_test.rs @@ -2,15 +2,15 @@ // // Licensed under the MIT License. See License.txt in the project root for license information. +use spector_union_discriminated::envelope::object::models::DiscriminatedEnvelopeObjectCustomPropertiesClientGetOptions; +use spector_union_discriminated::envelope::object::models::DiscriminatedEnvelopeObjectDefaultClientGetOptions; use spector_union_discriminated::models::Cat; -use spector_union_discriminated::models::DiscriminatedEnvelopeObjectCustomPropertiesClientGetOptions; -use spector_union_discriminated::models::DiscriminatedEnvelopeObjectDefaultClientGetOptions; -use spector_union_discriminated::models::DiscriminatedNoEnvelopeCustomDiscriminatorClientGetOptions; -use spector_union_discriminated::models::DiscriminatedNoEnvelopeDefaultClientGetOptions; use spector_union_discriminated::models::PetInline; use spector_union_discriminated::models::PetInlineWithCustomDiscriminator; use spector_union_discriminated::models::PetWithCustomNames; use spector_union_discriminated::models::PetWithEnvelope; +use spector_union_discriminated::no_envelope::models::DiscriminatedNoEnvelopeCustomDiscriminatorClientGetOptions; +use spector_union_discriminated::no_envelope::models::DiscriminatedNoEnvelopeDefaultClientGetOptions; use spector_union_discriminated::DiscriminatedClient; #[tokio::test] From 8d20cc980f2239be9db28a1abda953aa36c12635 Mon Sep 17 00:00:00 2001 From: Joel Hendrix Date: Tue, 24 Feb 2026 14:23:13 -0800 Subject: [PATCH 2/6] ignore spelling --- packages/typespec-rust/src/tcgcadapter/adapter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/typespec-rust/src/tcgcadapter/adapter.ts b/packages/typespec-rust/src/tcgcadapter/adapter.ts index 12feb2533..9ff938b61 100644 --- a/packages/typespec-rust/src/tcgcadapter/adapter.ts +++ b/packages/typespec-rust/src/tcgcadapter/adapter.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -// cspell: ignore addl responseheader subclients lropaging +// cspell: ignore addl clientgenerator resourcemanager responseheader subclients lropaging import * as tsp from '@typespec/compiler'; import * as http from '@typespec/http'; From 8098cbab3f0c24c9f781f6c7493dfbcc9b8724dd Mon Sep 17 00:00:00 2001 From: Joel Hendrix Date: Tue, 24 Feb 2026 14:27:31 -0800 Subject: [PATCH 3/6] add missing param doc comment --- packages/typespec-rust/src/codegen/lib.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/typespec-rust/src/codegen/lib.ts b/packages/typespec-rust/src/codegen/lib.ts index cc0c9356c..4c7d547e2 100644 --- a/packages/typespec-rust/src/codegen/lib.ts +++ b/packages/typespec-rust/src/codegen/lib.ts @@ -9,6 +9,7 @@ import * as rust from '../codemodel/index.js'; /** * emits the contents of the lib.rs file * + * @param crate the crate for which to emit the lib.rs file * @returns the contents of the lib.rs file */ export function emitLibRs(crate: rust.Crate): string { From f0af353c8f45d14d04a62c9561dc4265e4cd5ce5 Mon Sep 17 00:00:00 2001 From: Joel Hendrix Date: Tue, 24 Feb 2026 15:53:21 -0800 Subject: [PATCH 4/6] use const instead of magic string --- packages/typespec-rust/src/codegen/helpers.ts | 5 ++++- packages/typespec-rust/src/emitter.ts | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/typespec-rust/src/codegen/helpers.ts b/packages/typespec-rust/src/codegen/helpers.ts index b9aa786c5..d860c087d 100644 --- a/packages/typespec-rust/src/codegen/helpers.ts +++ b/packages/typespec-rust/src/codegen/helpers.ts @@ -8,10 +8,13 @@ import { Use } from './use.js'; import * as rust from '../codemodel/index.js'; import * as utils from '../utils/utils.js'; +/** the key phrase used in the generated code header */ +export const generatedCodeKeyPhrase = 'Rust Code Generator'; + const headerText = `// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // -// Code generated by Microsoft (R) Rust Code Generator.`; +// Code generated by Microsoft (R) ${generatedCodeKeyPhrase}.`; export const AnnotationNonExhaustive = '#[non_exhaustive]\n'; diff --git a/packages/typespec-rust/src/emitter.ts b/packages/typespec-rust/src/emitter.ts index 743620bc5..43dfa6ab1 100644 --- a/packages/typespec-rust/src/emitter.ts +++ b/packages/typespec-rust/src/emitter.ts @@ -7,6 +7,7 @@ import { CodeGenerator } from './codegen/codeGenerator.js'; import { CodegenError } from './codegen/errors.js'; +import { generatedCodeKeyPhrase } from './codegen/helpers.js'; import { Adapter, AdapterError, ExternalError } from './tcgcadapter/adapter.js'; import { reportDiagnostic, RustEmitterOptions } from './lib.js'; import { execSync } from 'child_process'; @@ -188,5 +189,5 @@ function shouldRmDir(dirName: string): boolean { return false; } const content = fs.readFileSync(modRs, { encoding: 'utf-8' }); - return content.match(/Rust Code Generator/) !== null; + return content.match(generatedCodeKeyPhrase) !== null; } From bb67d542d4a5fc157bea17181296e9b59468a0e0 Mon Sep 17 00:00:00 2001 From: Joel Hendrix Date: Tue, 24 Feb 2026 16:27:04 -0800 Subject: [PATCH 5/6] add blob storage clients to root namespace after rebase --- .../test/tsp/Microsoft.BlobStorage/client.tsp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/typespec-rust/test/tsp/Microsoft.BlobStorage/client.tsp b/packages/typespec-rust/test/tsp/Microsoft.BlobStorage/client.tsp index 3d55d0394..60b1c85f1 100644 --- a/packages/typespec-rust/test/tsp/Microsoft.BlobStorage/client.tsp +++ b/packages/typespec-rust/test/tsp/Microsoft.BlobStorage/client.tsp @@ -109,6 +109,13 @@ interface PageBlobClient extends Storage.Blob.PageBlob {} @@clientNamespace(Storage.Blob.BlockBlob, "Azure.Storage.Blobs"); @@clientNamespace(Storage.Blob.PageBlob, "Azure.Storage.Blobs"); +@@clientNamespace(BlobServiceClient, "Azure.Storage.Blobs"); +@@clientNamespace(BlobContainerClient, "Azure.Storage.Blobs"); +@@clientNamespace(BlobClient, "Azure.Storage.Blobs"); +@@clientNamespace(AppendBlobClient, "Azure.Storage.Blobs"); +@@clientNamespace(BlockBlobClient, "Azure.Storage.Blobs"); +@@clientNamespace(PageBlobClient, "Azure.Storage.Blobs"); + @@clientName(Storage.Blob.BlockBlob.upload, "upload_internal", "rust"); @@clientName(Storage.Blob.Blob.download, "download_internal", "rust"); From 8d77a264c138a5e7e66d373bfad6ee0d186e3f3b Mon Sep 17 00:00:00 2001 From: Joel Hendrix Date: Wed, 25 Feb 2026 09:05:10 -0800 Subject: [PATCH 6/6] fix thrown error and update changelog --- packages/typespec-rust/CHANGELOG.md | 2 ++ packages/typespec-rust/src/tcgcadapter/adapter.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/typespec-rust/CHANGELOG.md b/packages/typespec-rust/CHANGELOG.md index 542d309eb..8704311a4 100644 --- a/packages/typespec-rust/CHANGELOG.md +++ b/packages/typespec-rust/CHANGELOG.md @@ -5,6 +5,8 @@ ### Breaking Changes * TypeSpec namespaces are now honored and emitted as sub-modules. + * The root namespace is selected from the first defined client. All content in the root namespace is exported as `crate_name::clients::*` and `crate_name::models::*`. + * If there are no defined clients, the the root namespace is selected from a non-core model type. ## 0.35.0 (2026-02-13) diff --git a/packages/typespec-rust/src/tcgcadapter/adapter.ts b/packages/typespec-rust/src/tcgcadapter/adapter.ts index 9ff938b61..23bd4f5d4 100644 --- a/packages/typespec-rust/src/tcgcadapter/adapter.ts +++ b/packages/typespec-rust/src/tcgcadapter/adapter.ts @@ -124,7 +124,7 @@ export class Adapter { } if (this.rootNamespace === '') { - throw new Error('missing namespace'); + throw new AdapterError('UnsupportedTsp', 'unable to determine root namespace'); } let serviceType: rust.ServiceType = 'data-plane';